charset: fixed a problem with the global use of the iconv_convenience structure
authorAndrew Tridgell <tridge@samba.org>
Thu, 18 Mar 2010 03:06:13 +0000 (14:06 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 18 Mar 2010 03:18:41 +0000 (14:18 +1100)
commit55c45110e6994fe95867f4df3243c6829116e093
tree246cee1b14d0ecf49bb8f105ee53b3d2e9eedf16
parent752b2206cbb411e98e88efcfd1df9876a79d4a3d
charset: fixed a problem with the global use of the iconv_convenience structure

We had a crash bug where a cached copy of a iconv convenience pointer
was used after being freed when loadparm asked for iconv to
reload. This could happen if a python module used a iconv based
function before loadparm was completed.

The fix is to ensure that any use of this pointer remains valid, by
reusing the pointer itself when it has already been initialised, but
filling in the child elements with the updated values.
lib/util/charset/charcnv.c
lib/util/charset/charset.h
lib/util/charset/util_unistr.c
librpc/ndr/ndr.c
pidl/tests/ndr_string.pl
source4/param/loadparm.c
source4/param/param.h
source4/param/util.c
source4/scripting/python/modules.h