1 Star 0 Fork 39

ethan848/sqlite

forked from src-openEuler/sqlite 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
6054-Fix-the-zipfile-function-in-the-zipfile-extension-so.patch 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
eulerstorage 提交于 2020-01-20 10:07 . fix CVEs
From d8f2d46cbc9925e034a68aaaf60aad788d9373c1 Mon Sep 17 00:00:00 2001
From: drh <drh@noemail.net>
Date: Mon, 23 Dec 2019 21:04:33 +0000
Subject: [PATCH] Fix the zipfile() function in the zipfile extension so that
it is able to deal with goofy filenames that contain embedded zeros.
Code for CVE-2019-19959 fixing
Modified by openEuler build team
Removed manifest changes and adapt to old code.
FossilOrigin-Name: cc0fb00a128fd0773db5ff7891f7aa577a3671d570166d2cbb30df922344adcf
---
ext/misc/zipfile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ext/misc/zipfile.c b/ext/misc/zipfile.c
index 9f2258e..3a87ec2 100644
--- a/ext/misc/zipfile.c
+++ b/ext/misc/zipfile.c
@@ -1631,7 +1631,7 @@ static int zipfileUpdate(
zFree = sqlite3_mprintf("%s/", zPath);
if( zFree==0 ){ rc = SQLITE_NOMEM; }
zPath = (const char*)zFree;
- nPath++;
+ nPath = (int)strlen(zPath);
}
}
@@ -2032,11 +2032,11 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqlite3_value **apVal){
}else{
if( zName[nName-1]!='/' ){
zName = zFree = sqlite3_mprintf("%s/", zName);
- nName++;
if( zName==0 ){
rc = SQLITE_NOMEM;
goto zipfile_step_out;
}
+ nName = (int)strlen(zName);
}else{
while( nName>1 && zName[nName-2]=='/' ) nName--;
}
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ethan848/sqlite.git
git@gitee.com:ethan848/sqlite.git
ethan848
sqlite
sqlite
master

搜索帮助