secure: decrease a (stack allocated) buffer size
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 08:06:01 +0000 (10:06 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 08:52:49 +0000 (10:52 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/secure/src/olsrd_secure.c

index 1099519..07160d7 100644 (file)
@@ -555,7 +555,7 @@ send_challenge(struct interface *olsr_if, const union olsr_ip_addr *new_host)
   olsr_printf(3, "[ENC]Size: %lu\n", (unsigned long)sizeof(struct challengemsg));
 
   {
-    uint8_t checksum_cache[1512 + KEYLENGTH];
+    uint8_t checksum_cache[(sizeof(cmsg) - sizeof(cmsg.signature)) + KEYLENGTH];
     /* Create packet + key cache */
     /* First the OLSR packet + signature message - digest */
     memcpy(checksum_cache, &cmsg, sizeof(cmsg) - sizeof(cmsg.signature));