diff options
author | Nardi Ivan <nardi.ivan@gmail.com> | 2020-03-26 17:27:41 +0100 |
---|---|---|
committer | Nardi Ivan <nardi.ivan@gmail.com> | 2020-03-27 11:09:53 +0100 |
commit | 58f0f2911372ccd316c51fb81429cfeaa3b4f470 (patch) | |
tree | bf3f02d5e8f67a5b07adb44e22ede82d8fe473d3 /src | |
parent | da5e5a3e2aa9c7008760f1b24a873d5bdec96432 (diff) |
soulseek: fix heap-overflow error
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/protocols/soulseek.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/soulseek.c b/src/lib/protocols/soulseek.c index a08774bb8..042ead2b8 100644 --- a/src/lib/protocols/soulseek.c +++ b/src/lib/protocols/soulseek.c @@ -196,7 +196,7 @@ void ndpi_search_soulseek_tcp(struct ndpi_detection_module_struct *ndpi_struct, && !get_u_int16_t(packet->payload, 2)) { const u_int32_t usrlen = get_l32(packet->payload, 5); - if(usrlen <= packet->payload_packet_len - 4 + 1 + 4 + 4 + 1 + 4) { + if(usrlen <= packet->payload_packet_len - (4 + 1 + 4 + 4 + 1 + 4)) { const u_int32_t typelen = get_l32(packet->payload, 4 + 1 + 4 + usrlen); const u_int8_t type = packet->payload[4 + 1 + 4 + usrlen + 4]; if(typelen == 1 && (type == 'F' || type == 'P' || type == 'D')) { |