Skip to content

Commit 6e31630

Browse files
committed
fix buffer overrun protection
1 parent 3de0ef7 commit 6e31630

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Marine/Message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ namespace AIS
297297

298298
bool Message::setUint(int start, int len, unsigned val)
299299
{
300-
if (length >= MAX_AIS_LENGTH)
300+
if (start + len >= MAX_AIS_LENGTH)
301301
return false;
302302

303303
int x = start >> 3, y = start & 7;

0 commit comments

Comments
 (0)