From fb6f8ca547a122a5178f6b91fab4480c4b68abce Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 6 Sep 2022 12:09:19 +0200 Subject: [PATCH] libmount: (optlist) NULL optstr is not error Signed-off-by: Karel Zak --- libmount/src/optlist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c index 1bcf9641ed..34a658c4f0 100644 --- a/libmount/src/optlist.c +++ b/libmount/src/optlist.c @@ -428,10 +428,12 @@ static int optlist_add_optstr(struct libmnt_optlist *ls, const char *optstr, size_t namesz, valsz; int rc; - if (!ls || !optstr) + if (!ls) return -EINVAL; if (map && (rc = mnt_optlist_register_map(ls, map))) return rc; + if (!optstr) + return 0; while (ul_optstr_next(&p, &name, &namesz, &val, &valsz) == 0) { -- 2.47.3