From: Sami Kerola Date: Fri, 12 Jul 2019 20:56:52 +0000 (+0100) Subject: libmount: fix potential null pointer dereference X-Git-Tag: v2.35-rc1~317^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=371be858d74fe5562a403af75e596d7bd0042905;p=thirdparty%2Futil-linux.git libmount: fix potential null pointer dereference This is false positive warning, but lets silence it so that if and when warnings crop up they are easy to notice and take seriously. libmount/src/optstr.c:354:29: warning: potential null pointer dereference [-Wnull-dereference] Signed-off-by: Sami Kerola --- diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c index c0f438fe2e..49fc9cc40e 100644 --- a/libmount/src/optstr.c +++ b/libmount/src/optstr.c @@ -351,7 +351,9 @@ int mnt_optstr_deduplicate_option(char **optstr, const char *name) end = ol.end; opt = end && *end ? end + 1 : NULL; } - } while (rc == 0 && opt && *opt); + if (opt == NULL) + break; + } while (rc == 0 && *opt); return rc < 0 ? rc : begin ? 0 : 1; }