Input buffer size.
This commit is contained in:
parent
344d96539d
commit
e51fb0c931
@ -29,6 +29,7 @@ extern "C"
|
|||||||
#ifndef VMIME_BUILDING_DOC
|
#ifndef VMIME_BUILDING_DOC
|
||||||
|
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
// HACK: prototypes may differ depending on the compiler and/or system (the
|
// HACK: prototypes may differ depending on the compiler and/or system (the
|
||||||
// second parameter may or may not be 'const'). This redeclaration is a hack
|
// second parameter may or may not be 'const'). This redeclaration is a hack
|
||||||
@ -103,7 +104,7 @@ void charset::convert(utility::inputStream& in, utility::outputStream& out,
|
|||||||
|
|
||||||
if (cd != reinterpret_cast <iconv_t>(-1))
|
if (cd != reinterpret_cast <iconv_t>(-1))
|
||||||
{
|
{
|
||||||
char inBuffer[5];
|
char inBuffer[32768];
|
||||||
char outBuffer[32768];
|
char outBuffer[32768];
|
||||||
size_t inPos = 0;
|
size_t inPos = 0;
|
||||||
|
|
||||||
@ -146,7 +147,8 @@ void charset::convert(utility::inputStream& in, utility::outputStream& out,
|
|||||||
std::copy(const_cast <char*>(inPtr), inBuffer + sizeof(inBuffer), inBuffer);
|
std::copy(const_cast <char*>(inPtr), inBuffer + sizeof(inBuffer), inBuffer);
|
||||||
inPos = inLength;
|
inPos = inLength;
|
||||||
|
|
||||||
prevIsInvalid = true;
|
if (errno != E2BIG)
|
||||||
|
prevIsInvalid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user