info: ipc_action: use a safer 'oversize' comparison
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 13:12:24 +0000 (14:12 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 19:54:18 +0000 (20:54 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c

index f411d77..8af509e 100644 (file)
@@ -350,7 +350,7 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
     char requ[1024];
     ssize_t s = recv(ipc_connection, (void *) &requ, sizeof(requ) - 1, 0); /* Win32 needs the cast here */
 
-    if (s == sizeof(requ) - 1) {
+    if (s >= (ssize_t) (sizeof(requ) - 1)) {
       /* input was much too long, just skip the rest */
       while (recv(ipc_connection, (void *) &sink_buffer, sizeof(sink_buffer), 0) == sizeof(sink_buffer))
         ;