diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-03-26 18:41:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-03-26 18:41:03 +0000 |
commit | b7b97a995d89083783fbdddb11e31f3c1fb8cffd (patch) | |
tree | ecdcd35b1e0e8fce6f01b56c26f507e7af2c0eb0 /usr.sbin/ocspcheck/http.c | |
parent | 03840394c52504381f5b395879594aa4115d5768 (diff) |
recallocarray() for data buffer from the net.
ok beck
Diffstat (limited to 'usr.sbin/ocspcheck/http.c')
-rw-r--r-- | usr.sbin/ocspcheck/http.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ocspcheck/http.c b/usr.sbin/ocspcheck/http.c index 456840b391c..6830bacaece 100644 --- a/usr.sbin/ocspcheck/http.c +++ b/usr.sbin/ocspcheck/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.8 2017/02/03 08:08:15 guenther Exp $ */ +/* $Id: http.c,v 1.9 2017/03/26 18:41:02 deraadt Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -422,9 +422,11 @@ http_body_read(const struct http *http, struct httpxfer *trans, size_t *sz) return NULL; else if (ssz == 0) break; - pp = realloc(trans->bbuf, trans->bbufsz + ssz); + + pp = recallocarray(trans->bbuf, + trans->bbufsz, trans->bbufsz + ssz, 1); if (pp == NULL) { - warn("realloc"); + warn("recallocarray"); return NULL; } trans->bbuf = pp; |