mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
freedreno/decode: fix possible overflow
```
../src/freedreno/decode/rddecompiler.c:242:65: error: 'sscanf' may overflow; destination buffer in argument 3 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
if (sscanf(info->name, "%32[A-Z0-6_][%32[x0-9]].%32s", reg_name,
^
../src/freedreno/decode/rddecompiler.c:243:21: error: 'sscanf' may overflow; destination buffer in argument 4 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
reg_idx, field_name) != 3) {
^
../src/freedreno/decode/rddecompiler.c:243:30: error: 'sscanf' may overflow; destination buffer in argument 5 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
reg_idx, field_name) != 3) {
^
```
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
This commit is contained in:
parent
6c5888b890
commit
c029b1499f
1 changed files with 3 additions and 3 deletions
|
|
@ -231,9 +231,9 @@ decompile_register(uint32_t regbase, uint32_t *dwords, uint16_t cnt, int level)
|
|||
if (cnt == 0) {
|
||||
printlvl(level, "pkt(cs, %u);\n", dword);
|
||||
} else {
|
||||
char reg_name[32];
|
||||
char field_name[32];
|
||||
char reg_idx[32];
|
||||
char reg_name[33];
|
||||
char field_name[33];
|
||||
char reg_idx[33];
|
||||
|
||||
/* reginfo doesn't return reg name in a compilable format, for now just
|
||||
* parse it into a compilable reg name.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue