]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-hwdb: fix matching for characters with an ord > 127
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 8 Feb 2019 00:30:48 +0000 (10:30 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Feb 2019 22:19:20 +0000 (23:19 +0100)
commitdc4b6f8d2c84fc1dcbbb250c573ab5902bbf3990
treeb9bd4b07ae6de389bf51467ef9ffdfac703ab308
parent0471921b3eb12b7f4621bd73005bdbb3dbd39427
sd-hwdb: fix matching for characters with an ord > 127

Devices like the "Microsoft Microsoft® 2.4GHz Transceiver v9.0 Mouse" contain
characters higher than 127. That ® is correctly stored in the hwdb and passed
into the search field during query, but the comparison fails.

Our search string is a const char *, trie_string() returns a const char * but
the current character is cast to uint8_t. This causes anything over 127 to
fail the match. Fix this, we're dealing with characters everywhere here after
all.
src/libsystemd/sd-hwdb/sd-hwdb.c