summaryrefslogtreecommitdiff
path: root/source4/scripting
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 /source4/scripting
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 'source4/scripting')
-rw-r--r--source4/scripting/python/modules.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/scripting/python/modules.h b/source4/scripting/python/modules.h
index 4d1067cdd4..c73cfff19c 100644
--- a/source4/scripting/python/modules.h
+++ b/source4/scripting/python/modules.h
@@ -23,6 +23,7 @@
void py_load_samba_modules(void);
bool py_update_path(const char *bindir);
-#define py_iconv_convenience(mem_ctx) smb_iconv_convenience_init(mem_ctx, "ASCII", PyUnicode_GetDefaultEncoding(), true)
+#define py_iconv_convenience(mem_ctx) smb_iconv_convenience_reinit(mem_ctx, "ASCII", \
+ PyUnicode_GetDefaultEncoding(), true, NULL)
#endif /* __SAMBA_PYTHON_MODULES_H__ */