diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-04 01:59:06 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-05 19:21:02 +0200 |
commit | 1e2527a6fede996a429bd44b30a15e76ee293437 (patch) | |
tree | 3cfdbc2314a6b3c26b63807e5575dac906734942 /src/libsystemd-network/sd-dhcp-server.c | |
parent | b826ab586c9e0a9c0d438a75c28cf3a8ab485929 (diff) |
hashmap: hash_funcs - make inputs unambiguous
Make sure all variable-length inputs are properly terminated or that
their length is encoded in some way. This avoids ambiguity of
adjacent inputs.
E.g., in case of a hash function taking two strings, compressing "ab"
followed by "c" is now distinct from "a" followed by "bc".
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-server.c')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-server.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index 4ea5a29e5c..d941e6c0de 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -117,6 +117,7 @@ void client_id_hash_func(const void *p, struct siphash *state) { assert(id->length); assert(id->data); + siphash24_compress(&id->length, sizeof(id->length), state); siphash24_compress(id->data, id->length, state); } |