projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30823f9
)
mesa/objectlabel: don't do memcpy if bufSize is 0 (v2)
author
Dave Airlie
<airlied@redhat.com>
Tue, 3 May 2016 07:32:28 +0000
(17:32 +1000)
committer
Dave Airlie
<airlied@redhat.com>
Tue, 3 May 2016 10:12:59 +0000
(20:12 +1000)
This prevents GL43-CTS.khr_debug.labels_non_debug from
memcpying all over the stack and crashing.
v2: actually fix the test.
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/objectlabel.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/objectlabel.c
b/src/mesa/main/objectlabel.c
index b622d6a2979227350da5f8f5a92e735d4f26844e..b77cb5c4e36767b24e8b75ae011c0d46148bb75f 100644
(file)
--- a/
src/mesa/main/objectlabel.c
+++ b/
src/mesa/main/objectlabel.c
@@
-104,6
+104,11
@@
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);