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:
9c903a0
)
Fix: parse_bytes prevent out of range value
98/227398/4
author
Agnieszka Baumann
<a.baumann@samsung.com>
Wed, 11 Mar 2020 14:45:41 +0000
(15:45 +0100)
committer
Michal Bloch
<m.bloch@partner.samsung.com>
Fri, 13 Mar 2020 12:14:08 +0000
(12:14 +0000)
Change-Id: I5a8c59176fc936f02c419cb494548eeac37d0638
src/common/util.c
patch
|
blob
|
history
diff --git
a/src/common/util.c
b/src/common/util.c
index
1cdcbfb
..
ce9aa24
100644
(file)
--- a/
src/common/util.c
+++ b/
src/common/util.c
@@
-175,7
+175,7
@@
int parse_bytes(const char *b, size_t *s)
}
/* Prevent overflow */
- if (r >= (1 << ((CHAR_BIT * sizeof r) - shift)))
+ if (r >= (1
UL
<< ((CHAR_BIT * sizeof r) - shift)))
return -ERANGE;
*s = r << shift;