1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Allow for lower-case "nan" to mean NaN in JSON.

FossilOrigin-Name: 6bee0a19e2efb6e39097fb22602556791d3d3962c50a1a0471c39a0c61db632e
This commit is contained in:
drh
2023-05-02 17:33:34 +00:00
parent d6b3a02d21
commit bdb40cb18f
3 changed files with 14 additions and 15 deletions

View File

@@ -1271,14 +1271,6 @@ json_parse_restart:
jsonParseAddNode(pParse, JSON_STRING | (jnFlags<<8), j+1-i, &z[i]);
return j+1;
}
case 'n': {
if( strncmp(z+i,"null",4)==0 && !sqlite3Isalnum(z[i+4]) ){
jsonParseAddNode(pParse, JSON_NULL, 0, 0);
return i+4;
}
pParse->iErr = i;
return -1;
}
case 't': {
if( strncmp(z+i,"true",4)==0 && !sqlite3Isalnum(z[i+4]) ){
jsonParseAddNode(pParse, JSON_TRUE, 0, 0);
@@ -1479,6 +1471,13 @@ json_parse_restart:
pParse->iErr = i;
return -1;
}
case 'n': {
if( strncmp(z+i,"null",4)==0 && !sqlite3Isalnum(z[i+4]) ){
jsonParseAddNode(pParse, JSON_NULL, 0, 0);
return i+4;
}
/* fall-through into the default case that checks for NaN */
}
default: {
u32 k;
int nn;