-C Prevent\soverly\slong\sJSON\spaths\sfrom\susing\stoo\smuch\sstack\sspace.
-D 2026-03-24T19:26:05.509
+C Extra\sargument\sto\ssqlite3_atof()\sis\sreturned\sif\sthe\sinput\sstring\sis\snot\nperfectly\swell-formed.
+D 2026-03-25T16:13:10.641
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/dbpage.c c9ea81c11727f27e02874611e92773e68e2a90a875ef2404b084564c235fd91f
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
F src/delete.c 1f2268d6fe3c78fc1bf794ba65d7026498b78e2342ffaf85825dedae546e6fde
-F src/expr.c b135746c5aaa80ec13225bfe3e5e46ad74377a7cea46630c1dab6b0409729fab
+F src/expr.c a277b38ed6b614b25b2bd04792b109b39b4d72f58520fdb3f3614d2ba5122dc4
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 931f74cec1dc8038a0217ef340c91ce147dd1bbed08dc40c47ee0ec6edfffb08
F src/func.c 6e7de3551ae0f8205006e5109f025223246edd20186d54d90746dee7c1c5c093
F src/prepare.c f6a6e28a281bd1d1da12f47d370a81af46159b40f73bf7fa0b276b664f9c8b7d
F src/printf.c 9cff219dba73b1aa9a8113e83e962f03f7bea8b6eb51cefb25bc468d5a69fb2d
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
-F src/resolve.c f0834917f2b1719d545a0d7eaad693283788f68ecd99871a81c7ff3b12b26209
+F src/resolve.c 635f215ca4bf3236ba22f9b375a7d819cf6097bafbb6dcd0b5c5cb25e455d5a6
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c ffe199f025a0dd74670d2a77232bdea364a4d7b36f32c64a6572d39ba6a11576
-F src/shell.c.in 38f05b2dde7e1de21d5499bdf6cad979a51e277c0b268997d40f5054d53a2236
-F src/sqlite.h.in b2b7d9ee568cc28fb659dff932881a3b00043b25d7463dbfc26bcb91d70ad2c3
+F src/shell.c.in f52bb3d92d623765fc85b195ef34af30fdf4cac58e646b39a3c38cac975fc364
+F src/sqlite.h.in fa62817969e039fc41821e77d1de6d6614f55594f778a818a8ee79cc0a1775d3
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
-F src/sqlite3ext.h 5d48df11327acaabc45690a1957f0f4643e07afd9f77c5f2326115239fe5a3bc
+F src/sqlite3ext.h b085f71f6b5d610e0b9c45ef2752894598c7e2a67b2f5558c9ec82442ef592ca
F src/sqliteInt.h 9716721fb57e32938a1d30a84560ce7633c63860a2209e188c87afad15d4b464
F src/sqliteLimit.h 904a3f520362c7065c18165aaabd504fb13cc1b76cb411f38bd41ac219e4af1e
F src/status.c 7565d63a79aa2f326339a24a0461a60096d0bd2bce711fefb50b5c89335f3592
F src/update.c 3e5e7ff66fa19ebe4d1b113d480639a24cc1175adbefabbd1a948a07f28e37cf
F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
F src/utf.c 7267c3fb9e2467020507601af3354c2446c61f444387e094c779dccd5ca62165
-F src/util.c 32e5aed34f20508356a297f4a28762ecd1db0c81bfcbe5aa9d9ebcc6a52b6a85
+F src/util.c 1cdaa3aeda6567b2b92953b8034ff13e6a0138a7b0bf3e827caecb7b90e68e06
F src/vacuum.c d3d35d8ae893d419ade5fa196d761a83bddcbb62137a1a157ae751ef38b26e82
F src/vdbe.c dbafc6f5762f9ae90d9dc9ed065a31743a8ceafbdbfb1a0a3a228921fb3cc36a
F src/vdbe.h 70e862ac8a11b590f8c1eaac17a0078429d42bc4ea3f757a9af0f451dd966a71
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P f8659b700c0088abe19ce65fec032c1005a1f750566488f4578256d41558770c
-R 758e0af8a0882e7e9923c695c5403a23
+P 82a0794814bbc095235f8158a4129a5d83f6af1b0c27cb56449ea32feb44faf5
+R 5d7836122dd27182b196781352b9b147
+T *branch * 2-argument-atof
+T *sym-2-argument-atof *
+T -sym-trunk *
U drh
-Z 1af8ca46b9aa6ac26d04c5ed95b2b6cf
+Z dcce595f066901035394acccf1c9c58b
# Remove this line to create a well-formed Fossil manifest.
-branch trunk
-tag trunk
+branch 2-argument-atof
+tag 2-argument-atof
-82a0794814bbc095235f8158a4129a5d83f6af1b0c27cb56449ea32feb44faf5
+85b07a4a329b317648699e78b275fae9e4489442b0e4d9189324d77b955138c5
*/
static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
if( ALWAYS(z!=0) ){
- double value = sqlite3_atof(z);
+ double value = sqlite3_atof(z,0.0);
assert( !sqlite3IsNaN(value) ); /* The new AtoF never returns NaN */
if( negateFlag ) value = -value;
sqlite3VdbeAddOp4Dup8(v, OP_Real, 0, iMem, 0, (u8*)&value, P4_REAL);
double r = -1.0;
if( p->op!=TK_FLOAT ) return -1;
assert( !ExprHasProperty(p, EP_IntValue) );
- r = sqlite3_atof(p->u.zToken);
+ r = sqlite3_atof(p->u.zToken, 0.0);
assert( r>=0.0 );
if( r>1.0 ) return -1;
return (int)(r*134217728.0);
return 1;
}
i++;
- p->tmProgress = sqlite3_atof(azArg[i]);
+ p->tmProgress = sqlite3_atof(azArg[i], 0.0);
if( p->tmProgress>0.0 ){
p->flgProgress = SHELL_PROGRESS_QUIET|SHELL_PROGRESS_TMOUT;
if( nn==0 ) nn = 100;
/*
** CAPI3REF: Text-to-float conversion
**
-** The sqlite3_atof(X) interface returns a "double" derived from the
-** text representation of a floating point value in X.
+** The sqlite3_atof(X,Y) interface returns a "double" derived from the
+** text representation of a floating point value in X, or it returns Y
+** if the text in X is not a well-formed floating point value.
** This interface provides applications with access to the
** same text→float conversion routine used by SQLite for SQL parsing
-** and type coercion. The sqlite3_atof(X) routine works like the standard
+** and type coercion. The sqlite3_atof(X,Y) routine works like the standard
** C-library atof(X) routine with the following exceptions:
**
** <ul>
** <li> Parsing of the input X is strict. If anything about X
-** is not well-formed, 0.0 is returned.
+** is not well-formed, Y is returned. Even if X has a prefix
+** which is a well-formed floating point value, Y is still returned
+** rather than the value of the well-formed prefix of X.
** <li> Special values such like "INF", "INFINITY", and "NAN" are not
** recognized.
** <li> Hexadecimal floating point literals are not recognized.
-** <li> The current locale is ignored. The radix character is always ".".
+** <li> Locale is ignored. The radix character is always ".".
** <li> The sqlite3_atof() interface does not set errno.
** </ul>
*/
-double sqlite3_atof(const char*);
+double sqlite3_atof(const char *X, double Y);
/*
** CAPI3REF: Memory Allocation Subsystem
int (*carray_bind)(sqlite3_stmt*,int,void*,int,int,void(*)(void*));
int (*carray_bind_v2)(sqlite3_stmt*,int,void*,int,int,void(*)(void*),void*);
/* Version 3.53.0 and later */
- double (*atof)(const char*);
+ double (*atof)(const char*,double);
};
/*
/*
** Access to sqlite3AtoF()
*/
-double sqlite3_atof(const char *z){
+double sqlite3_atof(const char *x, double y){
double r;
- return sqlite3AtoF(z,&r)>0 ? r : 0.0;
+ return sqlite3AtoF(x,&r)>0 ? r : y;
}
/*