Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprintf #108

Open
mix127 opened this issue Jun 22, 2024 · 1 comment
Open

sprintf #108

mix127 opened this issue Jun 22, 2024 · 1 comment

Comments

@mix127
Copy link

mix127 commented Jun 22, 2024

In function ‘sprintf’,
inlined from ‘get_imm_str_s’ at external/Musashi//m68kdasm.c:410:3,
inlined from ‘d68020_cmpi_pcix_8’ at external/Musashi//m68kdasm.c:1416:8,
inlined from ‘d68020_cmpi_pcdi_8’ at external/Musashi//m68kdasm.c:1412:13:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 21 bytes into a destination of size 15
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
external/Musashi//m68kdasm.c: In function ‘d68000_cmpi_8’:
external/Musashi//m68kdasm.c:410:32: warning: ‘%s’ directive writing up to 19 bytes into a region of size 14 [-Wformat-overflow=]
369 | return str;
| ~~~
......
410 | sprintf(str, "#%s", make_signed_hex_str_8(read_imm_8()));
| ^~
In function ‘sprintf’,
inlined from ‘get_imm_str_s’ at external/Musashi//m68kdasm.c:410:3,
inlined from ‘d68000_cmpi_8’ at external/Musashi//m68kdasm.c:1400:14:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 21 bytes into a destination of size 15
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
external/Musashi//m68kdasm.c: In function ‘d68000_addi_32’:
external/Musashi//m68kdasm.c:414:32: warning: ‘%s’ directive writing up to 19 bytes into a region of size 14 [-Wformat-overflow=]
401 | return str;
| ~~~
......
414 | sprintf(str, "#%s", make_signed_hex_str_32(read_imm_32()));
| ^~
In function ‘sprintf’,
inlined from ‘get_imm_str_s’ at external/Musashi//m68kdasm.c:414:3,
inlined from ‘d68000_addi_32’ at external/Musashi//m68kdasm.c:785:14:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 21 bytes into a destination of size 15
30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
external/Musashi//m68kdasm.c: In function ‘d68000_addi_16’:
external/Musashi//m68kdasm.c:412:32: warning: ‘%s’ directive writing up to 19 bytes into a region of size 14 [-Wformat-overflow=]

@kstenerud
Copy link
Owner

I'm not able to replicate on my system (macos, clang-1500.3.9.4), but I've added a commit to increase buffer sizes according to the warnings you've seen. Can you check if the latest commit fixes it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants