summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sasyncd
diff options
context:
space:
mode:
authorchl <chl@openbsd.org>2014-10-26 14:47:37 +0000
committerchl <chl@openbsd.org>2014-10-26 14:47:37 +0000
commit7953660e466fbb8fe9bf81510a8bf3e5f9ee0082 (patch)
tree0fd76a364bc4ba98322b4bb766b83e1148ebe167 /usr.sbin/sasyncd
parentremove unused variables (diff)
downloadwireguard-openbsd-7953660e466fbb8fe9bf81510a8bf3e5f9ee0082.tar.xz
wireguard-openbsd-7953660e466fbb8fe9bf81510a8bf3e5f9ee0082.zip
fix use of uninitialized variable in error path
ok deraadt@
Diffstat (limited to 'usr.sbin/sasyncd')
-rw-r--r--usr.sbin/sasyncd/pfkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sasyncd/pfkey.c b/usr.sbin/sasyncd/pfkey.c
index c7cf0e4ffc9..8f8c9834418 100644
--- a/usr.sbin/sasyncd/pfkey.c
+++ b/usr.sbin/sasyncd/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.21 2014/10/16 04:05:39 deraadt Exp $ */
+/* $OpenBSD: pfkey.c,v 1.22 2014/10/26 14:47:37 chl Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -324,12 +324,12 @@ pfkey_read(void)
log_err("pfkey_read: recv() failed");
return -1;
}
+ datalen = hdr.sadb_msg_len * CHUNK;
data = reallocarray(NULL, hdr.sadb_msg_len, CHUNK);
if (!data) {
log_err("pfkey_read: malloc(%lu) failed", datalen);
return -1;
}
- datalen = hdr.sadb_msg_len * CHUNK;
msg = (struct sadb_msg *)data;
if (read(fd, data, datalen) != datalen) {