lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #65732] Infinity "for" loop in mkfsdata.c


From: Alexey
Subject: [lwip-devel] [bug #65732] Infinity "for" loop in mkfsdata.c
Date: Mon, 13 May 2024 06:30:47 -0400 (EDT)

URL:
  <https://savannah.nongnu.org/bugs/?65732>

                 Summary: Infinity "for" loop in mkfsdata.c
                   Group: lwIP - A Lightweight TCP/IP stack
               Submitter: spider_vc
               Submitted: Пн 13 мая 2024 10:30:47
                Category: apps
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Пн 13 мая 2024 10:30:47   By: Alexey <spider_vc>
in file:
src/apps/http/makefsdata/makefsdata.c:728

  src_offset = 0;
  for (offset = hdr_len; ; offset += len) {
    unsigned short chksum;
    const void *data = (const void *)&file_data[src_offset];
    len = LWIP_MIN(chunk_size, (int)file_size - src_offset);
    if (len == 0) {
      break;
    }
    chksum = ~inet_chksum(data, (u16_t)len);
    /* add checksum for data */
    fprintf(struct_file, "{%d, 0x%04x, %"SZT_F"}," NEWLINE, offset, chksum,
len);
    i++;
  }


loop condition is wrong. *src_offset* never changed and as result *len* never
reach zero.

I think right condition will be like that:

   for (offset = hdr_len; ; src_offset += len) {


8 years old BUG....







    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?65732>

_______________________________________________
Сообщение отправлено по Savannah
https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]