Bug in gwlib/charset.c: int charset_convert(Octstr *string, char *charset_from, char *charset_to)
"Pommnitz, Jörg" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi List, the above mentioned function seems buggy to me. It takes the result of the iconv operation and uses octstr_append_cstr(string, to_buf); to replace the old contents with the new one. This can't possibly work when you convert to say UTF-16 with zero-bytes in the middle of the result (quite likely). I don't have a patch, but the right solution would probably be to use octstr_append_data(string, to_buf, pointer - to_buf); instead of octstr_append_cstr(string, to_buf); Regards Joerg