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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user