summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2019-07-13 10:31:06 +0200
committerSami Kerola2019-07-14 12:53:59 +0200
commit9175f39075b130bce00ed4b0d23be90a1defa915 (patch)
treee7ae6222e91b569b44c9ddba53ef3326ac6066cc
parentinclude/xalloc: ensure xstrdup() and xstrndup() returns nonnull attribute (diff)
downloadkernel-qcow2-util-linux-9175f39075b130bce00ed4b0d23be90a1defa915.tar.gz
kernel-qcow2-util-linux-9175f39075b130bce00ed4b0d23be90a1defa915.tar.xz
kernel-qcow2-util-linux-9175f39075b130bce00ed4b0d23be90a1defa915.zip
libblkid: check number of test_blkid_save arguments correctly
Without this running test_blkid_save without arguments will cause a crash when strdup() refers to none-exiting file name. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--libblkid/src/save.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libblkid/src/save.c b/libblkid/src/save.c
index 21308a9cf..bceaa1139 100644
--- a/libblkid/src/save.c
+++ b/libblkid/src/save.c
@@ -213,7 +213,7 @@ int main(int argc, char **argv)
int ret;
blkid_init_debug(BLKID_DEBUG_ALL);
- if (argc > 2) {
+ if (argc != 2) {
fprintf(stderr, "Usage: %s [filename]\n"
"Test loading/saving a cache (filename)\n", argv[0]);
exit(1);