From 4961785e1745a4b9216dc9dcb600acb1fab6012b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 29 Apr 2023 00:03:55 -0400 Subject: opk: Restore list error check --- diff --git a/src/opk.c b/src/opk.c index 94d6c2b..f98f088 100644 --- a/src/opk.c +++ b/src/opk.c @@ -194,9 +194,10 @@ static int _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) { struct opkg_opk_ustar_member *member; + int ret_list; + int ret_read; char *buffer; size_t size; - int ret_read; struct _opkg_opk_opk_seek_name *seek_name; if (opk->print_control_head == NULL) { @@ -208,7 +209,8 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) return OPKG_OPK_ERROR; } - while (opkg_opk_ustar_list(opk->inner_ustar, &member) == OPKG_OPK_OK) { + while ((ret_list = opkg_opk_ustar_list(opk->inner_ustar, &member)) == + OPKG_OPK_OK) { if (_opkg_opk_opk_check_name(member->name, &opk->print_control_head, &opk->print_control_tail) != @@ -239,6 +241,11 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk) } opk->previously_printed = 1; } + if (ret_list == OPKG_OPK_ERROR) { + fputs(_("Error: Failed to list control files\n"), stderr); + _opkg_opk_opk_free_inner(opk); + return OPKG_OPK_ERROR; + } /* Check for files not found. */ if (opk->print_control_head != NULL) { -- cgit v0.9.1