From: drh Date: Mon, 7 Nov 2016 18:18:08 +0000 (+0000) Subject: Fix OOM error reporting in the json1_group_object() SQL function. Remove X-Git-Tag: version-3.16.0~144 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6850a633938816b123b52af6a7f2fa45e7f6c252;p=thirdparty%2Fsqlite.git Fix OOM error reporting in the json1_group_object() SQL function. Remove an unreachable branch from the JSON1 logic. FossilOrigin-Name: b54098491531cd26ed461275ef4aae3d3ec9065e --- diff --git a/ext/misc/json1.c b/ext/misc/json1.c index df6aa73247..327ad57500 100644 --- a/ext/misc/json1.c +++ b/ext/misc/json1.c @@ -1662,7 +1662,7 @@ static void jsonObjectFinal(sqlite3_context *ctx){ if( pStr ){ jsonAppendChar(pStr, '}'); if( pStr->bErr ){ - if( pStr->bErr==0 ) sqlite3_result_error_nomem(ctx); + if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); assert( pStr->bStatic ); }else{ sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, @@ -1940,9 +1940,9 @@ static int jsonEachColumn( /* For json_each() path and root are the same so fall through ** into the root case */ } - case JEACH_ROOT: { + default: { const char *zRoot = p->zRoot; - if( zRoot==0 ) zRoot = "$"; + if( zRoot==0 ) zRoot = "$"; sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC); break; } diff --git a/manifest b/manifest index 754789c49f..63b59e28d9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Replace\ssome\sunreachable\sbranches\sfrom\sthe\sJSON1\sextension\swith\sassert(). -D 2016-11-07T15:15:42.501 +C Fix\sOOM\serror\sreporting\sin\sthe\sjson1_group_object()\sSQL\sfunction.\s\sRemove\nan\sunreachable\sbranch\sfrom\sthe\sJSON1\slogic. +D 2016-11-07T18:18:08.418 F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc e0217f2d35a0448abbe4b066132ae20136e8b408 @@ -213,7 +213,7 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2 F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f F ext/misc/fuzzer.c 7c64b8197bb77b7d64eff7cac7848870235d4c25 F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c -F ext/misc/json1.c b8aa1219d25df9c135e067844f515cbaa452395d +F ext/misc/json1.c e0797ef1bfa637429ceab9140ecba620809ee02a F ext/misc/memvfs.c e5225bc22e79dde6b28380f3a068ddf600683a33 F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342 F ext/misc/percentile.c 92699c8cd7d517ff610e6037e56506f8904dae2e @@ -1530,7 +1530,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 7a63539169a384960e30a63e0c8e9b0f07fa431e -R 301a8516f843000230cab1da4034b3ce +P 145cd13e3c5a42a717807bcc13c0f7212f38bff8 +R 5bf098c60c4b2458fcef57830990e98c U drh -Z 60f1523be64826a7825849d4d0d5f745 +Z beca6c8fe13d65bdcd7b60c2b18aa7d8 diff --git a/manifest.uuid b/manifest.uuid index e396626575..3bdfc11d47 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -145cd13e3c5a42a717807bcc13c0f7212f38bff8 \ No newline at end of file +b54098491531cd26ed461275ef4aae3d3ec9065e \ No newline at end of file