mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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 bb99cbf069
)
This commit is contained in:
parent
b93e9b50ab
commit
64485f8761
@ -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); */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user