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:
7a82e70
)
libsupport: improve how invalid hex strings are parsed as C strings
author
Theodore Ts'o
<tytso@mit.edu>
Tue, 31 Jan 2017 20:30:28 +0000
(15:30 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Tue, 31 Jan 2017 20:30:28 +0000
(15:30 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/support/cstring.c
patch
|
blob
|
history
diff --git
a/lib/support/cstring.c
b/lib/support/cstring.c
index
3250477
..
7965e95
100644
(file)
--- a/
lib/support/cstring.c
+++ b/
lib/support/cstring.c
@@
-52,7
+52,7
@@
int parse_c_string(char *str)
else if (ch >= 'A' && ch <= 'F')
v = ch + 10 - 'A';
else {
-
ch = *from
;
+
*to = 'x'
;
break;
}
from++;
@@
-64,7
+64,8
@@
int parse_c_string(char *str)
else if (ch >= 'A' && ch <= 'F')
v = (v * 16) + (ch + 10 - 'A');
else {
- ch = *from;
+ *to = 'x';
+ from--;
break;
}
from++;