Ver Fonte

fuzz: fix compile error, ignore 0 length pbufs

goldsimon há 8 anos atrás
pai
commit
e6f0700c81
1 ficheiros alterados com 4 adições e 2 exclusões
  1. 4 2
      test/fuzz/fuzz.c

+ 4 - 2
test/fuzz/fuzz.c

@@ -125,9 +125,11 @@ static void input_pkts(struct netif *netif, const u8_t *data, size_t len)
     frame_len = htons(frame_len) & 0x7FF;
     frame_len = LWIP_MIN(frame_len, max_packet_size);
     if (frame_len > rem_len) {
-      frame_len = rem_len;
+      frame_len = (u16_t)rem_len;
+    }
+    if (frame_len != 0) {
+      input_pkt(netif, ptr, frame_len);
     }
-    input_pkt(netif, ptr, frame_len);
     ptr += frame_len;
     rem_len -= frame_len;
   }