itacns: Really do not read behind the buffer bounds

Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25885
This commit is contained in:
Jakub Jelen 2020-09-23 17:04:40 +02:00 committed by Frank Morgner
parent 6545cd26f4
commit 595926471b
1 changed files with 1 additions and 1 deletions

View File

@ -379,7 +379,7 @@ static int hextoint(char *src, unsigned int len)
if(len >= sizeof(hex))
return -1;
strncpy(hex, src, len+1);
strncpy(hex, src, len);
hex[len] = '\0';
res = strtol(hex, &end, 0x10);
if(end != (char*)&hex[len])