mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-12 10:21:26 -04:00
In the Windows version of tun_finalize, on errors that would
return -1, set buf->len to 0 rather than -1. While downstream code is set up to consider the buffer invalidated if its length is <= 0, this change makes the code cleaner and safer. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3061 e7ae566f-a301-0410-adde-c780ea21d3b5
This commit is contained in:
parent
b29452f402
commit
4fb01ce0ba
1 changed files with 6 additions and 1 deletions
7
tun.c
7
tun.c
|
|
@ -2033,7 +2033,12 @@ tun_finalize (
|
|||
}
|
||||
|
||||
if (buf)
|
||||
buf->len = ret;
|
||||
{
|
||||
if (ret < 0)
|
||||
buf->len = 0;
|
||||
else
|
||||
buf->len = ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue