summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite/src/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/sqlite/src/expr.c')
-rw-r--r--third_party/sqlite/src/expr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/third_party/sqlite/src/expr.c b/third_party/sqlite/src/expr.c
index 50b24de..31a62b6 100644
--- a/third_party/sqlite/src/expr.c
+++ b/third_party/sqlite/src/expr.c
@@ -804,7 +804,9 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int flags, u8 **pzBuffer){
}else{
int nSize = exprStructSize(p);
memcpy(zAlloc, p, nSize);
- memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
+ if( EXPR_FULLSIZE>nSize ){
+ memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize);
+ }
}
/* Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately. */