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:
dd53ec1
)
btrfs-progs: check for null string in parse_size
author
Eric Sandeen
<sandeen@redhat.com>
Mon, 4 Mar 2013 22:39:56 +0000
(16:39 -0600)
committer
David Sterba
<dsterba@suse.cz>
Sun, 10 Mar 2013 14:54:49 +0000
(15:54 +0100)
Because it's better than a segfault if it's called improperly,
and it makes static checkers happier.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
utils.c
patch
|
blob
|
history
diff --git
a/utils.c
b/utils.c
index 71da7879ed6dc7cd8b092a31c511e8955d503ec0..629b40b43bf3d496e99b2758d74c43f297cd7e77 100644
(file)
--- a/
utils.c
+++ b/
utils.c
@@
-1382,7
+1382,7
@@
u64 parse_size(char *s)
char c;
u64 mult = 1;
- for (i
=0 ; s[i] && isdigit(s[i])
; i++) ;
+ for (i
= 0; s && s[i] && isdigit(s[i])
; i++) ;
if (!i) {
fprintf(stderr, "ERROR: size value is empty\n");
exit(50);