git.annexia.org
/
hivex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c22ed5a
)
Handle odd-length "UTF16" strings.
author
Richard W.M. Jones
<rjones@redhat.com>
Wed, 13 Apr 2011 13:03:21 +0000
(14:03 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Wed, 13 Apr 2011 13:04:49 +0000
(14:04 +0100)
If the length of the buffer is not even, then this would read a byte
of uninitialized data. Fix the length check to avoid this.
lib/hivex.c
patch
|
blob
|
history
diff --git
a/lib/hivex.c
b/lib/hivex.c
index
b1f6ea6
..
71ea5c3
100644
(file)
--- a/
lib/hivex.c
+++ b/
lib/hivex.c
@@
-1384,7
+1384,7
@@
utf16_string_len_in_bytes_max (const char *str, size_t len)
{
size_t ret = 0;
- while (len >
0
&& (str[0] || str[1])) {
+ while (len >
= 2
&& (str[0] || str[1])) {
str += 2;
ret += 2;
len -= 2;