From ea83fd3927d32f618bbdeda0d7b669d2fd791958 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 13 Dec 2022 00:11:34 +1000 Subject: [PATCH] Catch possible error in archive_entry_pathname when extracting files Prevents a null deference on error. Signed-off-by: Allan McRae --- lib/libalpm/util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 3c551473..dffa3b51 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -348,6 +348,11 @@ int _alpm_unpack(alpm_handle_t *handle, const char *path, const char *prefix, entryname = archive_entry_pathname(entry); + if(entryname == NULL) { + ret = 1; + goto cleanup; + } + /* If specific files were requested, skip entries that don't match. */ if(list) { char *entry_prefix = NULL;