parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL)

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit f1f865e909)
This commit is contained in:
Adam Jackson 2017-01-23 11:31:36 -05:00 committed by Olivier Fourdan
parent 9db3361b29
commit 8c60976400

View File

@ -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')