mirror of
https://github.com/lbonn/rofi
synced 2024-11-15 08:37:17 +00:00
Validate if input is utf-8 for dmenu, if not ignore that line
This should avoid crashing on invalid encoding.
This commit is contained in:
parent
2cc2522e57
commit
5185f1181c
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,11 @@ static char **get_dmenu ( FILE *fd, unsigned int *length )
|
|||
}
|
||||
if ( data[l - 1] == config.separator ) {
|
||||
data[l - 1] = '\0';
|
||||
l--;
|
||||
}
|
||||
if ( ! g_utf8_validate ( data, l, NULL) ) {
|
||||
fprintf(stderr, "String: '%s' is not valid utf-8\n", data);
|
||||
continue;
|
||||
}
|
||||
|
||||
retv[( *length )] = data;
|
||||
|
|
Loading…
Reference in a new issue