summaryrefslogtreecommitdiff
path: root/lib/util/charset/charset.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-18 14:06:13 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-18 14:18:41 +1100
commit55c45110e6994fe95867f4df3243c6829116e093 (patch)
tree246cee1b14d0ecf49bb8f105ee53b3d2e9eedf16 /lib/util/charset/charset.h
parent752b2206cbb411e98e88efcfd1df9876a79d4a3d (diff)
downloadsamba-55c45110e6994fe95867f4df3243c6829116e093.tar.gz
samba-55c45110e6994fe95867f4df3243c6829116e093.tar.bz2
samba-55c45110e6994fe95867f4df3243c6829116e093.zip
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.
Diffstat (limited to 'lib/util/charset/charset.h')
-rw-r--r--lib/util/charset/charset.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index 2c8aa41ad5..cc57b3eb54 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -163,10 +163,11 @@ codepoint_t tolower_m(codepoint_t val);
int codepoint_cmpi(codepoint_t c1, codepoint_t c2);
/* Iconv convenience functions */
-struct smb_iconv_convenience *smb_iconv_convenience_init(TALLOC_CTX *mem_ctx,
- const char *dos_charset,
- const char *unix_charset,
- bool native_iconv);
+struct smb_iconv_convenience *smb_iconv_convenience_reinit(TALLOC_CTX *mem_ctx,
+ const char *dos_charset,
+ const char *unix_charset,
+ bool native_iconv,
+ struct smb_iconv_convenience *old_ic);
bool convert_string_convenience(struct smb_iconv_convenience *ic,
charset_t from, charset_t to,