Merge pull request #222 from 0vercl0k/fbl_fixoob2

Fix OOB in nsvg__parseUrl.
master
Mikko Mononen 2022-08-10 20:16:49 +03:00 committed by GitHub
commit bd16c4e6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1681,9 +1681,9 @@ static void nsvg__parseUrl(char* id, const char* str)
{
int i = 0;
str += 4; // "url(";
if (*str == '#')
if (*str && *str == '#')
str++;
while (i < 63 && *str != ')') {
while (i < 63 && *str && *str != ')') {
id[i] = *str++;
i++;
}