From 750d86a4fc04f53024575d65269281ea6c4e450c Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 16 Apr 2014 20:36:35 +0000 Subject: Clean up dangerous strncpy use. This included a use where the resulting string was potentially not nul terminated and a place where malloc return was unchecked. while we're at it remove dummytest.c ok miod@ --- src/lib/libssl/test/dummytest.c | 48 ----------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/lib/libssl/test/dummytest.c (limited to 'src/lib/libssl/test/dummytest.c') diff --git a/src/lib/libssl/test/dummytest.c b/src/lib/libssl/test/dummytest.c deleted file mode 100644 index 5b4467e042..0000000000 --- a/src/lib/libssl/test/dummytest.c +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) - { - char *p, *q = 0, *program; - - p = strrchr(argv[0], '/'); - if (!p) p = strrchr(argv[0], '\\'); -#ifdef OPENSSL_SYS_VMS - if (!p) p = strrchr(argv[0], ']'); - if (p) q = strrchr(p, '>'); - if (q) p = q; - if (!p) p = strrchr(argv[0], ':'); - q = 0; -#endif - if (p) p++; - if (!p) p = argv[0]; - if (p) q = strchr(p, '.'); - if (p && !q) q = p + strlen(p); - - if (!p) - program = BUF_strdup("(unknown)"); - else - { - program = OPENSSL_malloc((q - p) + 1); - strncpy(program, p, q - p); - program[q - p] = '\0'; - } - - for(p = program; *p; p++) - if (islower((unsigned char)(*p))) - *p = toupper((unsigned char)(*p)); - - q = strstr(program, "TEST"); - if (q > p && q[-1] == '_') q--; - *q = '\0'; - - printf("No %s support\n", program); - - OPENSSL_free(program); - return(0); - } -- cgit v1.2.3-55-g6feb