<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - mapi_stub->name points to caller memory leads heap-use-after-free bug"
href="https://bugs.freedesktop.org/show_bug.cgi?id=81992#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - mapi_stub->name points to caller memory leads heap-use-after-free bug"
href="https://bugs.freedesktop.org/show_bug.cgi?id=81992">bug 81992</a>
from <span class="vcard"><a class="email" href="mailto:comicfans44@gmail.com" title="comicfans44 <comicfans44@gmail.com>"> <span class="fn">comicfans44</span></a>
</span></b>
<pre>Qt OpenGL use dynamic allocated memory to test GL extensions.
this bug makes every Qt OpenGL app memory corrupted.
I'm not sure a simple strdup is the correct way
(maybe leak instead of memory corrupt).
with this patch, use-heap-after-free didn't happen anyway.
diff -Npru mesa-20150314.orig/src/mapi/stub.c mesa-20150314/src/mapi/stub.c
--- mesa-20150314.orig/src/mapi/stub.c 2015-03-14 07:32:12.000000000 +0800
+++ mesa-20150314/src/mapi/stub.c 2015-03-16 10:02:46.860273804 +0800
@@ -110,7 +110,7 @@ stub_add_dynamic(const char *name)
if (!stub->addr)
return NULL;
- stub->name = (const void *) name;
+ stub->name = strdup(name);
/* to be fixed later */
stub->slot = -1;</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>