threerings / openvpn-auth-ldap

Implements username/password authentication via LDAP for OpenVPN 2.x.
Other
135 stars 63 forks source link

Poor config error handling results in Bus Error #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create config file with no new line after last line
2. run openvpn or testplugin
3. watch it bus error

What is the expected output? What do you see instead?
An error message indicating a configuration problem. Instead only a bus error.

What version of the product are you using? On what operating system?
2.0.3 on OS X 10.5.5

Please provide any additional information below.

GDB output:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
-[LFAuthLDAPConfig startSection:sectionName:] (self=0x100710, _cmd=0xc42c, 
sectionType=0x101600, name=0x0) at LFAuthLDAPConfig.m:531
531             switch (opcodeEntry->opcode) {

( Line numbers are slightly off because I added some debug code to my tree )

Reason for crash:
Without a new line, the parser is picking up /Authorization as a new config 
section. Calls to 
parse_opcode will then fail and return a null pointer, which is accessed in the 
switch statement 
further down.

Possible Resolution:
Check or opcodeEntry == NULL or throw an exception on NULL from method 
parse_opcode (TRConfigToken *token, OpcodeTable **tables) in LFAuthLDAPConfig.m

Original issue reported on code.google.com by m...@joemattiello.com on 30 Dec 2008 at 7:55

GoogleCodeExporter commented 9 years ago

Original comment by landon.j.fuller@gmail.com on 30 Dec 2008 at 8:03

GoogleCodeExporter commented 9 years ago
Fixed in trunk in r1319, r1320, r1321

Original comment by landon.j.fuller@gmail.com on 30 Dec 2008 at 9:11