summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ustar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ustar.c b/src/ustar.c
index 6388d76..63998ec 100644
--- a/src/ustar.c
+++ b/src/ustar.c
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "defs.h"
#include "gzip.h"
#include "ustar.h"
@@ -62,6 +63,10 @@ _opkg_opk_ustar_next(struct opkg_opk_gzip_state *gzip_state, const char *member,
case OPKG_OPK_ERROR:
return OPKG_OPK_ERROR;
}
+ if (strncmp(header->magic, "ustar", strlen("ustar")) != 0) {
+ return OPKG_OPK_ERROR;
+ }
+
size = strtol(header->size, &size_end, 10);
if (*size_end != '\0') {
return OPKG_OPK_ERROR;