- Subject: [slang-devel] [PATCH] Initialized terminfo %g variables
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Thu, 9 May 2024 14:28:34 +0200
Initialize the variables provided by the %g operator to zero
to not leak uninitialized data from the stack if not set by %P.
---
src/sldisply.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sldisply.c b/src/sldisply.c
index 2664aad..7e9a6a6 100644
--- a/src/sldisply.c
+++ b/src/sldisply.c
@@ -514,7 +514,7 @@ static unsigned int tt_sprintf(char *buf, unsigned int buflen, SLCONST char *fmt
int z, z1, parse_level;
int zero_pad;
int field_width;
- int variables [26];
+ int variables [26] = { 0 };
#define STACK_SIZE 64
int stack [STACK_SIZE];
unsigned int stack_len;
--
2.44.0
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.
[2024 date index]
[2024 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]