summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Filip <feela@trubka.network.cz>2011-04-13 13:19:37 +0200
committerOndrej Filip <feela@trubka.network.cz>2011-04-13 13:19:37 +0200
commitd600909da9ef0a4b25052c1bf2de83d4e7628b0e (patch)
treeec24825f87e3acdf8c96681edbda26ba2273a690
parent71ca77169d5d3e67459e46841b8bdb95accd8c2a (diff)
downloadbird-d600909da9ef0a4b25052c1bf2de83d4e7628b0e.tar
bird-d600909da9ef0a4b25052c1bf2de83d4e7628b0e.zip
Fixed bug FICORA #503685.
-rw-r--r--proto/ospf/packet.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index 3cda384..d156474 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -312,6 +312,12 @@ ospf_rx_hook(sock *sk, int size)
}
int osize = ntohs(ps->length);
+ if ((unsigned) osize < sizeof(struct ospf_packet))
+ {
+ log(L_ERR "%s%I - too low value in size field (%u bytes)", mesg, sk->faddr, osize);
+ return 1;
+ }
+
if ((osize > size) || ((osize % 4) != 0))
{
log(L_ERR "%s%I - size field does not match (%d/%d)", mesg, sk->faddr, osize, size);