summaryrefslogtreecommitdiff
path: root/src/usr.sbin/ocspcheck
diff options
context:
space:
mode:
authorderaadt <>2017-03-26 18:41:02 +0000
committerderaadt <>2017-03-26 18:41:02 +0000
commit4322c210893a82f5bf7fab900ca4226fde94afca (patch)
treef05a456541f2dcef89a68470a533f4b5d4a296d8 /src/usr.sbin/ocspcheck
parentce47b383123403f5d9e04a2bd7fb98a2a3bc3cf3 (diff)
downloadopenbsd-4322c210893a82f5bf7fab900ca4226fde94afca.tar.gz
openbsd-4322c210893a82f5bf7fab900ca4226fde94afca.tar.bz2
openbsd-4322c210893a82f5bf7fab900ca4226fde94afca.zip
recallocarray() for data buffer from the net.
ok beck
Diffstat (limited to 'src/usr.sbin/ocspcheck')
-rw-r--r--src/usr.sbin/ocspcheck/http.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/usr.sbin/ocspcheck/http.c b/src/usr.sbin/ocspcheck/http.c
index 456840b391..6830bacaec 100644
--- a/src/usr.sbin/ocspcheck/http.c
+++ b/src/usr.sbin/ocspcheck/http.c
@@ -1,4 +1,4 @@
1/* $Id: http.c,v 1.8 2017/02/03 08:08:15 guenther Exp $ */ 1/* $Id: http.c,v 1.9 2017/03/26 18:41:02 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> 3 * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
4 * 4 *
@@ -422,9 +422,11 @@ http_body_read(const struct http *http, struct httpxfer *trans, size_t *sz)
422 return NULL; 422 return NULL;
423 else if (ssz == 0) 423 else if (ssz == 0)
424 break; 424 break;
425 pp = realloc(trans->bbuf, trans->bbufsz + ssz); 425
426 pp = recallocarray(trans->bbuf,
427 trans->bbufsz, trans->bbufsz + ssz, 1);
426 if (pp == NULL) { 428 if (pp == NULL) {
427 warn("realloc"); 429 warn("recallocarray");
428 return NULL; 430 return NULL;
429 } 431 }
430 trans->bbuf = pp; 432 trans->bbuf = pp;