aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-04-02 12:55:38 +0000
committerdrh <drh@noemail.net>2010-04-02 12:55:38 +0000
commita378c566d2a0614b4c1a23ea71e4f51c8bed08fe (patch)
tree7542b5c9addf168d81bfdf08e584c13a774c1ed4 /src
parentc2a4bab4620ba22aa9fcb24eed7f39396bad5256 (diff)
downloadsqlite-a378c566d2a0614b4c1a23ea71e4f51c8bed08fe.tar.gz
sqlite-a378c566d2a0614b4c1a23ea71e4f51c8bed08fe.zip
Take care to avoid a buffer over-read when adding a KEYINFO structure
to the P4 parameter of an opcode. FossilOrigin-Name: 937b931a7cdad6874638158ed6a9ab6356b0bd0c
Diffstat (limited to 'src')
-rw-r--r--src/vdbeaux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index b6b5a7b93..a5746f869 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -743,7 +743,7 @@ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){
pOp->p4.pKeyInfo = pKeyInfo;
if( pKeyInfo ){
u8 *aSortOrder;
- memcpy((char*)pKeyInfo, zP4, nByte);
+ memcpy((char*)pKeyInfo, zP4, nByte - nField);
aSortOrder = pKeyInfo->aSortOrder;
if( aSortOrder ){
pKeyInfo->aSortOrder = (unsigned char*)&pKeyInfo->aColl[nField];