1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

In setResultStrOrError(), if the input string pointer is NULL and hence the

value gets set to an SQL NULL, then the Mem.enc field is uninitialized.  So
do not read it.  This is a harmless OSSFuzz/ASAN found problem.

FossilOrigin-Name: 47d0b1c4cfc3d2d8f57a02079276bb70a205ffd0f18007dd39c92f813d4c87f5
This commit is contained in:
drh
2022-03-29 22:57:00 +00:00
parent 4cb32b70ed
commit c55b62d4cb
3 changed files with 10 additions and 12 deletions

View File

@@ -391,11 +391,9 @@ static void setResultStrOrError(
}
return;
}
if( pOut->enc!=ENC(pOut->db) ){
sqlite3VdbeChangeEncoding(pOut, ENC(pOut->db));
if( sqlite3VdbeMemTooBig(pOut) ){
sqlite3_result_error_toobig(pCtx);
}
sqlite3VdbeChangeEncoding(pOut, ENC(pOut->db));
if( sqlite3VdbeMemTooBig(pOut) ){
sqlite3_result_error_toobig(pCtx);
}
}
static int invokeValueDestructor(