Skip to content

Commit 2c763f4

Browse files
rouaultgithub-actions[bot]
authored andcommitted
loadProjection(): avoid write heap-bufer-overflow on invalid PROJECTION block
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52066
1 parent 8c6df8a commit 2c763f4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mapfile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,12 @@ static int loadProjection(projectionObj *p)
11721172
break;
11731173
case(MS_STRING):
11741174
case(MS_AUTO):
1175+
if( i == MS_MAXPROJARGS ) {
1176+
msSetError(MS_MISCERR, "Parsing error near (%s):(line %d): Too many arguments in projection string", "loadProjection()",
1177+
msyystring_buffer, msyylineno);
1178+
p->numargs = i;
1179+
return -1;
1180+
}
11751181
p->args[i] = msStrdup(msyystring_buffer);
11761182
p->automatic = MS_TRUE;
11771183
i++;

0 commit comments

Comments
 (0)