Fix saving of the config file in SWAT; [#5516].
authorAndreas Schneider <anschneider@suse.de>
Tue, 3 Jun 2008 13:05:50 +0000 (15:05 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 3 Jun 2008 13:35:41 +0000 (15:35 +0200)
The strlen of the source string passed to convert_string_allocate was too
short :)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit ac3597ef8b7781499ab55f1039670ec82202e32c)

source3/web/cgi.c

index 28f64f89adeaa7ff87dede2a6bedab7091899e96..070e80cf91df831c331c8dd3459090dded38796f 100644 (file)
@@ -206,14 +206,14 @@ void cgi_load_variables(void)
                size_t dest_len;
 
                convert_string_allocate(frame, CH_UTF8, CH_UNIX,
-                              variables[i].name, -1,
+                              variables[i].name, strlen(variables[i].name),
                               &dest, &dest_len, True);
                SAFE_FREE(variables[i].name);
                variables[i].name = SMB_STRDUP(dest ? dest : "");
 
                dest = NULL;
                convert_string_allocate(frame, CH_UTF8, CH_UNIX,
-                              variables[i].value, -1,
+                              variables[i].value, strlen(variables[i].value),
                               &dest, &dest_len, True);
                SAFE_FREE(variables[i].value);
                variables[i].value = SMB_STRDUP(dest ? dest : "");