forked from osmocom/wireshark
NCP2222: fix possible buffer-overflow
Caught by ASAN (thanks Alexis!) Change-Id: Ibbe2c405ba1a3ba0d5a5b9ffff9e95282526028b Reviewed-on: https://code.wireshark.org/review/6652 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
1af7b97927
commit
f3cbee6aab
|
@ -2527,7 +2527,11 @@ uni_to_string(char * data, guint32 str_length, char *dest_buf)
|
|||
|
||||
if(length_remaining==0)
|
||||
{
|
||||
dest_buf[i+1] = '\0';
|
||||
if (i+1 < (gint)str_length){
|
||||
dest_buf[i+1] = '\0';
|
||||
} else {
|
||||
dest_buf[i] = '\0';
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue