mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Fix the use of an uninitialized value that occurs when doing a json_insert()
of a string value that contains embedded U+0000 characters. FossilOrigin-Name: fc5ee9e51ad4556af526a6cefca5ae5a3b1b7affc4edf09832491d6b4f4ba366
This commit is contained in:
@@ -4756,11 +4756,13 @@ static void jsonReplaceNode(
|
||||
break;
|
||||
}
|
||||
if( sqlite3_value_subtype(pValue)!=JSON_SUBTYPE ){
|
||||
char *zCopy = sqlite3DbStrDup(0, z);
|
||||
char *zCopy = sqlite3_malloc64( n+1 );
|
||||
int k;
|
||||
if( zCopy ){
|
||||
memcpy(zCopy, z, n);
|
||||
zCopy[n] = 0;
|
||||
jsonParseAddCleanup(p, sqlite3_free, zCopy);
|
||||
}else{
|
||||
}else{
|
||||
p->oom = 1;
|
||||
sqlite3_result_error_nomem(pCtx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user