aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libq/contents.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libq/contents.c b/libq/contents.c
index feb1c0b..6ec4491 100644
--- a/libq/contents.c
+++ b/libq/contents.c
@@ -34,6 +34,9 @@ contents_parse_line_len(char *line, size_t len)
len--;
}
+ if (len <= 4) /* minimal: "dir /" */
+ return NULL;
+
memset(&e, 0x00, sizeof(e));
e._data = line;
@@ -47,6 +50,7 @@ contents_parse_line_len(char *line, size_t len)
return NULL;
e.name = e._data + 4;
+ len -= 4;
switch (e.type) {
/* dir /bin */