From 3a71bbcdc4f61edf763302e9f0114aa00ce81b97 Mon Sep 17 00:00:00 2001 From: lteo <> Date: Sat, 3 Jan 2015 03:03:39 +0000 Subject: Check the return values of several reallocarray() calls. While here, also check the return value of an adjacent malloc() call. ok jsing@ --- src/usr.bin/openssl/speed.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/usr.bin/openssl/speed.c') diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c index b9eca831ff..e40607f940 100644 --- a/src/usr.bin/openssl/speed.c +++ b/src/usr.bin/openssl/speed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: speed.c,v 1.3 2015/01/02 04:00:21 lteo Exp $ */ +/* $OpenBSD: speed.c,v 1.4 2015/01/03 03:03:39 lteo Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1998,6 +1998,10 @@ do_multi(int multi) const char *errstr = NULL; fds = reallocarray(NULL, multi, sizeof *fds); + if (fds == NULL) { + fprintf(stderr, "reallocarray failure\n"); + exit(1); + } for (n = 0; n < multi; ++n) { if (pipe(fd) == -1) { fprintf(stderr, "pipe failure\n"); -- cgit v1.2.3-55-g6feb