#4320: Integer overflow in Poco::UTF32Encoding

This commit is contained in:
Günter Obiltschnig
2023-12-04 15:27:06 +01:00
parent 5c9217663e
commit 94418e5bc8
2 changed files with 30 additions and 21 deletions

View File

@@ -69,6 +69,15 @@ public:
int queryConvert(const unsigned char* bytes, int length) const;
int sequenceLength(const unsigned char* bytes, int length) const;
protected:
static int safeToInt(Poco::UInt32 value)
{
if (value <= 0x10FFFF)
return static_cast<int>(value);
else
return -1;
}
private:
bool _flipBytes;
static const char* _names[];