|
Bugzilla – Full Text Bug Listing |
| Summary: | Dead assignment on packet-metadata.cc | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | natale.patriciello |
| Component: | network | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | trivial | CC: | suryaseetharaman.9, tomh |
| Priority: | P5 | ||
| Version: | pre-release | ||
| Hardware: | PC | ||
| OS: | Linux | ||
|
Description
natale.patriciello
2016-11-11 09:20:20 UTC
Another one is at the following lines (266):
254 void
255 PacketMetadata::AppendValueExtra (uint32_t value, uint8_t *buffer)
256 {
257 NS_LOG_FUNCTION (this << value << &buffer);
258 if (value < 0x200000)
259 {
260 uint8_t byte = value & (~0x80);
261 buffer[0] = 0x80 | byte;
262 value >>= 7;
263 byte = value & (~0x80);
264 buffer[1] = 0x80 | byte;
265 value >>= 7;
266 byte = value & (~0x80); // Value stored to 'byte' is never read
267 buffer[2] = value;
268 return;
269 }
The patch is less simple: should the value of "byte" be stored somewhere?
Another problem is a use-after-free. I don't open another bug because the patch is trivial:
589 PacketMetadata::Deallocate (data);
590 NS_LOG_LOGIC ("create dealloc size="<<data->m_size); // use-after-free
We are deallocating data, and then we are printing a field inside that region of memory. Fortunately no use uses LOGIC debug on PacketMetadata :)
I guess these changes are incorporated already in ns-3-dev? So is there anything else holding this issue open that I could help with ? Was fixed a while back in changeset 12697:c034f3634c8c |