mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-30 16:09:43 +00:00
Fixes crash when searching kerberos usernames
Fixes
(gdb) f 0
101 if(cname_str[cname_len-1] == '$') {
(gdb) p cname_len
$3 = 0
This commit is contained in:
parent
da029607a0
commit
3754e6dd12
1 changed files with 2 additions and 2 deletions
|
|
@ -98,7 +98,7 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct,
|
|||
#endif
|
||||
|
||||
/* if cname does not end with a $ then it's a username */
|
||||
if(cname_str[cname_len-1] == '$') {
|
||||
if(cname_len && cname_str[cname_len-1] == '$') {
|
||||
cname_str[cname_len-1] = '\0';
|
||||
snprintf(flow->protos.kerberos.hostname, sizeof(flow->protos.kerberos.hostname), "%s", cname_str);
|
||||
} else
|
||||
|
|
@ -184,7 +184,7 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct,
|
|||
printf("[Kerberos Cname][len: %u][%s]\n", cname_len, cname_str);
|
||||
#endif
|
||||
|
||||
if(cname_str[cname_len-1] == '$') {
|
||||
if(cname_len && cname_str[cname_len-1] == '$') {
|
||||
cname_str[cname_len-1] = '\0';
|
||||
snprintf(flow->protos.kerberos.hostname, sizeof(flow->protos.kerberos.hostname), "%s", cname_str);
|
||||
} else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue