mirror of
https://github.com/davatorium/rofi.git
synced 2025-03-17 17:14:42 -04: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…
Add table
Reference in a new issue