Skip to content

Commit 463d31f

Browse files
committed
msValidateTimeValue(): reject strings with single quote character to avoid potential SQL injections (#3907)
1 parent 4dacec0 commit 463d31f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

maptime.c

+4
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ int msValidateTimeValue(const char *timestring, const char *timeextent)
443443
if (!timestring || !timeextent)
444444
return MS_FALSE;
445445

446+
/* To avoid SQL injections */
447+
if (strchr(timestring, '\''))
448+
return MS_FALSE;
449+
446450
/* parse the time string. We support descrete times (eg 2004-09-21), */
447451
/* multiple times (2004-09-21, 2004-09-22, ...) */
448452
/* and range(s) (2004-09-21/2004-09-25, 2004-09-27/2004-09-29) */

0 commit comments

Comments
 (0)