playlist/cue/parser: fix off-by-one buffer overflow
cue_next_word() can return a pointer one past the end of the string if the word is followed by the terminating null byte.
This commit is contained in:
@@ -38,8 +38,12 @@ cue_next_word(char *p, char **pp)
|
||||
while (!IsWhitespaceOrNull(*p))
|
||||
++p;
|
||||
|
||||
*p = 0;
|
||||
*pp = p + 1;
|
||||
if (*p != 0) {
|
||||
*p = 0;
|
||||
*pp = p + 1;
|
||||
} else
|
||||
*pp = p;
|
||||
|
||||
return word;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user