1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

param: prevent an existing segmentation fault with setting [dos] charset

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Garming Sam 2014-03-06 09:03:30 +13:00 committed by Jeremy Allison
parent b64ac37936
commit 07f01b19c6

View File

@ -2465,7 +2465,7 @@ static void init_iconv(void)
static bool handle_charset(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
{
if (strcmp(*ptr, pszParmValue) != 0) {
if (*ptr == NULL || strcmp(*ptr, pszParmValue) != 0) {
string_set(Globals.ctx, ptr, pszParmValue);
init_iconv();
}
@ -2496,7 +2496,7 @@ static bool handle_dos_charset(struct loadparm_context *unused, int snum, const
}
}
if (strcmp(*ptr, pszParmValue) != 0) {
if (*ptr == NULL || strcmp(*ptr, pszParmValue) != 0) {
if (is_utf8) {
DEBUG(0,("ERROR: invalid DOS charset: 'dos charset' must not "
"be UTF8, using (default value) %s instead.\n",