Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23355e6

Browse files
committed
Fix access past end of string in date parsing.
This affects date_in(), and a couple of other funcions that use DecodeDate().Hitoshi Harada
1 parentfab2ae0 commit23355e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/utils/adt/datetime.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2165,9 +2165,12 @@ DecodeDate(char *str, int fmask, int *tmask, bool *is2digits,
21652165
while (*str!='\0'&&nf<MAXDATEFIELDS)
21662166
{
21672167
/* skip field separators */
2168-
while (!isalnum((unsignedchar)*str))
2168+
while (*str!='\0'&&!isalnum((unsignedchar)*str))
21692169
str++;
21702170

2171+
if (*str=='\0')
2172+
returnDTERR_BAD_FORMAT;/* end of string after separator */
2173+
21712174
field[nf]=str;
21722175
if (isdigit((unsignedchar)*str))
21732176
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp