summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/nl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/nl.c b/lib/nl.c
index c93b6a5..cba4217 100644
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -721,6 +721,13 @@ retry:
if (msg.msg_flags & MSG_CTRUNC) {
void *tmp;
+
+ if (msg.msg_controllen == 0) {
+ retval = -NLE_MSG_TRUNC;
+ NL_DBG(4, "recvmsg(%p): Received unexpected control data", sk);
+ goto abort;
+ }
+
msg.msg_controllen *= 2;
tmp = realloc(msg.msg_control, msg.msg_controllen);
if (!tmp) {