aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 33db01a..d124695 100644
--- a/main.c
+++ b/main.c
@@ -1215,6 +1215,10 @@ cache_read_file_pms(const char *file)
next_line(EAPI, PROPERTIES)
#undef next_line
ptr = strchr(ptr+1, '\n');
+ if (ptr == NULL) {
+ warn("Invalid cache file '%s' - could not find end of cache data", file);
+ goto err;
+ }
*ptr = '\0';
fclose(f);