Skip to content

Commit b8d9907

Browse files
Fixed a trailing garbage character being accepted after a special date/time expression (#9116)
1 parent 0a69bf8 commit b8d9907

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/common/cvt.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,15 @@ void CVT_string_to_datetime(const dsc* desc,
839839

840840
description[i] = SPECIAL;
841841

842-
while (++p < end)
842+
// Note: p points to the first character not consumed as a part of
843+
// the word, so it must be checked too.
844+
845+
while (p < end)
843846
{
844847
if (*p != ' ' && *p != '\t' && *p != '\0')
845848
CVT_conversion_error(desc, cb->err);
849+
850+
++p;
846851
}
847852

848853
// fetch the current datetime

0 commit comments

Comments
 (0)