summaryrefslogtreecommitdiff
path: root/src/Font.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2021-05-30 16:33:48 +0200
committerMatthieu Herrb <matthieu@herrb.eu>2021-05-30 16:33:48 +0200
commitab2f59530b16bdfbf023b8e025c7c8aba3b6fd0c (patch)
treeb83c2a27053c3d68b0f7eece96e219627d81ed23 /src/Font.c
parenta8216e8653a246db664e1443ecf707b27de65067 (diff)
Check for NULL strings before getting their lengths
Problem reported by Karsten Trulsen Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Diffstat (limited to 'src/Font.c')
-rw-r--r--src/Font.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Font.c b/src/Font.c
index 1cd89cca..d4314e26 100644
--- a/src/Font.c
+++ b/src/Font.c
@@ -102,7 +102,7 @@ XFontStruct *XLoadQueryFont(
XF86BigfontCodes *extcodes = _XF86BigfontCodes(dpy);
#endif
- if (strlen(name) >= USHRT_MAX)
+ if (name != NULL && strlen(name) >= USHRT_MAX)
return NULL;
if (_XF86LoadQueryLocaleFont(dpy, name, &font_result, (Font *)0))
return font_result;