s3:registry: fix the test for a REG_SZ blob possibly being a zero terminated ucs2...
commit83006b7b3fddcfbe3a49d257e79c71739c7011ae
authorMichael Adam <obnox@samba.org>
Thu, 29 Sep 2011 16:06:56 +0000 (29 18:06 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 23 Jan 2012 20:25:48 +0000 (23 21:25 +0100)
treebced5e5a6f21012bd49acf2bdd8d7f3e1ca464da
parent1185167c3f4c5fb59de704c307f79c26efa4ce95
s3:registry: fix the test for a REG_SZ blob possibly being a zero terminated ucs2 string

1. catch data blobs with odd number of bytes (not an ucs2 string at all)
2. test the right ucs2 character to be 0
   (prevent out-of bounds access/potential segfault)

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sun Oct  2 01:26:05 CEST 2011 on sn-devel-104
(cherry picked from commit 95bb2c23e6e9c52a1e34916dff05b1d306278bc6)

The last 2 patches address bug #8528 (SEGFAULT from net registry export on not
zero terminated REG_SZ values).
(cherry picked from commit bc3af75ec9841753b5bfbcd04d9a412f7ee5c4b5)
source3/registry/reg_format.c