From 23561f9665609bcb4cbe89a993a70eeccbec600e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 14 Aug 2022 13:48:11 -0700 Subject: [PATCH] Work around Bug#57211 * src/buffer.c (Fgenerate_new_buffer_name): Allocate a bigger buffer. --- src/buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index 6ab516d5f5..98066a2eb6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1160,7 +1160,8 @@ DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name, genbase = name; else { - char number[sizeof "-999999"]; + enum { bug_52711 = true }; /* https://bugs.gnu.org/57211 */ + char number[bug_52711 ? INT_BUFSIZE_BOUND (int) + 1 : sizeof "-999999"]; EMACS_INT r = get_random (); eassume (0 <= r); int i = r % 1000000; -- 2.34.1