diff options
author | drh <> | 2024-01-29 20:36:17 +0000 |
---|---|---|
committer | drh <> | 2024-01-29 20:36:17 +0000 |
commit | af3824d5fa56c7ab892dda7f929940a6eaa66b35 (patch) | |
tree | 873d7403315692f36dc448f04800c86813fb31a4 /src/json.c | |
parent | 581bf002ce9c979bce7b994de6e29746509c89be (diff) | |
download | sqlite-af3824d5fa56c7ab892dda7f929940a6eaa66b35.tar.gz sqlite-af3824d5fa56c7ab892dda7f929940a6eaa66b35.zip |
When generated text JSON from JSONB, do not continue descending into
nested structures after an error is seen. This avoids long loops and wait
times.
FossilOrigin-Name: 97666ec052ebaceab002874d7ca5c5e6883c3d04fb7d3992235a8c4c8d08407a
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/json.c b/src/json.c index 94f5a3ef9..2f0243651 100644 --- a/src/json.c +++ b/src/json.c @@ -2270,7 +2270,7 @@ static u32 jsonTranslateBlobToText( jsonAppendChar(pOut, '['); j = i+n; iEnd = j+sz; - while( j<iEnd ){ + while( j<iEnd && pOut->eErr==0 ){ j = jsonTranslateBlobToText(pParse, j, pOut); jsonAppendChar(pOut, ','); } @@ -2283,7 +2283,7 @@ static u32 jsonTranslateBlobToText( jsonAppendChar(pOut, '{'); j = i+n; iEnd = j+sz; - while( j<iEnd ){ + while( j<iEnd && pOut->eErr==0 ){ j = jsonTranslateBlobToText(pParse, j, pOut); jsonAppendChar(pOut, (x++ & 1) ? ',' : ':'); } |