-C Remove\sa\sstale\sreference\sto\sthe\slong-removed\sSQLITE_MUTEX_APPDEF,\sas\spointed\sout\sin\s[forum:348453389b|forum\spost\s348453389b].
-D 2026-03-24T11:33:22.229
+C Improved\serror\smessages\sfor\sJSONB\snested\stoo\sdeep.
+D 2026-03-24T11:54:55.461
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/hwtime.h 21c2cf1f736e7b97502c3674d0c386db3f06870d6f10d0cf8174e2a4b8cb726e
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c dfd311b0ac2d4f6359e62013db67799757f4d2cc56cca5c10f4888acfbbfa3fd
-F src/json.c b2e4b71740825ae92170b7abf8b30e42eca64ade30eb34fbdd27d8598b2248ad
+F src/json.c 465a8b7c41f42a5c64036adf4619b34d7fb3ad0947c0662c1c5c372b41649475
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 187929338d21f43cbdea359a3c1ec61294f39b7f9032e824c1dbb79f9994c838
F src/main.c 31a13302193fbd51279c7e69cdfa0320d0de7629f9151e0964c1d320e8bdd7a4
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P 1cd30c4827e382861cf12af48579eedc9685b9612dedb6a2844f20355b910e7e
-R 8780cbb3021d5a878a547468e242a47c
-U stephan
-Z 08035a5f34f6050f5dbf728c38a452eb
+P cb8e55b59113d0102c50db0a43b1b59d531cdcb12a7cce4c4c9a428c7c6e1adf
+R 8b2a817ae31399c7deb32904feb440aa
+U drh
+Z 77bd223cb339720304c49139be84aed5
# Remove this line to create a well-formed Fossil manifest.
/* Allowed values for JsonString.eErr */
#define JSTRING_OOM 0x01 /* Out of memory */
#define JSTRING_MALFORMED 0x02 /* Malformed JSONB */
-#define JSTRING_ERR 0x04 /* Error already sent to sqlite3_result */
+#define JSTRING_TOODEEP 0x04 /* JSON nested too deep */
+#define JSTRING_ERR 0x08 /* Error already sent to sqlite3_result */
/* The "subtype" set for text JSON values passed through using
** sqlite3_result_subtype() and sqlite3_value_subtype().
jsonStringReset(p);
}
+/* Report JSON nested too deep
+*/
+static void jsonStringTooDeep(JsonString *p){
+ p->eErr |= JSTRING_TOODEEP;
+ assert( p->pCtx!=0 );
+ sqlite3_result_error(p->pCtx, "JSON nested too deep", -1);
+ jsonStringReset(p);
+}
+
/* Enlarge pJson->zBuf so that it can hold at least N more bytes.
** Return zero on success. Return non-zero on an OOM error
*/
}
}else if( p->eErr & JSTRING_OOM ){
sqlite3_result_error_nomem(p->pCtx);
+ }else if( p->eErr & JSTRING_TOODEEP ){
+ /* error already in p->pCtx */
}else if( p->eErr & JSTRING_MALFORMED ){
sqlite3_result_error(p->pCtx, "malformed JSON", -1);
}
j = i+n;
iEnd = j+sz;
if( ++pParse->iDepth > JSON_MAX_DEPTH ){
- jsonStringOom(pOut);
+ jsonStringTooDeep(pOut);
}
while( j<iEnd && pOut->eErr==0 ){
j = jsonTranslateBlobToText(pParse, j, pOut);
j = i+n;
iEnd = j+sz;
if( ++pParse->iDepth > JSON_MAX_DEPTH ){
- jsonStringOom(pOut);
+ jsonStringTooDeep(pOut);
}
while( j<iEnd && pOut->eErr==0 ){
j = jsonTranslateBlobToText(pParse, j, pOut);
jsonAppendChar(pOut, '\n');
pPretty->nIndent++;
if( pPretty->nIndent >= JSON_MAX_DEPTH ){
- jsonStringOom(pOut);
+ jsonStringTooDeep(pOut);
}
while( pOut->eErr==0 ){
jsonPrettyIndent(pPretty);
jsonAppendChar(pOut, '\n');
pPretty->nIndent++;
if( pPretty->nIndent >= JSON_MAX_DEPTH ){
- jsonStringOom(pOut);
+ jsonStringTooDeep(pOut);
}
pParse->iDepth = pPretty->nIndent;
while( pOut->eErr==0 ){