#include "tarhead.h"
#include "repo_arch.h"
+#define MAX_ENTRY_SIZE 0x1000000
+
static Offset
adddep(Repo *repo, Offset olddeps, char *line)
{
tarhead_init(&th, fp);
while (tarhead_next(&th) > 0)
{
- if (th.type != 1 || strcmp(th.path, ".PKGINFO") != 0)
+ if (th.type != 1 || strcmp(th.path, ".PKGINFO") != 0 || th.length > MAX_ENTRY_SIZE)
{
tarhead_skip(&th);
continue;
while (tarhead_next(&th) > 0)
{
char *bn;
- if (th.type != 1)
+ if (th.type != 1 || th.length > MAX_ENTRY_SIZE)
{
tarhead_skip(&th);
continue;