projects
/
platform
/
core
/
system
/
resourced.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5cdd931
)
Fix improper behaviour of parse_bytes when string contains only one letter
94/227094/4
author
Agnieszka Baumann
<a.baumann@samsung.com>
Mon, 9 Mar 2020 14:13:16 +0000
(15:13 +0100)
committer
Michal Bloch
<m.bloch@partner.samsung.com>
Fri, 13 Mar 2020 12:13:33 +0000
(12:13 +0000)
Change-Id: Ie50ff0a666eedf4396f9e78d3d3aff07d9802885
src/common/util.c
patch
|
blob
|
history
diff --git
a/src/common/util.c
b/src/common/util.c
index
c1ae720
..
1cdcbfb
100644
(file)
--- a/
src/common/util.c
+++ b/
src/common/util.c
@@
-140,7
+140,7
@@
int parse_bytes(const char *b, size_t *s)
return 0;
num_l = strspn(b, "0123456789");
- if (
num_l < len-1
)
+ if (
(num_l < len-1) || num_l == 0
)
return -EINVAL;
unit_l = strcspn(b, "BKMG");