[PATCH xserver] parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL)

Adam Jackson ajax at redhat.com
Mon Jan 23 16:31:36 UTC 2017


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/parser/scan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 81a454b..3356224 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -1046,6 +1046,8 @@ xf86nameCompare(const char *s1, const char *s2)
             return 0;
         else
             return 1;
+    } else if (!s2 || *s2 == 0) {
+        return -1;
     }
 
     while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
-- 
2.9.3



More information about the xorg-devel mailing list