|
Bugzilla – Full Text Bug Listing |
| Summary: | Unusual (possibly incorrect assertion) in Packet::Deserialize | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Quincy Tse <quincy.tse> |
| Component: | core | Assignee: | Mathieu Lacage <mathieu.lacage> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | jpelkey, ns-bugs |
| Priority: | P5 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
Proposed patch
Proposed patch. |
||
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. |
../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);