From d807cf258ba7a70ee4607294057701cb7a515c5d Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 23 Aug 2022 20:03:45 +0200 Subject: Check sqfs_tree_node_get_path return value in rdsquashfs error path Signed-off-by: David Oberhollenzer --- bin/rdsquashfs/rdsquashfs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/rdsquashfs/rdsquashfs.c b/bin/rdsquashfs/rdsquashfs.c index 8926df6..206b754 100644 --- a/bin/rdsquashfs/rdsquashfs.c +++ b/bin/rdsquashfs/rdsquashfs.c @@ -72,11 +72,17 @@ static int tree_sort(sqfs_tree_node_t *root) if (strcmp((const char *)it->name, (const char *)it->next->name) == 0) { char *path; + int ret; - sqfs_tree_node_get_path(it, &path); + ret = sqfs_tree_node_get_path(it, &path); - fprintf(stderr, "Entry '%s' found more than once!\n", - path); + if (ret == 0) { + fprintf(stderr, + "Entry '%s' found more than once!\n", + path); + } else { + fputs("Entry found more than once!\n", stderr); + } sqfs_free(path); return -1; -- cgit v1.2.3