From: Martin Matuska Date: Thu, 8 Dec 2022 15:05:53 +0000 (+0100) Subject: archive_read_disk_posix: fail if unable to alocate memory in tree_push() X-Git-Tag: v3.6.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92d2835fed1e9be1e6fd49949bdef917df577274;p=thirdparty%2Flibarchive.git archive_read_disk_posix: fail if unable to alocate memory in tree_push() Reported by: GitHub CodeQL Code Scanning Alert: 189 --- diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index a96008db7..5a94ec5d4 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)