Changeset d0941cc for lib


Ignore:
Timestamp:
01/14/19 17:34:27 (21 months ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
2f9b609
Parents:
15f32cb
Message:

Fix potential underflow when calculating wire length of pcap packets.

Only subtract four bytes from the wire length if we have at least
four bytes of wlen to subtract it from.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r2a1eebc rd0941cc  
    14531453                 * length exceeds the max buffer size by four bytes or less.
    14541454                 */
    1455                 wiresub = 4;
     1455                if (packet->cached.wire_length >= 4) {
     1456                        wiresub = 4;
     1457                } else {
     1458                        wiresub = packet->cached.wire_length;
     1459                }
    14561460        } else {
    14571461                wiresub = 0;
Note: See TracChangeset for help on using the changeset viewer.