mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
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].
This commit is contained in:
@@ -193,7 +193,7 @@ static int trie_insert(struct trie *trie, struct trie_node *node, const char *se
|
||||
|
||||
for (size_t i = 0;; i++) {
|
||||
size_t p;
|
||||
uint8_t c;
|
||||
char c;
|
||||
struct trie_node *child;
|
||||
|
||||
for (p = 0; (c = trie->strings->buf[node->prefix_off + p]); p++) {
|
||||
|
||||
Reference in New Issue
Block a user