diff options
author | Gary Benson <gbenson@redhat.com> | 2013-10-23 13:58:26 +0100 |
---|---|---|
committer | Tom Tromey <tromey@sourceware.org> | 2013-10-25 14:02:59 +0000 |
commit | f60db4f07f328df2d27356b157804e372af73401 (patch) | |
tree | c970c9c4b72dd8810e0848065d5188fb5b2482be /gold | |
parent | 6d3e7a943f8bc67ceb2901500cea9c3bcaaf687a (diff) | |
download | gdb-f60db4f07f328df2d27356b157804e372af73401.zip gdb-f60db4f07f328df2d27356b157804e372af73401.tar.gz gdb-f60db4f07f328df2d27356b157804e372af73401.tar.bz2 |
Fix off-by-one errors in *scanf format strings.
In the first hunk, the format string was off-by-one for cmd, and cmd
itself was larger than the maximum size required. cmd was reduced in
size and the format string adjusted.
In the second hunk, the format string was off-by-one for local_address,
remote_address and extra, although the buffers for the two addresses
were large enough for this not to matter. The specifiers for the two
addresses was corrected, and a number of unused variables including
extra were suppressed from parsing.
In the third hunk, the format string was off-by-one for name,
dependencies and status. This code was rewritten using strtok since
dependencies can be arbitrarily long.
gdb/
2013-10-23 Gary Benson <gbenson@redhat.com>
PR 16013
* common/linux-osdata.c (command_from_pid): Reduced size of cmd
from 32 to 18. Adjusted fscanf format string accordingly.
(Avoids leaving cmd unterminated.)
(print_sockets): Do not parse tlen, inode, sl, timeout, txq, rxq,
trun, retn or extra. (Avoids leaving extra unterminated.) Check
that local_address and remote_address will not overflow.
(linux_xfer_osdata_modules): Parse lines using strtok to avoid
leaving dependencies unterminated. Parse size as "%u" to match
definition.
Diffstat (limited to 'gold')
0 files changed, 0 insertions, 0 deletions