Skip to content

Commit d8f2d46

Browse files
author
drh
committed
Fix the zipfile() function in the zipfile extension so that it is able to
deal with goofy filenames that contain embedded zeros. FossilOrigin-Name: cc0fb00a128fd0773db5ff7891f7aa577a3671d570166d2cbb30df922344adcf
1 parent 5f0dfc0 commit d8f2d46

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Diff for: ext/misc/zipfile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ static int zipfileUpdate(
16321632
zFree = sqlite3_mprintf("%s/", zPath);
16331633
if( zFree==0 ){ rc = SQLITE_NOMEM; }
16341634
zPath = (const char*)zFree;
1635-
nPath++;
1635+
nPath = (int)strlen(zPath);
16361636
}
16371637
}
16381638

@@ -2033,11 +2033,11 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqlite3_value **apVal){
20332033
}else{
20342034
if( zName[nName-1]!='/' ){
20352035
zName = zFree = sqlite3_mprintf("%s/", zName);
2036-
nName++;
20372036
if( zName==0 ){
20382037
rc = SQLITE_NOMEM;
20392038
goto zipfile_step_out;
20402039
}
2040+
nName = (int)strlen(zName);
20412041
}else{
20422042
while( nName>1 && zName[nName-2]=='/' ) nName--;
20432043
}

Diff for: manifest

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
C Thoroughly\sreset\sthe\srtree\scursor\sat\sthe\sstart\sof\seach\sVFilter\soperation,\nincluding\sclearing\sits\scache.\s\sThis\sprevents\sleft\sover\spages\sin\sthe\scache\nwhich\scan\scause\sproblems\son\sshutdown\safter\sa\sLEFT\sJOIN.\nTicket\s[5eadca17c4dde90c]
2-
D 2019-12-23T20:41:39.904
1+
C Fix\sthe\szipfile()\sfunction\sin\sthe\szipfile\sextension\sso\sthat\sit\sis\sable\sto\ndeal\swith\sgoofy\sfilenames\sthat\scontain\sembedded\szeros.
2+
D 2019-12-23T21:04:33.977
33
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
44
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
55
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -324,7 +324,7 @@ F ext/misc/vfsstat.c 77b5b4235c9f7f11eddf82487c0a422944ac2f132dafd5af3be7a68a057
324324
F ext/misc/vtablog.c 5538acd0c8ddaae372331bee11608d76973436b77d6a91e8635cfc9432fba5ae
325325
F ext/misc/vtshim.c 1976e6dd68dd0d64508c91a6dfab8e75f8aaf6cd
326326
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
327-
F ext/misc/zipfile.c dfec5589395fc2272a646fc309935ecb5164934a95757762afa120b72d1d0ba4
327+
F ext/misc/zipfile.c 46b8022d5c4f118995c3e7228542215204dacc9c1c4e9872710900ec276d6db3
328328
F ext/misc/zorder.c b0ff58fa643afa1d846786d51ea8d5c4b6b35aa0254ab5a82617db92f3adda64
329329
F ext/rbu/rbu.c 8681f6157db6adc82c34af24b14ea8a3be0146ad2a3b6c1d5da6cb8a5796c8ce
330330
F ext/rbu/rbu1.test 221d9c18a5e600ac9ac6b1810d99d9f99163a7909ba61597876ab6e4d4beb3d6
@@ -1852,7 +1852,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
18521852
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
18531853
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
18541854
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
1855-
P 953e6aa6d9ca09e549c88bc728c322fabdcef581f3b4a7763d95488dddbbd6a5
1856-
R ca340be656fb975dcd1521355f675df7
1855+
P 4c50afafce8416369f89477ba7fe7d9b047399a5ee5754c73d0e67bbea8d877c
1856+
R 29d7c3cbcd5652a73d3305fec9c54b58
18571857
U drh
1858-
Z 22698fecf79ba95f8e537178f371e71c
1858+
Z b32fa973d6865a272376759a8cfda3e5

Diff for: manifest.uuid

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4c50afafce8416369f89477ba7fe7d9b047399a5ee5754c73d0e67bbea8d877c
1+
cc0fb00a128fd0773db5ff7891f7aa577a3671d570166d2cbb30df922344adcf

0 commit comments

Comments
 (0)