summaryrefslogtreecommitdiffstats
path: root/libmount
diff options
context:
space:
mode:
authorSami Kerola2019-07-12 22:56:52 +0200
committerSami Kerola2019-07-12 23:09:31 +0200
commit371be858d74fe5562a403af75e596d7bd0042905 (patch)
tree2d3ff6a230d940dd585e8e0b7f2ad3eaae7832da /libmount
parentlibfdisk: fix variable shadowing (diff)
downloadkernel-qcow2-util-linux-371be858d74fe5562a403af75e596d7bd0042905.tar.gz
kernel-qcow2-util-linux-371be858d74fe5562a403af75e596d7bd0042905.tar.xz
kernel-qcow2-util-linux-371be858d74fe5562a403af75e596d7bd0042905.zip
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 <kerolasa@iki.fi>
Diffstat (limited to 'libmount')
-rw-r--r--libmount/src/optstr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index c0f438fe2..49fc9cc40 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;
}