]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes potential alignment bug in BGP.
authorOndrej Zajicek <santiago@crfreenet.org>
Sat, 21 Feb 2015 11:24:30 +0000 (12:24 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sat, 21 Feb 2015 11:24:30 +0000 (12:24 +0100)
Thanks to Andrew (seti.kr.ua) for the bug report.

proto/bgp/attrs.c

index a091ed1e4013f2fd96f73373fbe748e42e9cc0d5..72b45d478e4f46178cce45bf9f651e9f89f3baea 100644 (file)
@@ -717,7 +717,7 @@ bgp_new_bucket(struct bgp_proto *p, ea_list *new, unsigned hash)
   struct bgp_bucket *b;
   unsigned ea_size = sizeof(ea_list) + new->count * sizeof(eattr);
   unsigned ea_size_aligned = BIRD_ALIGN(ea_size, CPU_STRUCT_ALIGN);
-  unsigned size = sizeof(struct bgp_bucket) + ea_size;
+  unsigned size = sizeof(struct bgp_bucket) + ea_size_aligned;
   unsigned i;
   byte *dest;
   unsigned index = hash & (p->hash_size - 1);