oLschema2ldif: Resolve multiple parsing bugs
authorMichael Hanselmann <public@hansmi.ch>
Wed, 27 Mar 2019 19:17:08 +0000 (20:17 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Apr 2019 02:43:07 +0000 (02:43 +0000)
commit29d7c80ee4d78e1dbdd506770a9cb7b34afa0ed0
tree4921f9ad6bd67165764c4b45ef58ce5685d63aae
parent4ae2fb2e7403191296f7c74f3098fbe121f0796a
oLschema2ldif: Resolve multiple parsing bugs

The "oLschema2ldif" program contained multiple bugs triggered by
malformed inputs:

* Iteration beyond list of recognized dsdb syntax OIDs when value wasn't
  found (bug 9567)
* NULL pointer dereference when input didn't define a name
* Heap buffer overflows for unterminated token values

Tests are added to reproduce all identified bugs.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9567

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Then adapted to use ARRAY_SIZE() consistently as suggested by
metze.

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Apr  3 02:43:07 UTC 2019 on sn-devel-144
selftest/tests.py
source4/dsdb/schema/schema_syntax.c
source4/utils/oLschema2ldif/lib.c
source4/utils/oLschema2ldif/test.c [new file with mode: 0644]
source4/utils/oLschema2ldif/wscript_build