mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
* src/support/unicode.C
(iconv_convert): Fix a crash: Don't try to create a vector from two pointers where end is before begin. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16408 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f4540ab1aa
commit
63524a4184
@ -203,6 +203,10 @@ iconv_convert(IconvProcessor & processor,
|
||||
char * outbuf = out;
|
||||
|
||||
int bytes = processor.convert(inbuf, inbytesleft, outbuf, outsize);
|
||||
if (bytes <= 0)
|
||||
// Conversion failed
|
||||
// FIXME Maybe throw an exception and handle that in the caller?
|
||||
return std::vector<RetType>();
|
||||
|
||||
RetType const * tmp = reinterpret_cast<RetType const *>(out);
|
||||
return std::vector<RetType>(tmp, tmp + bytes / sizeof(RetType));
|
||||
|
Loading…
Reference in New Issue
Block a user