1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Fix a memory allocation bug in the (debug-use-only) json_parse() SQL function.

FossilOrigin-Name: 32ce7dacf58bbf35cf70da8b03fa25f97fcea970edbc1f8aa12739ac4c8608fb
This commit is contained in:
drh
2024-01-31 12:15:57 +00:00
parent 91981fe74e
commit b202a452ad
3 changed files with 9 additions and 8 deletions

View File

@@ -3552,11 +3552,12 @@ static void jsonParseFunc(
if( p==0 ) return;
if( argc==1 ){
jsonDebugPrintBlob(p, 0, p->nBlob, 0, &out);
sqlite3_result_text64(ctx, out.zText, out.nChar, SQLITE_DYNAMIC, SQLITE_UTF8);
sqlite3_result_text64(ctx,out.zText,out.nChar,SQLITE_TRANSIENT,SQLITE_UTF8);
}else{
jsonShowParse(p);
}
jsonParseFree(p);
sqlite3_str_reset(&out);
}
#endif /* SQLITE_DEBUG */