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:
d202f46
)
e2p: fix segfault in e2p_os2string
author
Adam Buchbinder
<abuchbinder@google.com>
Sat, 22 Jul 2017 21:52:24 +0000
(17:52 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Sat, 22 Jul 2017 21:52:30 +0000
(17:52 -0400)
Passing in a negative integer would lead to a segfault, and
a crafted filesystem image could trigger that.
Signed-off-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/e2p/ostype.c
patch
|
blob
|
history
diff --git
a/lib/e2p/ostype.c
b/lib/e2p/ostype.c
index
7f08844
..
c5fd8ab
100644
(file)
--- a/
lib/e2p/ostype.c
+++ b/
lib/e2p/ostype.c
@@
-30,7
+30,7
@@
char *e2p_os2string(int os_type)
const char *os;
char *ret;
- if (os_type <= EXT2_OS_LITES)
+ if (os_type
>= 0 && os_type
<= EXT2_OS_LITES)
os = os_tab[os_type];
else
os = "(unknown os)";