summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSami Kerola2019-05-18 23:09:25 +0200
committerSami Kerola2019-05-18 23:09:25 +0200
commit4f807791eee8ead3f38f1dce76f748fa0773f9a6 (patch)
tree33997c9c59083f84e419d75eaa70ffc2dd0a261b /lib
parentsfdisk: remove unnecessary size check [cppcheck] (diff)
downloadkernel-qcow2-util-linux-4f807791eee8ead3f38f1dce76f748fa0773f9a6.tar.gz
kernel-qcow2-util-linux-4f807791eee8ead3f38f1dce76f748fa0773f9a6.tar.xz
kernel-qcow2-util-linux-4f807791eee8ead3f38f1dce76f748fa0773f9a6.zip
lib/mangle: fix possible null pointer dereference [cppcheck]
Fix effects code that is used when testing util-linux, so quite low impact. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'lib')
-rw-r--r--lib/mangle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mangle.c b/lib/mangle.c
index b514cd8d3..87802fbda 100644
--- a/lib/mangle.c
+++ b/lib/mangle.c
@@ -155,9 +155,9 @@ int main(int argc, char *argv[])
}
x = strdup(argv[2]);
- unmangle_to_buffer(x, x, strlen(x) + 1);
-
if (x) {
+ unmangle_to_buffer(x, x, strlen(x) + 1);
+
printf("self-unmangled: '%s'\n", x);
free(x);
}