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:
72e854c
)
debugfs: avoid undefined bit shift in parse_uint()
author
Theodore Ts'o
<tytso@mit.edu>
Sun, 24 Jun 2018 04:39:37 +0000
(
00:39
-0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Sun, 24 Jun 2018 04:39:37 +0000
(
00:39
-0400)
The case is one that should never happen (and indicates a bug if it
does), but in that case, we should still avoid an undefiniced C
expression.
Fixes-Coverity-Bug: 1297494
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/set_fields.c
patch
|
blob
|
history
diff --git
a/debugfs/set_fields.c
b/debugfs/set_fields.c
index
117cfb8
..
6594906
100644
(file)
--- a/
debugfs/set_fields.c
+++ b/
debugfs/set_fields.c
@@
-495,7
+495,7
@@
static errcode_t parse_uint(struct field_set_info *info, char *field,
}
if (!field2)
return 0;
- n =
num >> (size*8
);
+ n =
(size == 8) ? 0 : (num >> (size*8)
);
u.ptr8 = (__u8 *) field2;
if (info->size == 6)
size = 2;