s3:registry: fix invalid write in iconvert_talloc()
commit0c6a823f1920629e7366c1814df0e97424a346ec
authorMichael Adam <obnox@samba.org>
Fri, 4 Mar 2011 22:53:44 +0000 (4 23:53 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 7 Mar 2011 14:26:04 +0000 (7 15:26 +0100)
tree8aa290cf6ee9311b1c1f4696347c730591a7d8de
parent46cae09a39be98bee77345afd0adbf62621421f5
s3:registry: fix invalid write in iconvert_talloc()

For a non-preallocated dest-string and sourcestring of len < 2,
(one or both of the) final two two zero-bytes would be written
after the end of the allocated dest-string. The sourcelen did
not include the source string terminator. For longer strings,
this was not a problem because the dest-string would have been
reallocated in the convert-loop. This is fixed now by allocating
two extra bytes for the terminating 0-bytes that are needed anyways
in the initial allocation.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
source3/registry/reg_parse_internal.c