Skip to content
OpenVPN is an open source VPN daemon
C Shell M4 Makefile Perl Groff Other
Latest commit 600dd9a May 22, 2016 @selvanair selvanair committed with cron2 Fix handling of out of memory error in interactive service
Currently realloc failure in UpdateWaitHandles() is handled by
triggering exit_event and waiting for all active worker threads
to terminate. However, at this point the wait handles array
will contain an invalid value (handle of the latest thread that
is terminated), causing a cycle of WAIT_FAILED <-> continue and
trashing of the eventlog.

Fix:
- Update the wait handles again after removing the last thread:
  this should not fail as no extra memory is needed. Do not set
  the exit event; existing connections are not terminated.

- In case of WAIT_FAILED, break out of the while loop and exit
  instead of continue. This usually happens when one or more
  handles are invalid, which is hard to recover from.

Other changes:
- Use minimal initial allocation size so that the realloc code path
  gets exercised (2 or more connections will cause realloc).
- Use a temp variable to check the return value of realloc().
- Initialize handles array pointer to NULL.

v2 changes:
- Increased initial allocation to 10 (warn: now 10 or more connections
  needed to exercise the realloc code path).
- Moved up the declaration of "LPHANDLE tmp" to please stone-age MSVC.

Tested using a dummy realloc that returns NULL.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1463942372-26958-1-git-send-email-selva.nair@gmail.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11708
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Failed to load latest commit information.
build Generate openvpn-plugin.h for MSVC build Oct 22, 2015
contrib Fix OCSP_check.sh Feb 25, 2016
debug build: standard directory layout Mar 22, 2012
distro Include systemd units in the source tarball (make dist) Dec 2, 2014
doc Push an IPv6 CIDR mask used by the server, not the pool's size May 18, 2016
include Add support for register-dns through interactive service May 16, 2016
m4 build: ax_varargs.m4: fixups Mar 26, 2012
sample sample-plugin: TLS Keying Material Exporter [RFC-5705] demonstration … Oct 10, 2015
src Fix handling of out of memory error in interactive service May 22, 2016
tests Prevent integration test timeout bc. of sudo May 9, 2016
.gitattributes cleanup: add .gitattributes to control eol style explicitly Apr 26, 2012
.gitignore ignore the local config file t_client.rc in git May 1, 2016
.mailmap Added mapping files from SVN commit ID to more descriptive commit IDs. Oct 21, 2010
.svncommitters Added mapping files from SVN commit ID to more descriptive commit IDs. Oct 21, 2010
AUTHORS Renamed branch to reflect that it is no longer beta. Mar 17, 2011
CONTRIBUTING.rst Update CONTRIBUTING.rst to allow GitHub PRs for code review purposes May 19, 2016
COPYING Renamed branch to reflect that it is no longer beta. Mar 17, 2011
COPYRIGHT.GPL Renamed branch to reflect that it is no longer beta. Mar 17, 2011
ChangeLog Preparing for v2.3_beta1 Sep 12, 2012
Changes.rst Implement push-remove option to selectively remove pushed options. May 16, 2016
INSTALL configure.ac: simplify crypto library configuration Jan 16, 2016
INSTALL-win32.txt Added cross-compilation information INSTALL-win32.txt Feb 3, 2013
Makefile.am Minor t_client.sh cleanups Apr 21, 2014
NEWS Renamed branch to reflect that it is no longer beta. Mar 17, 2011
PORTS Renamed branch to reflect that it is no longer beta. Mar 17, 2011
README Updated README Feb 3, 2013
README.IPv6 Update IPv6 related readme files Jan 3, 2014
README.ec Add support for elliptic curve diffie-hellmann key exchange (ECDH) Apr 25, 2014
README.polarssl Update README.polarssl Jun 24, 2014
TODO.IPv6 Update IPv6 related readme files Jan 3, 2014
compat.m4 build: add git revision to --version output if build from git repository Jun 1, 2012
config-msvc-version.h.in build: win-msvc: msbuild format Mar 22, 2012
config-msvc.h Add lz4 support to MSVC. Feb 26, 2016
configure.ac Fix library order in -lmbedtls test. May 5, 2016
msvc-build.bat build: msvc: chdir with change drive to script location Jun 29, 2012
msvc-dev.bat build: msvc: chdir with change drive to script location Jun 29, 2012
msvc-env.bat Continuation of MSVS fixes Oct 6, 2015
openvpn.sln build: msvc: upgrade to Visual Studio 2010 + fixups Mar 29, 2012
version.m4 Provide compile time OpenVPN version information to plug-ins Jul 27, 2015
version.sh.in build: windows: install version.sh to allow installer read version Mar 24, 2012

README

OpenVPN -- A Secure tunneling daemon

Copyright (C) 2002-2010 OpenVPN Technologies, Inc. This program is free software;
you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.

*************************************************************************

For the latest version of OpenVPN, go to:

	http://openvpn.net/

To Build and Install,

	./configure
	make
	make install

or see the file INSTALL for more info.

*************************************************************************

For detailed information on OpenVPN, including examples, see the man page
  http://openvpn.net/man.html

For a sample VPN configuration, see
  http://openvpn.net/howto.html

For a description of OpenVPN's underlying protocol,
  see the file ssl.h included in the source distribution.

*************************************************************************

Other Files & Directories:

* INSTALL-win32.txt -- installation instructions
  for Windows

* configure.ac -- script to rebuild our configure
  script and makefile.

* sample/sample-scripts/verify-cn

  A sample perl script which can be used with OpenVPN's
  --tls-verify option to provide a customized authentication
  test on embedded X509 certificate fields.

* sample/sample-keys/

  Sample RSA keys and certificates.  DON'T USE THESE FILES
  FOR ANYTHING OTHER THAN TESTING BECAUSE THEY ARE TOTALLY INSECURE.

* sample/sample-config-files/

  A collection of OpenVPN config files and scripts from
  the HOWTO at http://openvpn.net/howto.html

*************************************************************************

Note that easy-rsa and tap-windows are now maintained in their own subprojects.
Their source code is available here:

  https://github.com/OpenVPN/easy-rsa
  https://github.com/OpenVPN/tap-windows

The old cross-compilation environment (domake-win) and the Python-based
buildsystem have been replaced with openvpn-build:

  https://github.com/OpenVPN/openvpn-build

See the INSTALL file for usage information.
Something went wrong with that request. Please try again.