aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libq/contents.c')
-rw-r--r--libq/contents.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libq/contents.c b/libq/contents.c
index feb1c0ba..6ec44915 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 */