lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Possible overflow bug?


From: timmy brolin
Subject: [lwip-users] Possible overflow bug?
Date: Wed, 10 Aug 2011 06:32:02 -0700

I may have found a possible overflow bug in several places in dhcp:
"
u8_t namelen = (u8_t)strlen(p);
...
LWIP_ASSERT("DHCP: hostname is too long!", namelen < 255);
"
Correct me if I am wrong, but doesn't strlen return int? And then that int is typecasted to u8_t, discarding the high-byte.
This means that the ASSERT is unlikely to detect a overflow problem.

This is not a big problem, since it would only be a real issue if the locally stored hostname is greater than 255 bytes in length. But still, if there is a overflow ASSERT check, it might as well work properly.

Regards,
Timmy Brolin

_______________________________________________________________
Hitta ditt drömjobb - Turism Försäljning Vårdjobb Ekonomi Design Bank Media


reply via email to

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