about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-10-14 21:05:33 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-10-14 21:05:33 +0530
commitfda389c8f0311dd5786be91a7b54b9f935fcafa1 (patch)
treeed86d5f6c8477676fd64feb3b1bab447b8273ee0 /sysdeps
parentfcb32af153a745414b0d949e707c9485ab77d6ba (diff)
downloadglibc-fda389c8f0311dd5786be91a7b54b9f935fcafa1.tar.gz
glibc-fda389c8f0311dd5786be91a7b54b9f935fcafa1.tar.xz
glibc-fda389c8f0311dd5786be91a7b54b9f935fcafa1.zip
Fix infinite loop in check_pf (BZ #12926)
The recvmsg could return 0 under some conditions and cause the
make_request function to be stuck in an infinite loop.

Thank you Jim King <jim.king@simplivity.com> for posting Paul's patch
on the list.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/check_pf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index c7fd9b0376..976f249e20 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -180,7 +180,7 @@ make_request (int fd, pid_t pid)
 	};
 
       ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
-      if (read_len < 0)
+      if (read_len <= 0)
 	goto out_fail2;
 
       if (msg.msg_flags & MSG_TRUNC)