[Bf-blender-cvs] [569e2e6dbac] master: GPUDebug: Avoid using STREQ on StringRef

Clément Foucault noreply at git.blender.org
Wed Sep 16 15:24:44 CEST 2020


Commit: 569e2e6dbac489b4143859cfeb87debf7253eab6
Author: Clément Foucault
Date:   Wed Sep 16 15:24:37 2020 +0200
Branches: master
https://developer.blender.org/rB569e2e6dbac489b4143859cfeb87debf7253eab6

GPUDebug: Avoid using STREQ on StringRef

This might be dangerous because StringRef is not guaranteed to be
null-terminated and STREQ assumes null termination.

===================================================================

M	source/blender/gpu/intern/gpu_debug.cc

===================================================================

diff --git a/source/blender/gpu/intern/gpu_debug.cc b/source/blender/gpu/intern/gpu_debug.cc
index 3d17b6f8649..d7944f0de50 100644
--- a/source/blender/gpu/intern/gpu_debug.cc
+++ b/source/blender/gpu/intern/gpu_debug.cc
@@ -88,7 +88,7 @@ bool GPU_debug_group_match(const char *ref)
   }
   DebugStack &stack = ctx->debug_stack;
   for (StringRef &name : stack) {
-    if (STREQ(name.data(), ref)) {
+    if (name == ref) {
       return true;
     }
   }



More information about the Bf-blender-cvs mailing list