diff options
author | Sergei Trofimovich <siarheit@google.com> | 2021-11-14 15:50:01 +0000 |
---|---|---|
committer | Sergei Trofimovich <siarheit@google.com> | 2021-11-17 08:13:18 +0000 |
commit | 486f9e20e037f1eea2dce98dc393db60df5feef3 (patch) | |
tree | a424b4616427e24c0f6466f744bfe51b97fd4235 /opcodes/riscv-opc.c | |
parent | aa95b2d43883666937d31335d0178d2218d9c9aa (diff) | |
download | binutils-486f9e20e037f1eea2dce98dc393db60df5feef3.zip binutils-486f9e20e037f1eea2dce98dc393db60df5feef3.tar.gz binutils-486f9e20e037f1eea2dce98dc393db60df5feef3.tar.bz2 |
gdb/nat/linux-osdata.c: fix build on gcc-12 (string overfow)
On gcc-12 build fails as:
../../gdbserver/../gdb/nat/linux-osdata.c: In function 'void linux_xfer_osdata_processes(buffer*)':
../../gdbserver/../gdb/nat/linux-osdata.c:330:39: error:
'__builtin___sprintf_chk' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
330 | sprintf (core_str, "%d", i);
| ^
It's an off-by-one case in an infeasible scenario for negative
huge core count. The change switches to std::string for memory
handling.
Tested by running 'info os processes' and checking CPU cores column.
Diffstat (limited to 'opcodes/riscv-opc.c')
0 files changed, 0 insertions, 0 deletions