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

Move a pointer computation until after OOM checks to avoid a nuisance USAN

warning.

FossilOrigin-Name: 41474548ef3f7454e44fbf648429730b3f5ba1ff0086fd2f2d0e59b8f51d85e6
This commit is contained in:
drh
2020-08-08 17:55:39 +00:00
parent a6c13b22b2
commit c664355c0f
3 changed files with 9 additions and 9 deletions

View File

@@ -2492,7 +2492,6 @@ static int pager_delsuper(Pager *pPager, const char *zSuper){
** If successful, open the super-journal file for reading.
*/
pSuper = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2);
pJournal = (sqlite3_file *)(((u8 *)pSuper) + pVfs->szOsFile);
if( !pSuper ){
rc = SQLITE_NOMEM_BKPT;
}else{
@@ -2500,6 +2499,7 @@ static int pager_delsuper(Pager *pPager, const char *zSuper){
rc = sqlite3OsOpen(pVfs, zSuper, pSuper, flags, 0);
}
if( rc!=SQLITE_OK ) goto delsuper_out;
pJournal = (sqlite3_file *)(((u8 *)pSuper) + pVfs->szOsFile);
/* Load the entire super-journal file into space obtained from
** sqlite3_malloc() and pointed to by zSuperJournal. Also obtain