]> git.cworth.org Git - glaze/commit
Fix segmentation fault if GLAZE_LIBGL is set to empty string
authorCarl Worth <cworth@cworth.org>
Mon, 23 Sep 2013 14:00:51 +0000 (07:00 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 23 Sep 2013 14:00:51 +0000 (07:00 -0700)
commitac96e5c9b7b834687eebc503580937934b9abc57
treeb20c54aae1eed281f5d558abe4ee49d2d31f1d89
parentacb1372fca12d1df8bead92eb2ab16dbc98b9c6c
Fix segmentation fault if GLAZE_LIBGL is set to empty string

Previosuly, we would catch and report an unset GLAZE_LIBGL variable
with a clean error message so that the user would know to set this
variable. Similarly, if the variable was set to an incorrect filename,
that would also result in a good error message.

But, if the user happened to set GLAZE_LIBGL to an empty string, then
Glaze would march on and end up triggering the dlsym behavior where a
NULL handle results in a lookup in the local program. This would then
trigger infinite recursion in the resolving of the ifunc symbol and a
not-very-useful segfault.

We avoid all that by noticing the empty string up front and giving the
user the useful error message.
glaze-gl.c