diff -ru systemd-196.orig/src/libudev/libudev-hwdb.c systemd-196/src/libudev/libudev-hwdb.c --- systemd-196.orig/src/libudev/libudev-hwdb.c 2012-11-20 20:19:20.000000000 -0500 +++ systemd-196/src/libudev/libudev-hwdb.c 2012-12-10 00:49:13.639661826 -0500 @@ -169,13 +169,12 @@ linebuf_rem_char(buf); } - if (node->values_count && fnmatch(linebuf_get(buf), search, 0) == 0) - for (i = 0; i < node->values_count; i++) { - err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[i].key_off), - trie_string(hwdb, trie_node_values(hwdb, node)[i].value_off)); - if (err < 0) - return err; - } + if (le64toh(node->values_count) && fnmatch(linebuf_get(buf), search, 0) == 0) { + err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[i].key_off), + trie_string(hwdb, trie_node_values(hwdb, node)[i].value_off)); + if (err < 0) + return err; + } linebuf_rem(buf, len); return 0; @@ -236,7 +235,7 @@ if (search[i] == '\0') { size_t n; - for (n = 0; n < node->values_count; n++) { + for (n = 0; n < le64toh(node->values_count); n++) { err = hwdb_add_property(hwdb, trie_string(hwdb, trie_node_values(hwdb, node)[n].key_off), trie_string(hwdb, trie_node_values(hwdb, node)[n].value_off)); if (err < 0)