/ Check-in [8f7a592f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix harmless compiler warnings in zipfile.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:8f7a592f8c044d75b4615a95e27454100b10c2b26f4cafee97dec23343821130
User & Date: drh 2018-01-13 23:28:33
Context
2018-01-14
20:12
Avoid excess stack usage when a VALUES clause with lots of rows occurs within a scalar expression. This fixes a problem discovered by OSSFuzz. check-in: a4fa0581 user: drh tags: trunk
2018-01-13
23:28
Fix harmless compiler warnings in zipfile.c. check-in: 8f7a592f user: drh tags: trunk
19:08
Support UPDATE statements against zipfile virtual tables. check-in: f2d2a5df user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/zipfile.c.

  1274   1274     int bIsDir = 0;
  1275   1275   
  1276   1276     assert( pTab->zFile );
  1277   1277     assert( pTab->pWriteFd );
  1278   1278   
  1279   1279     if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
  1280   1280       const char *zDelete = (const char*)sqlite3_value_text(apVal[0]);
  1281         -    int nDelete = strlen(zDelete);
         1281  +    int nDelete = (int)strlen(zDelete);
  1282   1282       for(pOld=pTab->pFirstEntry; 1; pOld=pOld->pNext){
  1283   1283         if( pOld->bDeleted ) continue;
  1284   1284         if( zipfileComparePath(pOld->zPath, zDelete, nDelete)==0 ){
  1285   1285           pOld->bDeleted = 1;
  1286   1286           break;
  1287   1287         }
  1288   1288         assert( pOld->pNext );
................................................................................
  1291   1291     }
  1292   1292   
  1293   1293     if( sqlite3_value_nochange(apVal[5]) && sqlite3_value_nochange(apVal[6])
  1294   1294      && sqlite3_value_nochange(apVal[7]) && sqlite3_value_nochange(apVal[8])
  1295   1295     ){
  1296   1296       /* Reuse the data from the existing entry. */
  1297   1297       FILE *pFile = pTab->pWriteFd;
  1298         -    ZipfileCDS cds;
  1299   1298       zipfileReadCDS(pOld->aCdsEntry, &cds);
  1300   1299   
  1301   1300       bIsDir = ((cds.iExternalAttr>>16) & S_IFDIR) ? 1 : 0;
  1302   1301       sz = cds.szUncompressed;
  1303   1302       iMethod = cds.iCompression;
  1304   1303       if( sz>0 ){
  1305   1304         char **pzErr = &pTab->base.zErrMsg;