Commit Graph

8 Commits

Author SHA1 Message Date
Yonggang Luo 6bde428c0a mapi: Trim trailing spaces in stub.c and u_current.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
2022-07-29 23:59:11 +00:00
Jesse Natalie 92f515ad6e mapi: Fix shared-glapi build with MSVC
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:21:26 -07:00
Mario Kleiner 1110113a7f mapi: Make private copies of name strings provided by client.
glXGetProcAddress("glFoo") ends up in stub_add_dynamic() to
create dynamic stubs for dynamic functions. stub_add_dynamic()
doesn't store the caller provided name string "Foo" in a mesa
private copy, but just stores a pointer to the "glFoo" string
passed to glXGetProcAddress - a pointer into arbitrary memory
outside mesa's control.

If the caller passes some dynamically allocated/changing
memory buffer to glXGetProcAddress(), or the caller gets unmapped
from memory, e.g., some dynamically loaded application
plugin which uses OpenGL, this ends badly - with a dangling
pointer.

strdup() the name string provided by the client to avoid
this problem.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-23 22:17:03 +00:00
Brian Paul 9385c592c6 mapi: remove u_thread.h
Just use c11 threads directly.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-03-05 06:59:43 -07:00
Brian Paul 25a847d9cc mapi: remove unneeded ARRAY_SIZE #define
include util/macros.h instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-03-04 08:33:48 -07:00
Brian Paul 84094a273e glapi: remove u_mutex wrapper code, use c99 thread mutexes directly
v2: fix initializer mistake spotted by Chia-I Wu.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:53:06 -07:00
Rico Schüller 3998cfa933 mesa: remove outdated version lines in comments
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-06-05 08:54:27 -06:00
Matt Turner d5e9426b96 build: Move src/mapi/mapi/* to src/mapi/
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-15 12:04:25 -07:00
Renamed from src/mapi/mapi/stub.c (Browse further)