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

Fix two instances of undefined behavior in the C code - both harmless for

all current compilers.

FossilOrigin-Name: 99fd194c83dbcfcdcc582983b86678b85b1b9570
This commit is contained in:
drh
2016-03-25 12:10:32 +00:00
parent cb620b4797
commit ddb2b4a310
4 changed files with 14 additions and 12 deletions

View File

@@ -2524,7 +2524,6 @@ case OP_Column: {
}while( i<=p2 && zHdr<zEndHdr );
pC->nHdrParsed = i;
pC->iHdrOffset = (u32)(zHdr - zData);
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
/* The record is corrupt if any of the following are true:
** (1) the bytes of the header extend past the declared header size
@@ -2534,9 +2533,12 @@ case OP_Column: {
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize))
|| (offset64 > pC->payloadSize)
){
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error;
}
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
}else{
t = 0;
}