Commit 5989a293 authored by Dave Airlie's avatar Dave Airlie
Browse files

mesa/objectlabel: don't do memcpy if bufSize is 0 (v2)

This prevents GL43-CTS.khr_debug.labels_non_debug from
memcpying all over the stack and crashing.

v2: actually fix the test.
Reviewed-by: Alejandro Piñeiro's avatarAlejandro Piñeiro <>
Signed-off-by: default avatarDave Airlie <>
parent 30823f99
......@@ -104,6 +104,11 @@ copy_label(const GLchar *src, GLchar *dst, GLsizei *length, GLsizei bufSize)
* will be returned in <length>."
if (bufSize == 0) {
if (length)
*length = strlen(src);
if (src)
labelLen = strlen(src);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment