src/GLX/libglx.c | 7 +++++++ src/GLX/libglxmapping.c | 5 +++++ tests/Makefile.am | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-)
New commits: commit f7e7657803bb3c275d1d3c6afd4c889660b6bb71 Author: Andy Ritger <[email protected]> Date: Tue Sep 3 22:39:08 2013 -0700 Check for strdup(3) failure in cacheProcAddress() Signed-off-by: Andy Ritger <[email protected]> Signed-off-by: Brian Nguyen <[email protected]> diff --git a/src/GLX/libglx.c b/src/GLX/libglx.c index 47373de..011d572 100644 --- a/src/GLX/libglx.c +++ b/src/GLX/libglx.c @@ -880,6 +880,13 @@ static void cacheProcAddress(const GLubyte *procName, __GLXextFuncPtr addr) } pEntry->procName = (GLubyte *)strdup((const char *)procName); + + if (pEntry->procName == NULL) { + assert(pEntry->procName); + free(pEntry); + return; + } + pEntry->addr = addr; LKDHASH_WRLOCK(__glXPthreadFuncs, __glXProcAddressHash); commit 345a2f34ce50a39580a39deb9950d0b8c06d79a2 Author: Andy Ritger <[email protected]> Date: Tue Sep 3 22:23:56 2013 -0700 Link libtrace.la *after* libglvnd_pthread.la Debug builds of libglvnd_pthread.la depend on the __glvnd_dbg_printf symbol from libtrace.la. Sort the link order so that the linker sees libglvnd_pthread.la and its unresolved symbol first, so that it knows to resolve it when it subsequently sees libtrace.la. Signed-off-by: Andy Ritger <[email protected]> Signed-off-by: Brian Nguyen <[email protected]> diff --git a/tests/Makefile.am b/tests/Makefile.am index b2b5331..f25474d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -68,8 +68,8 @@ testglxnscreens_CFLAGS = -I$(X11GLVND_DIR) $(AM_CFLAGS) testglxnscreens_LDADD = -lX11 testglxnscreens_LDADD += $(top_builddir)/src/GLX/libGLX.la testglxnscreens_LDADD += $(top_builddir)/src/OpenGL/libOpenGL.la -testglxnscreens_LDADD += $(top_builddir)/src/util/trace/libtrace.la testglxnscreens_LDADD += $(top_builddir)/src/util/glvnd_pthread/libglvnd_pthread.la +testglxnscreens_LDADD += $(top_builddir)/src/util/trace/libtrace.la testglxnscreens_LDADD += -lX11 $(X11GLVND_DIR)/libx11glvnd_client.la # The *_oldlink variant tests that linking against legacy libGL.so works @@ -86,8 +86,8 @@ testglxmakecurrent_oldlink_SOURCES = \ testglxmakecurrent_oldlink_LDADD = -lX11 testglxmakecurrent_oldlink_LDADD += $(top_builddir)/src/GL/libGL.la -testglxmakecurrent_oldlink_LDADD += $(top_builddir)/src/util/trace/libtrace.la testglxmakecurrent_oldlink_LDADD += $(top_builddir)/src/util/glvnd_pthread/libglvnd_pthread.la +testglxmakecurrent_oldlink_LDADD += $(top_builddir)/src/util/trace/libtrace.la testx11glvndproto_CFLAGS = -I$(X11GLVND_DIR) testx11glvndproto_LDADD = -lX11 $(X11GLVND_DIR)/libx11glvnd_client.la @@ -107,8 +107,8 @@ testglxgetprocaddress_LDADD = $(top_builddir)/src/GLX/libGLX.la testglxmakecurrent_LDADD = -lX11 testglxmakecurrent_LDADD += $(top_builddir)/src/GLX/libGLX.la testglxmakecurrent_LDADD += $(top_builddir)/src/OpenGL/libOpenGL.la -testglxmakecurrent_LDADD += $(top_builddir)/src/util/trace/libtrace.la testglxmakecurrent_LDADD += $(top_builddir)/src/util/glvnd_pthread/libglvnd_pthread.la +testglxmakecurrent_LDADD += $(top_builddir)/src/util/trace/libtrace.la testglxgetclientstr_LDADD = -lX11 testglxgetclientstr_LDADD += $(top_builddir)/src/GLX/libGLX.la commit c8ae6458854379b615d0030c991ac99614eeec56 Author: Andy Ritger <[email protected]> Date: Tue Sep 3 21:57:16 2013 -0700 Check strdup(3) return value in AllocDispatchIndex() Signed-off-by: Andy Ritger <[email protected]> Signed-off-by: Brian Nguyen <[email protected]> diff --git a/src/GLX/libglxmapping.c b/src/GLX/libglxmapping.c index 9932e8a..c243cf4 100644 --- a/src/GLX/libglxmapping.c +++ b/src/GLX/libglxmapping.c @@ -130,6 +130,10 @@ static GLboolean AllocDispatchIndex(__GLXvendorInfo *vendor, } pEntry->procName = (GLubyte *)strdup((const char *)procName); + if (!pEntry->procName) { + free(pEntry); + return GL_FALSE; + } LKDHASH_WRLOCK(__glXPthreadFuncs, __glXDispatchIndexHash); pEntry->index = __glXNextUnusedHashIndex++; commit b7f965ed737f327ed66957963ea26fcf14ccf3f5 Author: Andy Ritger <[email protected]> Date: Tue Sep 3 21:55:54 2013 -0700 Unlock in the __glXFetchDispatchEntry() failure path. Signed-off-by: Andy Ritger <[email protected]> Signed-off-by: Brian Nguyen <[email protected]> diff --git a/src/GLX/libglxmapping.c b/src/GLX/libglxmapping.c index 4eb057d..9932e8a 100644 --- a/src/GLX/libglxmapping.c +++ b/src/GLX/libglxmapping.c @@ -228,6 +228,7 @@ __GLXextFuncPtr __glXFetchDispatchEntry(__GLXdispatchTableDynamic *dynDispatch, if (!pEntry) { // Uh-oh! assert(pEntry); + LKDHASH_UNLOCK(__glXPthreadFuncs, dynDispatch->hash); return NULL; } pEntry->index = index; -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

