Zero packet buffers before building output, to reduce risk of information leakage.

This commit is contained in:
Simon Kelley
2016-07-22 20:56:01 +01:00
parent cd2ddb9904
commit fa78573778
8 changed files with 30 additions and 6 deletions

View File

@@ -29,9 +29,19 @@ void end_opt6(int container)
PUTSHORT(len, p);
}
void reset_counter(void)
{
/* Clear out buffer when starting from begining */
if (daemon->outpacket.iov_base)
memset(daemon->outpacket.iov_base, 0, daemon->outpacket.iov_len);
save_counter(0);
}
int save_counter(int newval)
{
int ret = outpacket_counter;
if (newval != -1)
outpacket_counter = newval;