summaryrefslogtreecommitdiff
path: root/source4/lib/charset
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-04-04 02:01:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:00:13 -0500
commit64485f876152f27fb8052c7a1adc0c96f96a5009 (patch)
treebcca0d6673359b392a2c5452e2dfb0dfb788fae2 /source4/lib/charset
parentb93e9b50ab6ef145d9bb1841b71625cf03a56a15 (diff)
downloadsamba-64485f876152f27fb8052c7a1adc0c96f96a5009.tar.gz
samba-64485f876152f27fb8052c7a1adc0c96f96a5009.tar.bz2
samba-64485f876152f27fb8052c7a1adc0c96f96a5009.zip
r14902: change charcnv code to fail the conversion when it hits bad
characters, rather than silently truncating the string. This makes the code much omre conservative, making it easier to test. It might mean users hit problems initially, but at least we'll hear about them, and thus can fix them. (This used to be commit bb99cbf069db5ab09ecf6c55e4c87d4c28ea8169)
Diffstat (limited to 'source4/lib/charset')
-rw-r--r--source4/lib/charset/charcnv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/charset/charcnv.c b/source4/lib/charset/charcnv.c
index 3ee8adf772..d1d4561fa5 100644
--- a/source4/lib/charset/charcnv.c
+++ b/source4/lib/charset/charcnv.c
@@ -168,7 +168,7 @@ _PUBLIC_ ssize_t convert_string(charset_t from, charset_t to,
switch(errno) {
case EINVAL:
reason="Incomplete multibyte sequence";
- break;
+ return -1;
case E2BIG:
reason="No more room";
if (from == CH_UNIX) {
@@ -181,10 +181,10 @@ _PUBLIC_ ssize_t convert_string(charset_t from, charset_t to,
charset_name(from), charset_name(to),
(int)srclen, (int)destlen));
}
- break;
+ return -1;
case EILSEQ:
reason="Illegal multibyte sequence";
- break;
+ return -1;
}
/* smb_panic(reason); */
}