Fixed buffer overflow in DNS dissection
This commit is contained in:
@@ -47,7 +47,9 @@ static u_int16_t get16(int *i, const u_int8_t *payload) {
|
|||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
|
|
||||||
static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
||||||
if(payload[i] == 0x00)
|
if(i >= payloadLen)
|
||||||
|
return(0);
|
||||||
|
else if(payload[i] == 0x00)
|
||||||
return(1);
|
return(1);
|
||||||
else if(payload[i] == 0xC0)
|
else if(payload[i] == 0xC0)
|
||||||
return(2);
|
return(2);
|
||||||
|
|||||||
@@ -492,6 +492,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
} else {
|
} else {
|
||||||
flow->l4.tcp.irc_3a_counter++;
|
flow->l4.tcp.irc_3a_counter++;
|
||||||
|
packet->parsed_lines = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < packet->parsed_lines; i++) {
|
for (i = 0; i < packet->parsed_lines; i++) {
|
||||||
if (packet->line[i].ptr[0] == ':') {
|
if (packet->line[i].ptr[0] == ':') {
|
||||||
|
|||||||
Reference in New Issue
Block a user