From 4322c210893a82f5bf7fab900ca4226fde94afca Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Sun, 26 Mar 2017 18:41:02 +0000 Subject: recallocarray() for data buffer from the net. ok beck --- src/usr.sbin/ocspcheck/http.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ -/* $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 * @@ -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; -- cgit v1.2.3-55-g6feb