diff options
| author | lteo <> | 2015-01-03 03:03:39 +0000 |
|---|---|---|
| committer | lteo <> | 2015-01-03 03:03:39 +0000 |
| commit | 2e4e9fcd58d6e0be5d84f72a2b46fc0aa74b3753 (patch) | |
| tree | a7f6ed7b3df7e1dfc65aa90118a927fc102152fd /src/usr.bin/openssl/apps.c | |
| parent | 9e3d67617f8e84835744d796274a8f8e834c244e (diff) | |
| download | openbsd-2e4e9fcd58d6e0be5d84f72a2b46fc0aa74b3753.tar.gz openbsd-2e4e9fcd58d6e0be5d84f72a2b46fc0aa74b3753.tar.bz2 openbsd-2e4e9fcd58d6e0be5d84f72a2b46fc0aa74b3753.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 '')
| -rw-r--r-- | src/usr.bin/openssl/apps.c | 4 |
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; |
