summaryrefslogtreecommitdiff
path: root/pidl/tests
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 /pidl/tests
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 'pidl/tests')
-rwxr-xr-xpidl/tests/ndr_string.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/pidl/tests/ndr_string.pl b/pidl/tests/ndr_string.pl
index 7b76c7b295..e00dd01c8e 100755
--- a/pidl/tests/ndr_string.pl
+++ b/pidl/tests/ndr_string.pl
@@ -15,7 +15,7 @@ test_samba4_ndr("string-pull-empty",
uint8_t data[] = { 0x00, 0x00, 0x00, 0x00 };
DATA_BLOB b = { data, 4 };
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
- smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+ smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
struct TestString r;
r.in.data = NULL;
@@ -38,7 +38,7 @@ test_samba4_ndr("string-ascii-pull",
\'f\', \'o\', \'o\', 0 };
DATA_BLOB b = { data, 8 };
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
- smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+ smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
struct TestString r;
r.in.data = NULL;
@@ -75,7 +75,7 @@ test_samba4_ndr("string-wchar-fixed-array-01",
};
DATA_BLOB b = { data, sizeof(data) };
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
- smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+ smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
struct TestString r;
struct TestStringStruct str;
r.in.str = &str;
@@ -121,7 +121,7 @@ test_samba4_ndr("string-wchar-fixed-array-02",
};
DATA_BLOB b = { data, sizeof(data) };
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
- smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+ smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
struct TestString r;
struct TestStringStruct str;
r.in.str = &str;
@@ -153,7 +153,7 @@ test_samba4_ndr("string-wchar-fixed-array-03",
};
DATA_BLOB b = { data, sizeof(data) };
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
- smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+ smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
struct TestString r;
struct TestStringStruct str;
r.in.str = &str;
@@ -175,7 +175,7 @@ test_samba4_ndr("string-out",
\'f\', \'o\', \'o\', 0 };
DATA_BLOB b = { data, 8 };
struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL,
- smb_iconv_convenience_init(NULL, "ASCII", "UTF8", true));
+ smb_iconv_convenience_reinit(NULL, "ASCII", "UTF8", true, NULL));
struct TestString r;
char *str = NULL;
r.out.data = &str;