diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2017-02-08 07:32:35 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2017-02-08 07:32:35 +0100 |
commit | ed6035afb16e563b3bce9044fdf6fb1163119e70 (patch) | |
tree | 21f9bf8870a1670fd1f27c244a0cdd2be6b14343 | |
parent | e4e2e0eb20794972b8d4c89dcfeb6c257c45c3a1 (diff) | |
download | calcurse-ed6035afb16e563b3bce9044fdf6fb1163119e70.zip |
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>
-rw-r--r-- | src/ical.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |