Fix alignment of hash buffer in dhcpv6_response_is_valid
authorBen Hutchings <ben@decadent.org.uk>
Thu, 28 Jan 2016 02:18:51 +0000 (02:18 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 28 Jan 2016 15:48:22 +0000 (15:48 +0000)
md5_final() writes to the hash buffer in 32-bit chunks, so it needs
to be 32-bit aligned.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
src/dhcpv6.c

index cbf6991..f91f2cf 100644 (file)
@@ -702,7 +702,8 @@ static bool dhcpv6_response_is_valid(const void *buf, ssize_t len,
                                continue;
 
                        md5_ctx_t md5;
-                       uint8_t serverhash[16], secretbytes[64], hash[16];
+                       uint8_t serverhash[16], secretbytes[64];
+                       uint32_t hash[4];
                        memcpy(serverhash, r->key, sizeof(serverhash));
                        memset(r->key, 0, sizeof(r->key));