mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-30 12:44:10 +08:00
Fix potential buffer overrun whilst scanning macro strings.
PR 24010 * macro.c (get_any_string): Check for end of input whilst scanning for separators.
This commit is contained in:
parent
bdfb445597
commit
1b2ed39c3a
@ -1,3 +1,9 @@
|
||||
2019-01-04 Wu Heng <wu.heng@zte.com.cn>
|
||||
|
||||
PR 24010
|
||||
* macro.c (get_any_string): Check for end of input whilst scanning
|
||||
for separators.
|
||||
|
||||
2019-01-04 Wu Heng <wu.heng@zte.com.cn>
|
||||
|
||||
PR 24009
|
||||
|
@ -369,7 +369,7 @@ get_any_string (size_t idx, sb *in, sb *out)
|
||||
{
|
||||
if (in->len > idx + 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx]))
|
||||
{
|
||||
while (!ISSEP (in->ptr[idx]))
|
||||
while (idx < in->len && !ISSEP (in->ptr[idx]))
|
||||
sb_add_char (out, in->ptr[idx++]);
|
||||
}
|
||||
else if (in->ptr[idx] == '%' && macro_alternate)
|
||||
|
Loading…
Reference in New Issue
Block a user