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:
d9fd7cc
)
btrfs-progs: qgroup limit: add a check for invalid input of 'T/G/M/K'
author
Dongsheng Yang
<yangds.fnst@cn.fujitsu.com>
Wed, 3 Jun 2015 09:27:04 +0000
(17:27 +0800)
committer
David Sterba
<dsterba@suse.cz>
Fri, 5 Jun 2015 16:45:21 +0000
(18:45 +0200)
Add a check to error out in the following case:
# ./btrfs qgroup limit T /mnt/
Invalid size argument given
Without this patch, btrfs-progs would parse the input as 0
and continue.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-qgroup.c
patch
|
blob
|
history
diff --git
a/cmds-qgroup.c
b/cmds-qgroup.c
index
5ea4021
..
9545a20
100644
(file)
--- a/
cmds-qgroup.c
+++ b/
cmds-qgroup.c
@@
-121,6
+121,9
@@
static int parse_limit(const char *p, unsigned long long *s)
return 0;
size = strtoull(p, &endptr, 10);
+ if (p == endptr)
+ return 0;
+
switch (*endptr) {
case 'T':
case 't':