From: drh Date: Tue, 5 Oct 2010 12:05:32 +0000 (+0000) Subject: Avoid all memory allocation (and hence the possiblitity of OOM failure) X-Git-Tag: version-3.7.4~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e062d7b8474d37779122798f075d9dc3601783ba;p=thirdparty%2Fsqlite.git Avoid all memory allocation (and hence the possiblitity of OOM failure) in sqlite3_value_double() and sqlite3_column_double(). FossilOrigin-Name: 4afdf9705a7c2b67aea31c5d51b9c295867d62d1 --- diff --git a/manifest b/manifest index 61ceddf76b..9b2ecc2e5b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C Fix\san\sassert()\sfailing\son\sOSX. -D 2010-10-05T11:33:15 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C Avoid\sall\smemory\sallocation\s(and\shence\sthe\spossiblitity\sof\sOOM\sfailure)\nin\ssqlite3_value_double()\sand\ssqlite3_column_double(). +D 2010-10-05T12:05:32 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c599a15d268b1db2aeadea19df2adc3bf2eb6bee F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -231,7 +234,7 @@ F src/vdbeInt.h 7f4cf1b2b69bef3a432b1f23dfebef57275436b4 F src/vdbeapi.c 03cddfa4f85cadf608c0d28ff6b622b7da432446 F src/vdbeaux.c de0b06b11a25293e820a49159eca9f1c51a64716 F src/vdbeblob.c 258a6010ba7a82b72b327fb24c55790655689256 -F src/vdbemem.c ef015d9d05fbf3fcce664dadd5b589663878ab50 +F src/vdbemem.c 23723a12cd3ba7ab3099193094cbb2eb78956aa9 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2 F src/vtab.c 6c90e3e65b2f026fc54703a8f3c917155f419d87 F src/wal.c 7081f148cb52b0cf2280e6384196402dc58130a3 @@ -872,7 +875,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 717a1e50f005714b1d5233f80697db14cd8af659 -R d10845ef1e691a2ad01891e85e2d80d0 -U dan -Z 652216f622ccc928c73ebb6c6f01edca +P dca8763872aa6244cb1a0f519167b360a6372d0d +R bae0674e9979ea2336e70aa2a90e681b +U drh +Z 3cc43a3d192c810caec2858798f1930c +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQFMqxSPoxKgR168RlERApxjAJ4uviGlguL/jbkr0aZy/Gya+iIP3QCfbJJB +GXkhyKKKYg66Eo0bQBXwWfk= +=4i7X +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 916a332936..24bad333f1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dca8763872aa6244cb1a0f519167b360a6372d0d \ No newline at end of file +4afdf9705a7c2b67aea31c5d51b9c295867d62d1 \ No newline at end of file diff --git a/src/vdbemem.c b/src/vdbemem.c index 598cb9d661..80160e6077 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -393,14 +393,7 @@ double sqlite3VdbeRealValue(Mem *pMem){ }else if( pMem->flags & (MEM_Str|MEM_Blob) ){ /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ double val = (double)0; - pMem->flags |= MEM_Str; - if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) - || sqlite3VdbeMemNulTerminate(pMem) ){ - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - return (double)0; - } - assert( pMem->z ); - sqlite3AtoF(pMem->z, &val, pMem->n, SQLITE_UTF8); + sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc); return val; }else{ /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */