GHSL-2023-112: check if the current pointer and the next one are less than the end
This commit is contained in:
parent
02dd1d36fc
commit
5687c4f43c
|
@ -152,7 +152,7 @@ size_t Utf8_16_Read::convert(char* buf, size_t len)
|
|||
case uni16LE_NoBOM:
|
||||
case uni16BE:
|
||||
case uni16LE: {
|
||||
size_t newSize = len + len / 2 + 1;
|
||||
size_t newSize = (len + len % 2) + (len + len % 2) / 2;
|
||||
|
||||
if (m_nAllocatedBufSize != newSize)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
bool get(utf8 *c);
|
||||
void operator++();
|
||||
eState getState() { return m_eState; };
|
||||
operator bool() { return (m_pRead < m_pEnd) || (m_out1st != m_outLst); };
|
||||
operator bool() { return (m_pRead + 1 < m_pEnd) || (m_out1st != m_outLst); };
|
||||
|
||||
protected:
|
||||
void read();
|
||||
|
|
Loading…
Reference in New Issue