]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Test slen is not -1 before setting error on MSG_TRUNC.
authorRoy Marples <roy@marples.name>
Fri, 2 Sep 2016 14:29:54 +0000 (14:29 +0000)
committerRoy Marples <roy@marples.name>
Fri, 2 Sep 2016 14:29:54 +0000 (14:29 +0000)
common.c

index 9b803226b08e495432757c02310b6407eeac2a71..0988b94a6784dc0f0fb60fb4ce541107e756f6cf 100644 (file)
--- a/common.c
+++ b/common.c
@@ -420,7 +420,7 @@ recvmsg_realloc(int fd, struct msghdr *msg, int flags)
        }
 
        slen = recvmsg(fd, msg, flags);
-       if (msg->msg_flags & MSG_TRUNC) {
+       if (slen != -1 && msg->msg_flags & MSG_TRUNC) {
                /* This should not be possible ... */
                errno = ENOBUFS;
                return -1;