From e439636c39d4e3c50a68fd1fab114dc573a15f01 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 21 Feb 2025 20:00:16 +0100 Subject: [PATCH] Xnest: dont use VLA Replace VLA usage by calloc() Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/xcb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/xnest/xcb.c b/hw/xnest/xcb.c index 0f040c49c..4afabb943 100644 --- a/hw/xnest/xcb.c +++ b/hw/xnest/xcb.c @@ -170,7 +170,10 @@ void xnest_set_command( if (nbytes >= (2^16) - 1) return; - char buf[nbytes+1]; + char *buf = calloc(1, nbytes+1); + if (!buf) + return; // BadAlloc + char *bp = buf; /* copy arguments into single buffer */ @@ -187,6 +190,7 @@ void xnest_set_command( 8, nbytes, buf); + free(buf); } void xnest_xkb_init(xcb_connection_t *conn)