From c5c63a1a3daaee0b7874484cc0aa9cbad096bf82 Mon Sep 17 00:00:00 2001 From: Rene Kita Date: Mon, 30 Aug 2021 20:09:11 +0200 Subject: [PATCH] Fix a potential buffer overflow When compiling with -Wformat-overflow=2 GCC reports: note: 'sprintf' output between 16 and 35 bytes into a destination of size 32 --- buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buffer.c b/buffer.c index e70cffe..083ecf6 100644 --- a/buffer.c +++ b/buffer.c @@ -239,7 +239,7 @@ writeBufferName(Buffer *buf, int n) void gotoLine(Buffer *buf, int n) { - char msg[32]; + char msg[36]; Line *l = buf->firstLine; if (l == NULL) @@ -284,7 +284,7 @@ gotoLine(Buffer *buf, int n) void gotoRealLine(Buffer *buf, int n) { - char msg[32]; + char msg[36]; Line *l = buf->firstLine; if (l == NULL)