diff options
author | Luca Deri <deri@ntop.org> | 2015-11-22 23:13:50 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2015-11-22 23:13:50 +0100 |
commit | d24093c4a638f33b84a722bad7f2488c76437f50 (patch) | |
tree | f0952457dfe13016ecec8aca55c65268c5a8c2c1 /src/lib/protocols/netbios.c | |
parent | ec034da5c954a49fdd24a7d430064fac5af76594 (diff) |
Improvements on netbios name detection
Diffstat (limited to 'src/lib/protocols/netbios.c')
-rw-r--r-- | src/lib/protocols/netbios.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c index a651f9219..adf26b7d1 100644 --- a/src/lib/protocols/netbios.c +++ b/src/lib/protocols/netbios.c @@ -29,7 +29,7 @@ /* The function below has been inherited by tcpdump */ static int netbios_name_interpret(char *in, char *out, u_int out_len) { - int ret, len; + int ret = 0, len; char *b; len = (*in++)/2; @@ -42,14 +42,14 @@ static int netbios_name_interpret(char *in, char *out, u_int out_len) { while (len--) { if(in[0] < 'A' || in[0] > 'P' || in[1] < 'A' || in[1] > 'P') { *out = 0; - return(-1); + break; } *out = ((in[0]-'A')<<4) + (in[1]-'A'); in += 2; - out++; + out++, ret++; } - ret = *(--out); + *out = 0; /* Courtesy of Roberto F. De Luca <deluca@tandar.cnea.gov.ar> */ @@ -318,7 +318,7 @@ void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_LOG_DEBUG, "found netbios with MSG-type 0x11,0x12,0x13,0x14,0x15 or 0x16\n"); if (ntohl(get_u_int32_t(packet->payload, 4)) == ntohl(packet->iph->saddr)) { - char name[32]; + char name[64]; NDPI_LOG(NDPI_PROTOCOL_NETBIOS, ndpi_struct, NDPI_LOG_DEBUG, "found netbios with checked ip-address.\n"); |