diff options
author | 2017-03-15 15:54:41 +0000 | |
---|---|---|
committer | 2017-03-15 15:54:41 +0000 | |
commit | cff9705ac429868343747da164460635e1287a15 (patch) | |
tree | 50e633278245268802acd04302cde166daf22ad9 | |
parent | spelling and whitespace (diff) | |
download | wireguard-openbsd-cff9705ac429868343747da164460635e1287a15.tar.xz wireguard-openbsd-cff9705ac429868343747da164460635e1287a15.zip |
use recallocarray to resize buffer - ensures that detritus from previous
lookups isn't left lying around the address space.
ok eric
-rw-r--r-- | lib/libc/asr/res_send_async.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/asr/res_send_async.c b/lib/libc/asr/res_send_async.c index 3c3dd722e2b..d0b4cb0e060 100644 --- a/lib/libc/asr/res_send_async.c +++ b/lib/libc/asr/res_send_async.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_send_async.c,v 1.35 2017/03/14 15:15:19 deraadt Exp $ */ +/* $OpenBSD: res_send_async.c,v 1.36 2017/03/15 15:54:41 deraadt Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> * @@ -648,7 +648,7 @@ ensure_ibuf(struct asr_query *as, size_t n) if (as->as.dns.ibufsize >= n) return (0); - t = realloc(as->as.dns.ibuf, n); + t = recallocarray(as->as.dns.ibuf, as->as.dns.ibufsize, n, 1); if (t == NULL) return (-1); /* errno set */ as->as.dns.ibuf = t; |