summaryrefslogtreecommitdiff
path: root/lib/libssl/test
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2014-04-16 20:36:36 +0000
committerBob Beck <beck@cvs.openbsd.org>2014-04-16 20:36:36 +0000
commitd1c2971263880f9044c4db378bfe322cd012ab6b (patch)
tree82de2a1c14ed3c0460aee84a4ab93ae1926ec0e8 /lib/libssl/test
parent3f685da64fbe6a0bfd196676b1df47f23191c443 (diff)
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@
Diffstat (limited to 'lib/libssl/test')
-rw-r--r--lib/libssl/test/dummytest.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/libssl/test/dummytest.c b/lib/libssl/test/dummytest.c
deleted file mode 100644
index f98f003ef98..00000000000
--- a/lib/libssl/test/dummytest.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <openssl/e_os2.h>
-#include <openssl/buffer.h>
-#include <openssl/crypto.h>
-
-int main(int argc, char *argv[])
- {
- char *p, *q, *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(*p)) *p = toupper(*p);
-
- q = strstr(program, "TEST");
- if (q > p && q[-1] == '_') q--;
- *q = '\0';
-
- printf("No %s support\n", program);
-
- OPENSSL_free(program);
- return(0);
- }