summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-24 06:24:14 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-24 06:24:14 +0000
commit79b5b1aebf9f59e4de19c9b52f473cfd06d1fd0c (patch)
tree164b85f381d7bd44f01b278623ed8409a517a8e7
parent1c29d9d8f060f5967fdff1ba04dfd982e5da61bb (diff)
downloadsamba-79b5b1aebf9f59e4de19c9b52f473cfd06d1fd0c.tar.gz
samba-79b5b1aebf9f59e4de19c9b52f473cfd06d1fd0c.tar.bz2
samba-79b5b1aebf9f59e4de19c9b52f473cfd06d1fd0c.zip
fixed a silly off by 1 bug
(This used to be commit e558ab6ac8930e3393291fe12289ad43175b8a1d)
-rw-r--r--source3/lib/charcnv.c3
-rw-r--r--source3/web/cgi.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index ebcceef816..0e7d5241f4 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -99,6 +99,9 @@ size_t convert_string(charset_t from, charset_t to,
static int initialised;
smb_iconv_t descriptor;
+ if (srclen == -1) srclen = strlen(src)+1;
+ if (destlen == -1) destlen = strlen(dest)+1;
+
if (!initialised) {
initialised = 1;
init_iconv();
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 7b12bf5748..939b8f94cd 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -221,13 +221,13 @@ void cgi_load_variables(void)
pstring dest;
convert_string(CH_DISPLAY, CH_UNIX,
- variables[i].name, strlen(variables[i].name),
+ variables[i].name, -1,
dest, sizeof(dest));
free(variables[i].name);
variables[i].name = strdup(dest);
convert_string(CH_DISPLAY, CH_UNIX,
- variables[i].value, strlen(variables[i].name),
+ variables[i].value, -1,
dest, sizeof(dest));
free(variables[i].value);
variables[i].value = strdup(dest);