From: Ondrej Zajicek Date: Sat, 21 Feb 2015 11:24:30 +0000 (+0100) Subject: Fixes potential alignment bug in BGP. X-Git-Tag: v1.5.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfc7a6c6a0758a1d9a13b94708228c9844efe97e;p=thirdparty%2Fbird.git Fixes potential alignment bug in BGP. Thanks to Andrew (seti.kr.ua) for the bug report. --- diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index a091ed1e4..72b45d478 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -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);