mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
(!1654) Xnest: dont use VLA
Replace VLA usage by calloc() Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -170,7 +170,10 @@ void xnest_set_command(
|
|||||||
if (nbytes >= (2^16) - 1)
|
if (nbytes >= (2^16) - 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char buf[nbytes+1];
|
char *buf = calloc(1, nbytes+1);
|
||||||
|
if (!buf)
|
||||||
|
return; // BadAlloc
|
||||||
|
|
||||||
char *bp = buf;
|
char *bp = buf;
|
||||||
|
|
||||||
/* copy arguments into single buffer */
|
/* copy arguments into single buffer */
|
||||||
@@ -187,6 +190,7 @@ void xnest_set_command(
|
|||||||
8,
|
8,
|
||||||
nbytes,
|
nbytes,
|
||||||
buf);
|
buf);
|
||||||
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xnest_xkb_init(xcb_connection_t *conn)
|
void xnest_xkb_init(xcb_connection_t *conn)
|
||||||
|
|||||||
Reference in New Issue
Block a user