Skip to content

Commit 3a10f6b

Browse files
rouaulttbonfort
authored andcommitted
Fix potential SQL Injection with postgis TIME filters (#4834)
1 parent e83a0cb commit 3a10f6b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mappostgis.c

+5
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,11 @@ int msPostGISLayerSetTimeFilter(layerObj *lp, const char *timestring, const char
32123212
if (!lp || !timestring || !timefield)
32133213
return MS_FALSE;
32143214

3215+
if( strchr(timestring,'\'') || strchr(timestring, '\\') ) {
3216+
msSetError(MS_MISCERR, "Invalid time filter.", "msPostGISLayerSetTimeFilter()");
3217+
return MS_FALSE;
3218+
}
3219+
32153220
/* discrete time */
32163221
if (strstr(timestring, ",") == NULL &&
32173222
strstr(timestring, "/") == NULL) { /* discrete time */

0 commit comments

Comments
 (0)