Merge pull request #1317 from donaldsharp/babel_mem

babeld: Do not copy beyond end of data
This commit is contained in:
Renato Westphal 2017-10-11 11:16:17 -03:00 committed by GitHub
commit 73842a0596
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ struct babel_interface {
char have_buffered_id; char have_buffered_id;
char have_buffered_nh; char have_buffered_nh;
char have_buffered_prefix; char have_buffered_prefix;
unsigned char buffered_id[16]; unsigned char buffered_id[8];
unsigned char buffered_nh[4]; unsigned char buffered_nh[4];
unsigned char buffered_prefix[16]; unsigned char buffered_prefix[16];
unsigned char *sendbuf; unsigned char *sendbuf;

View File

@ -1080,7 +1080,7 @@ really_send_update(struct interface *ifp,
accumulate_bytes(ifp, id, 8); accumulate_bytes(ifp, id, 8);
end_message(ifp, MESSAGE_ROUTER_ID, 10); end_message(ifp, MESSAGE_ROUTER_ID, 10);
} }
memcpy(babel_ifp->buffered_id, id, 16); memcpy(babel_ifp->buffered_id, id, sizeof(babel_ifp->buffered_id));
babel_ifp->have_buffered_id = 1; babel_ifp->have_buffered_id = 1;
} }