]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct print_hex_data() parameters in fr_vmps_print_hex() (#4700)
authorJames Jones <jejones3141@gmail.com>
Mon, 29 Aug 2022 17:37:27 +0000 (12:37 -0500)
committerGitHub <noreply@github.com>
Mon, 29 Aug 2022 17:37:27 +0000 (13:37 -0400)
For the loop printing the trailing portions of the packet to be
correct, length must include the four-byte id and two-byte length
as well as the following data. id and length are explicitly printed,
so print_hex_data() would presumably show what follows, but that
would start at attr + 6 and only be length - 6 bytes.

src/protocols/vmps/vmps.c

index 7ca5692527d40535a5a31e51801ce97a924cf998..770bd7fa4022560a07f97021745bc178c687ef4e 100644 (file)
@@ -494,7 +494,7 @@ void fr_vmps_print_hex(FILE *fp, uint8_t const *packet, size_t packet_len)
 
                fprintf(fp, "\t\t%08x  %04x  ", id, length);
 
-               print_hex_data(attr + 5, length, 3);
+               print_hex_data(attr + 6, length - 6, 3);
        }
 }