add missing patch
This commit is contained in:
parent
f24af56772
commit
c82b8ad1d0
1 changed files with 61 additions and 0 deletions
61
notwa-util/zipfile-unfuckery.patch
Normal file
61
notwa-util/zipfile-unfuckery.patch
Normal file
|
@ -0,0 +1,61 @@
|
|||
diff -rU3 a/third_party/sqlite3/zipfile.c b/third_party/sqlite3/zipfile.c
|
||||
--- a/third_party/sqlite3/zipfile.c 2023-06-13 01:39:06.538998700 +0200
|
||||
+++ b/third_party/sqlite3/zipfile.c 2023-06-13 01:40:24.578767300 +0200
|
||||
@@ -338,7 +338,7 @@
|
||||
|
||||
if( argc>3 ){
|
||||
zFile = argv[3];
|
||||
- nFile = (int)strlen(zFile)+1;
|
||||
+ nFile = (int)strnlen(zFile,0x7FFFFFFF)+1;
|
||||
}
|
||||
|
||||
rc = sqlite3_declare_vtab(db, ZIPFILE_SCHEMA);
|
||||
@@ -1421,10 +1421,10 @@
|
||||
** nB is the value of strlen(zB). This function returns 0 if the strings are
|
||||
** identical, ignoring any trailing '/' character in either path. */
|
||||
static int zipfileComparePath(const char *zA, const char *zB, int nB){
|
||||
- int nA = (int)strlen(zA);
|
||||
+ int nA = (int)strnlen(zA,0x7FFFFFFF);
|
||||
if( nA>0 && zA[nA-1]=='/' ) nA--;
|
||||
if( nB>0 && zB[nB-1]=='/' ) nB--;
|
||||
- if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
|
||||
+ if( nA==nB && memcmp(zA, zB, (unsigned int)nA)==0 ) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1544,7 +1544,7 @@
|
||||
/* If this is a DELETE or UPDATE, find the archive entry to delete. */
|
||||
if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
|
||||
const char *zDelete = (const char*)sqlite3_value_text(apVal[0]);
|
||||
- int nDelete = (int)strlen(zDelete);
|
||||
+ int nDelete = (int)strnlen(zDelete,0x7FFFFFFF);
|
||||
if( nVal>1 ){
|
||||
const char *zUpdate = (const char*)sqlite3_value_text(apVal[1]);
|
||||
if( zUpdate && zipfileComparePath(zUpdate, zDelete, nDelete)!=0 ){
|
||||
@@ -1612,7 +1612,7 @@
|
||||
if( rc==SQLITE_OK ){
|
||||
zPath = (const char*)sqlite3_value_text(apVal[2]);
|
||||
if( zPath==0 ) zPath = "";
|
||||
- nPath = (int)strlen(zPath);
|
||||
+ nPath = (int)strnlen(zPath,0x7FFFFFFF);
|
||||
mTime = zipfileGetTime(apVal[4]);
|
||||
}
|
||||
|
||||
@@ -1628,7 +1628,7 @@
|
||||
rc = SQLITE_NOMEM;
|
||||
nPath = 0;
|
||||
}else{
|
||||
- nPath = (int)strlen(zPath);
|
||||
+ nPath = (int)strnlen(zPath,0x7FFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2034,7 +2034,7 @@
|
||||
rc = SQLITE_NOMEM;
|
||||
goto zipfile_step_out;
|
||||
}
|
||||
- nName = (int)strlen(zName);
|
||||
+ nName = (int)strnlen(zName,0x7FFFFFFF);
|
||||
}else{
|
||||
while( nName>1 && zName[nName-2]=='/' ) nName--;
|
||||
}
|
Loading…
Add table
Reference in a new issue