aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <>2022-03-29 22:57:00 +0000
committerdrh <>2022-03-29 22:57:00 +0000
commitc55b62d4cba51b583cbb6fe5f65e415a356f36d6 (patch)
treeece7bcec4b64958ace0df092b79cd1941874eb65 /src/vdbeapi.c
parent4cb32b70ed9fad380c99a7af34373d1f952b1f9e (diff)
downloadsqlite-c55b62d4cba51b583cbb6fe5f65e415a356f36d6.tar.gz
sqlite-c55b62d4cba51b583cbb6fe5f65e415a356f36d6.zip
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
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 48487694b..f47ece239 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -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(