提交 0899556e 编写于 作者: H Heikki Linnakangas

Fix access past end of string in date parsing.

This affects date_in(), and a couple of other funcions that use DecodeDate().

Hitoshi Harada
上级 dbdb2172
......@@ -2176,9 +2176,12 @@ DecodeDate(char *str, int fmask, int *tmask, bool *is2digits,
while (*str != '\0' && nf < MAXDATEFIELDS)
{
/* skip field separators */
while (!isalnum((unsigned char) *str))
while (*str != '\0' && !isalnum((unsigned char) *str))
str++;
if (*str == '\0')
return DTERR_BAD_FORMAT; /* end of string after separator */
field[nf] = str;
if (isdigit((unsigned char) *str))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册