Commit 0af8a7d5 authored by Mark Janes's avatar Mark Janes
Browse files

mesa/objectlabel: handle NULL src string

This prevents a crash when a NULL src is passed with a non-NULL length.

fixes: dEQP-GLES31.functional.debug.object_labels.query_length_only
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95252

Signed-off-by: Mark Janes's avatarMark Janes <mark.a.janes@intel.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
parent 265fe9dc
...@@ -104,13 +104,14 @@ copy_label(const GLchar *src, GLchar *dst, GLsizei *length, GLsizei bufSize) ...@@ -104,13 +104,14 @@ copy_label(const GLchar *src, GLchar *dst, GLsizei *length, GLsizei bufSize)
* will be returned in <length>." * will be returned in <length>."
*/ */
if (src)
labelLen = strlen(src);
if (bufSize == 0) { if (bufSize == 0) {
if (length) if (length)
*length = strlen(src); *length = labelLen;
return; return;
} }
if (src)
labelLen = strlen(src);
if (dst) { if (dst) {
if (src) { if (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