Mesa (master): pipe-loader: check that the pointer to driconf_xml isn't NULL

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 21 06:54:09 UTC 2019


Module: Mesa
Branch: master
Commit: 8fc8e8e8be787173f41e8256b9068322f8f3d78d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8fc8e8e8be787173f41e8256b9068322f8f3d78d

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Nov 20 09:14:17 2019 +0100

pipe-loader: check that the pointer to driconf_xml isn't NULL

This happens when mesa is built with only swrast. The default
driver being kmsro and the default driconf file being v3d,
it's NULL and then strdup crashes.

This fixes a crash with piglit spec/egl_mesa_query_driver/conformance.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>

---

 src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 2e1bff4c233..7d90285a484 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -331,7 +331,7 @@ pipe_loader_drm_get_driinfo_xml(const char *driver_name)
    const struct drm_driver_descriptor *dd =
       get_driver_descriptor(driver_name, &lib);
 
-   if (dd && dd->driconf_xml)
+   if (dd && dd->driconf_xml && *dd->driconf_xml)
       xml = strdup(*dd->driconf_xml);
 
    if (lib)




More information about the mesa-commit mailing list