From 92d2835fed1e9be1e6fd49949bdef917df577274 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Thu, 8 Dec 2022 16:05:53 +0100 Subject: archive_read_disk_posix: fail if unable to alocate memory in tree_push() Reported by: GitHub CodeQL Code Scanning Alert: 189 --- libarchive/archive_read_disk_posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index a96008db..5a94ec5d 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -2102,6 +2102,8 @@ tree_push(struct tree *t, const char *path, int filesystem_id, struct tree_entry *te; te = calloc(1, sizeof(*te)); + if (te == NULL) + __archive_errx(1, "Out of memory"); te->next = t->stack; te->parent = t->current; if (te->parent) -- cgit v1.2.1