xtensa: Fix buffer overflow

Message ID ff95601d-2441-ab53-a1a9-8e109c71484d@yahoo.co.jp
State Committed
Commit ec532b47f1823e71f822c0da781c531ffff67a52
Headers
Series xtensa: Fix buffer overflow |

Commit Message

Takayuki 'January June' Suwa June 21, 2022, 7:51 p.m. UTC
  Fortify buffer overflow message reported.
(see https://github.com/earlephilhower/esp-quick-toolchain/issues/36)

gcc/ChangeLog:

	* config/xtensa/xtensa.md (bswapsi2_internal):
	Enlarge the buffer that is obviously smaller than the template
	string given to sprintf().
---
 gcc/config/xtensa/xtensa.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Max Filippov June 22, 2022, 12:53 a.m. UTC | #1
On Tue, Jun 21, 2022 at 12:52 PM Takayuki 'January June' Suwa
<jjsuwa_sys3175@yahoo.co.jp> wrote:
>
> Fortify buffer overflow message reported.
> (see https://github.com/earlephilhower/esp-quick-toolchain/issues/36)
>
> gcc/ChangeLog:
>
>         * config/xtensa/xtensa.md (bswapsi2_internal):
>         Enlarge the buffer that is obviously smaller than the template
>         string given to sprintf().
> ---
>  gcc/config/xtensa/xtensa.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Committed to master.
  

Patch

diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 84b975cf00e..f31ec33b362 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -536,7 +536,7 @@ 
 {
   rtx_insn *prev_insn = prev_nonnote_nondebug_insn (insn);
   const char *init = "ssai\t8\;";
-  static char result[64];
+  static char result[128];
   if (prev_insn && NONJUMP_INSN_P (prev_insn))
     {
       rtx x = PATTERN (prev_insn);