projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff6fe03
)
btrfs-progs: btrfs-crc: make argc check more strict
author
Satoru Takeuchi
<takeuchi_satoru@jp.fujitsu.com>
Thu, 2 Jun 2016 08:14:57 +0000
(17:14 +0900)
committer
David Sterba
<dsterba@suse.com>
Fri, 3 Jun 2016 12:49:43 +0000
(14:49 +0200)
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-crc.c
patch
|
blob
|
history
diff --git
a/btrfs-crc.c
b/btrfs-crc.c
index 27244d785152a994b2fbc2135d79fb4944d17ffd..c3e4774766b7ab5937a3812766ed86d845487ebc 100644
(file)
--- a/
btrfs-crc.c
+++ b/
btrfs-crc.c
@@
-69,12
+69,14
@@
int main(int argc, char **argv)
str = argv[optind];
if (!loop) {
- if (check_argc_
min
(argc - optind, 1))
+ if (check_argc_
exact
(argc - optind, 1))
print_usage(255);
printf("%12u - %s\n", crc32c(~1, str, strlen(str)), str);
return 0;
}
+ if (check_argc_exact(argc - optind, 0))
+ print_usage(255);
buf = malloc(length);
if (!buf)