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 <apinheiro@igalia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -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);
|
||||
return;
|
||||
}
|
||||
if (src)
|
||||
labelLen = strlen(src);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user