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>
* will be returned in <length>."
*/
+ if (src)
+ labelLen = strlen(src);
+
if (bufSize == 0) {
if (length)
- *length = strlen(src);
+ *length = labelLen;
return;
}
- if (src)
- labelLen = strlen(src);
if (dst) {
if (src) {