summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/apps.c
diff options
context:
space:
mode:
authorlteo <>2015-01-03 03:03:39 +0000
committerlteo <>2015-01-03 03:03:39 +0000
commit3a71bbcdc4f61edf763302e9f0114aa00ce81b97 (patch)
treea7f6ed7b3df7e1dfc65aa90118a927fc102152fd /src/usr.bin/openssl/apps.c
parentf655ecb73179c3e1df740de75e9127e0b6563a42 (diff)
downloadopenbsd-3a71bbcdc4f61edf763302e9f0114aa00ce81b97.tar.gz
openbsd-3a71bbcdc4f61edf763302e9f0114aa00ce81b97.tar.bz2
openbsd-3a71bbcdc4f61edf763302e9f0114aa00ce81b97.zip
Check the return values of several reallocarray() calls. While here,
also check the return value of an adjacent malloc() call. ok jsing@
Diffstat (limited to 'src/usr.bin/openssl/apps.c')
-rw-r--r--src/usr.bin/openssl/apps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c
index 5a6bb7a2ee..d652abc549 100644
--- a/src/usr.bin/openssl/apps.c
+++ b/src/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: apps.c,v 1.23 2015/01/01 14:28:00 jsing Exp $ */ 1/* $OpenBSD: apps.c,v 1.24 2015/01/03 03:03:39 lteo Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -229,6 +229,8 @@ chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
229 if (arg->count == 0) { 229 if (arg->count == 0) {
230 arg->count = 20; 230 arg->count = 20;
231 arg->data = reallocarray(NULL, arg->count, sizeof(char *)); 231 arg->data = reallocarray(NULL, arg->count, sizeof(char *));
232 if (arg->data == NULL)
233 return 0;
232 } 234 }
233 for (i = 0; i < arg->count; i++) 235 for (i = 0; i < arg->count; i++)
234 arg->data[i] = NULL; 236 arg->data[i] = NULL;