From: Travis Cross Date: Thu, 27 Feb 2014 23:19:26 +0000 (+0000) Subject: Prevent sqlite from over-reading a structure X-Git-Tag: v1.2.23~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3366fe95b0d6879b49ff7e3e5cecee67464f1331;p=thirdparty%2Ffreeswitch.git Prevent sqlite from over-reading a structure Our sqlite fork was reading past the end of the zP3 KeyInfo structure here. This was causing gcc and clang's address sanitization to alert. FS-6279 --resolve Thanks-to: Christopher Rienzo --- diff --git a/libs/sqlite/src/vdbeaux.c b/libs/sqlite/src/vdbeaux.c index be85e7b8cb..11605e525a 100644 --- a/libs/sqlite/src/vdbeaux.c +++ b/libs/sqlite/src/vdbeaux.c @@ -527,7 +527,7 @@ void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){ pOp->p3 = (char*)pKeyInfo; if( pKeyInfo ){ unsigned char *aSortOrder; - memcpy(pKeyInfo, zP3, nByte); + memcpy(pKeyInfo, zP3, nByte - nField); aSortOrder = pKeyInfo->aSortOrder; if( aSortOrder ){ pKeyInfo->aSortOrder = (unsigned char*)&pKeyInfo->aColl[nField];