Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions runtime/C/src/antlr3inputstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ antlr3UTF32LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la)

input = ((pANTLR3_INPUT_STREAM) (is->super));

if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf))
if (( (pANTLR3_UINT8)((pANTLR3_UINT32)input->nextChar + la - 1) + sizeof(ANTLR3_UINT32)) > (((pANTLR3_UINT8)input->data) + input->sizeBuf))
{
return ANTLR3_CHARSTREAM_EOF;
}
Expand All @@ -1701,7 +1701,7 @@ antlr3UTF32LALE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la)

input = ((pANTLR3_INPUT_STREAM) (is->super));

if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf))
if (( (pANTLR3_UINT8)((pANTLR3_UINT32)input->nextChar + la - 1) + sizeof(ANTLR3_UINT32)) > (((pANTLR3_UINT8)input->data) + input->sizeBuf))
{
return ANTLR3_CHARSTREAM_EOF;
}
Expand Down Expand Up @@ -1732,7 +1732,7 @@ antlr3UTF32LABE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la)

input = ((pANTLR3_INPUT_STREAM) (is->super));

if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf))
if (( (pANTLR3_UINT8)((pANTLR3_UINT32)input->nextChar + la - 1) + sizeof(ANTLR3_UINT32)) > (((pANTLR3_UINT8)input->data) + input->sizeBuf))
{
return ANTLR3_CHARSTREAM_EOF;
}
Expand Down