[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] keyboard: fix qemu load empty keymap

From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] keyboard: fix qemu load empty keymap
Date: Thu, 03 Nov 2016 08:09:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Michael Tokarev <address@hidden> writes:

> 03.11.2016 08:56, Wang Xin wrote:
>> qemu_find_file do not check file is a directory or just a file.
>> If qemu start with "-k ''", qemu_find_file get a empty string
>> as keymap file name, then, qemu treat the keymap path as keymap
>> file, it makes vnc keyboard input unusable.
> Do we really care?  "Garbage in, garbage out" I'd say :)

Moreover, are you really, really sure qemu_find_file() is never used to
find a directory?

Outside the scope of the patch: qemu_find_file() is basically a bad
idea.  By the time the file name it computes gets used, the file it
found may be gone, or have become a directory (TOCTTOU).

The proper fix for -k '' breaking the keyboard would be to make -k
reject garbage input.  Have a look at parse_keyboard_layout() and weep.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]