Fix crash with crafted ini files.

If the key or value is bigger than 1024 we will end up in a buffer
overflow. The overflow is caught by _FORTIFY_SOURCE, so it's definitely
DoS-only.  Curiously, because of ample space in the stack frame, it does
not result in a crash without _FORTIFY_SOURCE in all cases.

Signed-off-by: Andreas Schneider <asn@samba.org>
Merge pull request #35 from gladiac/master

Fix crash with crafted ini files.
modify iniparser to build unbounded keys & values from multi-line input

Instead of a size limit of ASCIILINESZ for multi-line input now there is no
limit, a multi-line can be *any* size (and hence the key and value now
also have a dynamic size)

* there is a limit still on input line size (since multi lines are built
  from multiple lines where each line part is limited to ASCIILINESZ)
  Note: there is no limit to the size of the multi-line itself (it's
  only limited by available memory)
* all stack & static fixed string usage has been removed with the exception
  of parsing line (or a multi-line portion) input, fgets still reads into
  a fixed string buffer of size ASCIILINESZ.

Signed-off-by: Noel Power <noel.power@suse.com>
Merge pull request #37 from noelpower/dynamic_string_alloc_v2

modify iniparser to build unbounded keys & values from multi-line input
modify iniparser to build unbounded keys & values from multi-line input

Instead of a size limit of ASCIILINESZ for multi-line input now there is no
limit, a multi-line can be *any* size (and hence the key and value now
also have a dynamic size)

* there is a limit still on input line size (since multi lines are built
  from multiple lines where each line part is limited to ASCIILINESZ)
  Note: there is no limit to the size of the multi-line itself (it's
  only limited by available memory)
* all stack & static fixed string usage has been removed with the exception
  of parsing line (or a multi-line portion) input, fgets still reads into
  a fixed string buffer of size ASCIILINESZ.

Signed-off-by: Noel Power <noel.power@suse.com>
Merge remote-tracking branch 'upstream/master'
fix CID #1169705 (dereference before null check)

Signed-off-by: Noel Power <noel.power@suse.com>
fix CID #1169706 Resource leak (section)

Signed-off-by: Noel Power <noel.power@suse.com>
fix CID #1169707 resource leak (full_line/prev_line)

Signed-off-by: Noel Power <noel.power@suse.com>
CID #1169708 & CID #1169709 fix resource leak (value & line)

Signed-off-by: Noel Power <noel.power@suse.com>
fix CID #1169710 fix resource leak (keym)

Signed-off-by: Noel Power <noel.power@suse.com>
CID #1169711 deref after null check (introduced while fixing other CID)

Signed-off-by: Noel Power <noel.power@suse.com>
remove stray temporary debug flags in Makefile
Added -std=c99
Merge pull request #38 from noelpower/fix_coverity_issues

Fix coverity issues
use cmake for build