diff options
| author | Alan Modra <amodra@gmail.com> | 2025-10-09 14:46:39 +1030 |
|---|---|---|
| committer | Alan Modra <amodra@gmail.com> | 2025-10-09 16:04:06 +1030 |
| commit | 937aa6a37d23b6fd24150824a003abaeaef87910 (patch) | |
| tree | fdc8d9e1794d0c57b25bc58abb5fbdd7e9e0c4e5 /gdb/testsuite/gdb.python/py-cmd-exception.py | |
| parent | 7b67c40b51b36aea807261018ffb7b24065d5619 (diff) | |
| download | binutils-937aa6a37d23b6fd24150824a003abaeaef87910.zip binutils-937aa6a37d23b6fd24150824a003abaeaef87910.tar.gz binutils-937aa6a37d23b6fd24150824a003abaeaef87910.tar.bz2 | |
gas/macro.c getstring
This code:
if (in->ptr[idx] == '!')
{
idx++;
sb_add_char (acc, in->ptr[idx++]);
}
and similar code in the other loop, blindly accessed the next element
of the string buffer without first checking idx against in->len,
leading to uninitialised accesses or buffer overruns. Fix that, and
tidy the loops so that the function always returns the index one past
the last char consumed. (It could return idx == in->len + 1).
* macro.c (getstring): Don't access past end of input string
buffer. Tidy loops. Don't return an index past in->len.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-cmd-exception.py')
0 files changed, 0 insertions, 0 deletions
