systemd-hwdb: fix unsigned and signed comparison problem
authorhuyubiao <huyubiao@huawei.com>
Tue, 26 Sep 2023 06:46:55 +0000 (14:46 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 26 Sep 2023 16:38:16 +0000 (17:38 +0100)
commitb53a80966e8a2d68b66bf1b47c2ee633a71fad49
tree0510e13bce059508e09389663d0f181ebfb00985
parent5808300c442359aea1ad4c0d1eb3e7717673bd38
systemd-hwdb: fix unsigned and signed comparison problem
...
uint8_t c;
struct trie_node *child;

for (p = 0; (c = trie->strings->buf[node->prefix_off + p]); p++) {
        _cleanup_free_ struct trie_node *new_child = NULL;
        _cleanup_free_ char *s = NULL;
        ssize_t off;
if (c == search[i + p])
        continue;
...
When '®' is present in search, c is 194, search[i + p] is -62, c is not equal to search[i + p], but c should be equal to search[i + p].
src/shared/hwdb-util.c