From 5cce3493fb6696c01ccacf165cfcd45c588fc279 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 20 May 2019 15:57:45 +0200 Subject: [PATCH] lib:mscat: Add missing return check for error in dumpsmcat Found by csbuild. Signed-off-by: Andreas Schneider Reviewed-by: Gary Lockyer --- lib/mscat/dumpmscat.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/mscat/dumpmscat.c b/lib/mscat/dumpmscat.c index eac2184e7ad..5364610d483 100644 --- a/lib/mscat/dumpmscat.c +++ b/lib/mscat/dumpmscat.c @@ -103,11 +103,16 @@ int main(int argc, char *argv[]) { } rc = mscat_ctl_import(msctl, cat_pkcs7); - if (rc != 0) { + if (rc < 0) { + exit(1); + } + + rc = mscat_ctl_get_member_count(msctl); + if (rc < 0) { exit(1); } - member_count = mscat_ctl_get_member_count(msctl); + member_count = rc; printf("CATALOG MEMBER COUNT=%d\n", member_count); for (i = 0; i < member_count; i++) { @@ -164,7 +169,11 @@ int main(int argc, char *argv[]) { } printf("\n"); - attribute_count = mscat_ctl_get_attribute_count(msctl); + rc = mscat_ctl_get_attribute_count(msctl); + if (rc < 0) { + exit(1); + } + attribute_count = rc; printf("CATALOG ATTRIBUTE COUNT=%d\n", attribute_count); for (i = 0; i < attribute_count; i++) { -- 2.47.3