From: Alan T. DeKok Date: Tue, 11 Feb 2025 21:19:28 +0000 (-0500) Subject: check that the packet is well-formed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d730af1d7a9d0176be7aa81ea1627d85149f2767;p=thirdparty%2Ffreeradius-server.git check that the packet is well-formed rad_decode() doesn't do this, but instead assumes that the packet is OK. --- diff --git a/src/main/fuzzer.c b/src/main/fuzzer.c index f20e5cfff5..93b0e3afb2 100644 --- a/src/main/fuzzer.c +++ b/src/main/fuzzer.c @@ -155,8 +155,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) memcpy(&packet->data, &buf, sizeof(buf)); /* const issues */ packet->data_len = len; - (void) rad_decode(packet, NULL, "testing123"); - if (fr_debug_lvl > 3) vp_printlist(stdout, packet->vps); + if (rad_packet_ok(packet, 0, NULL)) { + (void) rad_decode(packet, NULL, "testing123"); + if (fr_debug_lvl > 3) vp_printlist(stdout, packet->vps); + } packet->data = NULL; packet->data_len = 0;