diff options
Diffstat (limited to '')
-rw-r--r-- | libfonts_parse_alias_line.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libfonts_parse_alias_line.c b/libfonts_parse_alias_line.c index 0496449..3e712e2 100644 --- a/libfonts_parse_alias_line.c +++ b/libfonts_parse_alias_line.c @@ -86,6 +86,11 @@ libfonts_parse_alias_line(enum libfonts_alias_line_type *typep, char **aliasp, c if (namep) *namep = NULL; + if (!line) { + errno = EINVAL; + goto fail; + } + while (isblank(*line)) line++; if (!*line) @@ -132,8 +137,9 @@ fail: *namep = NULL; } ret = -1; - while (*line && *line != '\n') - line++; + if (line) + while (*line && *line != '\n') + line++; out: if (endp) *endp = *(char **)(void *)&line; |