mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
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.
This commit is contained in:
@ -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__ */
|
||||
|
Reference in New Issue
Block a user