summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2014-10-22 16:35:34 +0000
committermillert <millert@openbsd.org>2014-10-22 16:35:34 +0000
commit724324873a87e263e9a3c54f1ee1c42942a1a388 (patch)
tree602b8b8d71be4e36da7c0552bf0e71366416ba4c
parentUse reallocarray() instead of calloc() (originally was realloc). (diff)
downloadwireguard-openbsd-724324873a87e263e9a3c54f1ee1c42942a1a388.tar.xz
wireguard-openbsd-724324873a87e263e9a3c54f1ee1c42942a1a388.zip
Fix error reporting when reallocarray() fails. OK miod@
-rw-r--r--sbin/isakmpd/pf_key_v2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index 6171067d3d2..782a4d02821 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.189 2014/10/18 03:10:00 doug Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.190 2014/10/22 16:35:34 millert Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -255,8 +255,8 @@ pf_key_v2_read(u_int32_t seq)
}
buf = reallocarray(NULL, hdr.sadb_msg_len, PF_KEY_V2_CHUNK);
if (!buf) {
- log_error("pf_key_v2_read: malloc (%zu) failed",
- hdr.sadb_msg_len * PF_KEY_V2_CHUNK);
+ log_error("pf_key_v2_read: reallocarray (%d, %d) failed",
+ hdr.sadb_msg_len, PF_KEY_V2_CHUNK);
goto cleanup;
}
n = hdr.sadb_msg_len * PF_KEY_V2_CHUNK;