lexeress / openvpn-auth-ldap

Automatically exported from code.google.com/p/openvpn-auth-ldap
Other
0 stars 0 forks source link

PATCH: fix assert() failure if config' file does not end in a LF #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a configuration file that lacks the trailing EOL character (LF)
2. src/testplugin this-testconfigfile-without-LF
3. see assert() abort the code with:

Assertion failed: (_limit - _cursor >= 0), function -[TRConfigLexer fill:], 
file TRConfigLexer.re, line 117.

Reference to FreeBSD bugtracker: 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190497

What is the expected output? What do you see instead?

The expected output is that the configuration is parsed properly.

What version of the product are you using? On what operating system?

SVN r1379, FreeBSD 9.3/10.1.

Please provide any additional information below.

The attached patch fixes this problem by simplifying EOI detection and making 
it robust (rather than relying on the sentinel character).

Note that TRLocalPacketFilter.m requires two #import statements:

#import "TRLog.h"
#import "xmalloc.h"

Original issue reported on code.google.com by matthias...@gmx.de on 19 Jan 2015 at 8:44

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by landon.j.fuller@gmail.com on 11 Feb 2015 at 9:41