]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (optlist) NULL optstr is not error
authorKarel Zak <kzak@redhat.com>
Tue, 6 Sep 2022 10:09:19 +0000 (12:09 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/optlist.c

index 1bcf9641ed320bd2d67c24b44fb0d96993f59091..34a658c4f086e96158b16452cee8f277c298c566 100644 (file)
@@ -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) {