Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
182fa0c
)
AOSP: blkid: sanity check 'end' address must be greater than or equal to 'lable'...
author
Dong Jinguang
<dongjinguang@huawei.com>
Fri, 29 Dec 2017 09:00:37 +0000
(17:00 +0800)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 26 Feb 2018 18:35:46 +0000
(13:35 -0500)
Avoid a potential out-of-bounds memory access address of label
Test: mma -j8 and boot devices
Change-Id: I155aa4e26f7079f517be3202de0032a86368559d
From AOSP commit:
38324e758b803e99419d24e16a00b32f8ebbf473
lib/blkid/probe.c
patch
|
blob
|
history
diff --git
a/lib/blkid/probe.c
b/lib/blkid/probe.c
index
3bcf4c3
..
865d9aa
100644
(file)
--- a/
lib/blkid/probe.c
+++ b/
lib/blkid/probe.c
@@
-41,7
+41,7
@@
static int figure_label_len(const unsigned char *label, int len)
{
const unsigned char *end = label + len - 1;
- while (
(*end == ' ' || *end == 0) && end >= label
)
+ while (
end >= label && (*end == ' ' || *end == 0)
)
--end;
if (end >= label)
return end - label + 1;