From: Ian Jackson Date: Thu, 25 Jul 2013 17:30:53 +0000 (+0100) Subject: udp.c: call buffer_init X-Git-Tag: debian/0.3.0_beta2~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=6af9a9842664ba88d89a67b300c1b0970bcf43ee;ds=sidebyside udp.c: call buffer_init Nothing in udp.c call buffer_init. This might result in start padding underflows (assertion failures) if packets come in via routes that don't strip (much) off the front and then go out via routes that do add lots at the front. Signed-off-by: Ian Jackson --- diff --git a/udp.c b/udp.c index 42fbb1f..1e637b6 100644 --- a/udp.c +++ b/udp.c @@ -102,6 +102,7 @@ static void udp_afterpoll(void *state, struct pollfd *fds, int nfds) fromlen=sizeof(from); BUF_ASSERT_FREE(st->rbuf); BUF_ALLOC(st->rbuf,"udp_afterpoll"); + buffer_init(st->rbuf,calculate_max_start_pad()); rv=recvfrom(st->fd, st->rbuf->start, st->rbuf->len, 0, (struct sockaddr *)&from, &fromlen); if (rv>0) {