Do not read past NUL character in ical_get_value()
Make sure we never read beyond the end of the buffer, even if the terminating quote of a quoted string is missing. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
e4e2e0eb20
commit
ed6035afb1
@ -676,10 +676,10 @@ static long ical_compute_rpt_until(long start, ical_rpt_t * rpt)
|
||||
static char *ical_get_value(char *p)
|
||||
{
|
||||
for (; *p != ':'; p++) {
|
||||
if (*p == '"')
|
||||
for (p++; *p != '"' && *p != '\0'; p++);
|
||||
if (*p == '\0')
|
||||
return NULL;
|
||||
if (*p == '"')
|
||||
for (p++; *p != '"'; p++);
|
||||
}
|
||||
|
||||
return p + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user