vconsole: reject empty layout during keymap conversion with error
A leading-dash console keymap or leading-comma X11 layout can produce an
empty layout while converting between the two formats. find_converted_keymap()
then asserts on it, allowing malformed input to abort callers such as localed.
Return EINVAL for an empty derived layout instead.
Follow-up for 6d0f502736
This commit is contained in:
@@ -352,9 +352,11 @@ int find_converted_keymap(const X11Context *xc, char **ret) {
|
||||
int r;
|
||||
|
||||
assert(xc);
|
||||
assert(!isempty(xc->layout));
|
||||
assert(ret);
|
||||
|
||||
if (isempty(xc->layout))
|
||||
return -EINVAL;
|
||||
|
||||
if (xc->variant)
|
||||
n = strjoin(xc->layout, "-", xc->variant);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user