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

index b874f5a..8588cca 100644 (file)
@@ -934,7 +934,7 @@ send_cres(struct interface *olsr_if, union olsr_ip_addr *to, union olsr_ip_addr
   /* Now create the digest of the message and the key */
 
   {
-    uint8_t checksum_cache[1512 + KEYLENGTH];
+    uint8_t checksum_cache[(sizeof(crmsg) - sizeof(crmsg.signature)) + KEYLENGTH];
     /* Create packet + key cache */
     /* First the OLSR packet + signature message - digest */
     memcpy(checksum_cache, &crmsg, sizeof(crmsg) - sizeof(crmsg.signature));