Bugzilla – Bug 992
Unusual (possibly incorrect assertion) in Packet::Deserialize
Last modified: 2010-09-29 17:22:51 UTC
../src/common/packet.cc:738:3: error: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] Same warning was also triggered in lines 767 and 787. In Packet::Deserialize, size is uint32_t, thus always >=0 (NS_ASSERT line does not detect the buffer overflow). Maybe the NS_ASSERTs should be something like the following? == NS_ASSERT (size >= nixSize); == NS_ASSERT (size >= metaSize); == NS_ASSERT (size >= bufSize);
Created attachment 973 [details] Proposed patch
Created attachment 974 [details] Proposed patch.
(In reply to comment #2) > Created an attachment (id=974) [details] > Proposed patch. You are right, and the patch is right. I have applied: changeset 6d5c1c19bdfe Thanks.