mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Prevent under/over flow of float8 constants in parser. Small regression fix.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.9 1997/02/14 04:15:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.10 1997/02/19 20:10:38 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -20,6 +20,7 @@
|
||||
#include <stdlib.h>
|
||||
#endif /* __linux__ */
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "miscadmin.h"
|
||||
@ -30,6 +31,7 @@
|
||||
#include "parser/scansup.h"
|
||||
#include "parser/sysfunc.h"
|
||||
#include "parse.h"
|
||||
#include "utils/builtins.h"
|
||||
|
||||
extern char *parseString;
|
||||
extern char *parseCh;
|
||||
@ -109,8 +111,13 @@ other .
|
||||
return (ICONST);
|
||||
}
|
||||
{real} {
|
||||
yylval.dval = atof((char*)yytext);
|
||||
return (FCONST);
|
||||
char* endptr;
|
||||
errno = 0;
|
||||
yylval.dval = strtod(((char *)yytext),&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"\tBad float8 input format\n");
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
{quote} {
|
||||
char literal[MAX_PARSE_BUFFER];
|
||||
|
Reference in New Issue
Block a user