summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-29 00:03:55 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-29 00:03:55 (EDT)
commit4961785e1745a4b9216dc9dcb600acb1fab6012b (patch)
tree9c34c2e1c0c2bc91ae9a4f9b5a2fe345ba65be01 /src
parente1e5a3e65f3ca4e1172f640456d6dd7060e200c8 (diff)
opk: Restore list error check
Diffstat (limited to 'src')
-rw-r--r--src/opk.c11
1 files changed, 9 insertions, 2 deletions
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) {