mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 07:40:31 +01:00
When run in optirun, applications that linked to `libGLX.so` and then proceeded to querying Mesa for extension strings caused a SEGV in Mesa. `glXQueryExtensionsString` was calling a chain of functions that eventually led to `__glXQueryServerString`. This function would call `xcb_glx_query_server_string` then `xcb_glx_query_server_string_reply`. The latter for some unknown reason returned `NULL`. Passing this `NULL` to `xcb_glx_query_server_string_string_length` would cause a SEGV as the function tried to dereference it. The reason behind the function returning `NULL` is yet to be determined, however, simply checking that the ptr is not `NULL` resolves this. A similar check has been added to `__glXGetString` for completeness sake, although not immediately necessary. In addition to that, we stumbled into a similar problem in `AllocAndFetchScreenConfigs` which tries to access the configs to free them if `__glXQueryServerString` fails. This, of course, SEGVs, because the configs are yet to have been allocated. Simply continuing past the configs if their config ptrs are `NULL` resolves this. We also switch to `calloc` to make sure that the config ptrs are `NULL` by default, and not some uninitialized value. Cc: mesa-stable@lists.freedesktop.org Fixes: |
||
|---|---|---|
| .. | ||
| apple | ||
| tests | ||
| windows | ||
| applegl_glx.c | ||
| clientattrib.c | ||
| clientinfo.c | ||
| compsize.c | ||
| create_context.c | ||
| dri2.c | ||
| dri2.h | ||
| dri2_glx.c | ||
| dri2_priv.h | ||
| dri3_glx.c | ||
| dri3_priv.h | ||
| dri_common.c | ||
| dri_common.h | ||
| dri_common_interop.c | ||
| dri_common_query_renderer.c | ||
| dri_glx.c | ||
| dri_sarea.h | ||
| drisw_glx.c | ||
| drisw_priv.h | ||
| driwindows_glx.c | ||
| eval.c | ||
| g_glxglvnddispatchfuncs.c | ||
| g_glxglvnddispatchindices.h | ||
| glx_error.c | ||
| glx_error.h | ||
| glx_pbuffer.c | ||
| glx_query.c | ||
| glxclient.h | ||
| glxcmds.c | ||
| glxconfig.c | ||
| glxconfig.h | ||
| glxcurrent.c | ||
| glxext.c | ||
| glxextensions.c | ||
| glxextensions.h | ||
| glxglvnd.c | ||
| glxglvnd.h | ||
| glxglvnddispatchfuncs.h | ||
| glxhash.c | ||
| glxhash.h | ||
| indirect_glx.c | ||
| indirect_init.h | ||
| indirect_texture_compression.c | ||
| indirect_transpose_matrix.c | ||
| indirect_vertex_array.c | ||
| indirect_vertex_array.h | ||
| indirect_vertex_array_priv.h | ||
| indirect_vertex_program.c | ||
| indirect_window_pos.c | ||
| meson.build | ||
| packrender.h | ||
| packsingle.h | ||
| pixel.c | ||
| pixelstore.c | ||
| query_renderer.c | ||
| render2.c | ||
| renderpix.c | ||
| SConscript | ||
| single2.c | ||
| singlepix.c | ||
| vertarr.c | ||
| XF86dri.c | ||
| xf86dri.h | ||
| xf86dristr.h | ||
| xfont.c | ||