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:
parent
5038b4e413
commit
e439636c39
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue