From: Karel Zak Date: Tue, 6 Sep 2022 10:09:19 +0000 (+0200) Subject: libmount: (optlist) NULL optstr is not error X-Git-Tag: v2.39-rc1~272 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb6f8ca547a122a5178f6b91fab4480c4b68abce;p=thirdparty%2Futil-linux.git libmount: (optlist) NULL optstr is not error Signed-off-by: Karel Zak --- 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) {