ndis_events(8): Check a read().
authorSascha Wildner <saw@online.de>
Fri, 19 Oct 2012 07:36:36 +0000 (09:36 +0200)
committerSascha Wildner <saw@online.de>
Fri, 19 Oct 2012 08:58:44 +0000 (10:58 +0200)
Found-by: gcc47
usr.sbin/802_11/ndis_events/ndis_events.c

index 7cab62c..de1d763 100644 (file)
@@ -324,6 +324,10 @@ main(int argc, char *argv[])
 
        while (1) {
                n = read(r, msg, NDIS_INDICATION_LEN);
+               if (n < 0) {
+                       dbgmsg("read failed");
+                       exit(1);
+               }
                rtm = (struct rt_msghdr *)msg;
                if (rtm->rtm_type != RTM_IFINFO)
                        continue;