xtensa: Fix buffer overflow
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Tue, 21 Jun 2022 19:51:32 +0000 (04:51 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Wed, 22 Jun 2022 00:52:24 +0000 (17:52 -0700)
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

index 84b975c..f31ec33 100644 (file)
 {
   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);