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 <mark.a.janes@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Mark Janes
2016-05-03 13:50:49 -07:00
parent 265fe9dce8
commit 0af8a7d50c
+6 -5
View File
@@ -104,14 +104,15 @@ 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);
if (bufSize == 0) {
if (length)
*length = labelLen;
return;
}
if (dst) {
if (src) {
if (bufSize <= labelLen)