From: Alan T. DeKok Date: Mon, 12 Feb 2018 20:50:28 +0000 (-0500) Subject: if the entry is too large for the buffer, discard the file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27453762da548dd7ed5fd3c9745190fdb426d36d;p=thirdparty%2Ffreeradius-server.git if the entry is too large for the buffer, discard the file --- diff --git a/src/modules/proto_detail/proto_detail_work.c b/src/modules/proto_detail/proto_detail_work.c index e5b5d4bc98b..1a205cb464c 100644 --- a/src/modules/proto_detail/proto_detail_work.c +++ b/src/modules/proto_detail/proto_detail_work.c @@ -337,6 +337,14 @@ redo: MPRINT("FOUND next at %zd, leftover is %zd", packet_len, *leftover); } else if (!inst->eof) { + if ((end - buffer) == buffer_len) { + ERROR("proto_detail (%s): Too large entry (>%d bytes) found at offset %zu: %.*s of file %s", + inst->name, buffer_len, + (size_t)((p - buffer) + inst->header_offset), (int) (end - p), p, + inst->filename_work); + return -1; + } + /* * We're not at EOF, and there is no "next" * entry. Remember all of the leftover data in