From: Arran Cudbard-Bell Date: Mon, 28 Nov 2016 20:01:25 +0000 (-0500) Subject: Emit a FR_PROTO_HEX_DUMP message about trailing junk X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d5577fc2edf1e47bb2a76666f76b1cacbf45d15;p=thirdparty%2Ffreeradius-server.git Emit a FR_PROTO_HEX_DUMP message about trailing junk --- diff --git a/src/modules/proto_dhcp/dhcp.c b/src/modules/proto_dhcp/dhcp.c index 432c763d137..d87af629b11 100644 --- a/src/modules/proto_dhcp/dhcp.c +++ b/src/modules/proto_dhcp/dhcp.c @@ -1067,6 +1067,14 @@ ssize_t fr_dhcp_decode_option(TALLOC_CTX *ctx, vp_cursor_t *cursor, */ if (p[0] == 0) return 1; /* 0x00 - Padding option */ if (p[0] == 255) { /* 0xff - End of options signifier */ + size_t i; + + for (i = 1; i < data_len; i++) { + if (p[i] != 0) { + FR_PROTO_HEX_DUMP("ignoring trailing junk at end of packet", p + i, data_len - i); + break; + } + } return data_len; }