commit:     75d82143fa29cb7a37550333c548292bda6b4687
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 22 12:36:21 2025 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Sat Feb 22 13:16:30 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75d82143

dev-db/sqlite: Fix buffer overflow in autosetup jimsh

Add a patch similar to
https://github.com/msteveb/jimtcl/commit/9b754b8033b9f2a1dc8ba1227df2e5d75185dda7
until this is fixed upstream in autosetup

Closes: https://bugs.gentoo.org/949981
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-db/sqlite/files/sqlite-3.49.1-jimsh.patch | 36 +++++++++++++++++++++++++++
 dev-db/sqlite/sqlite-3.49.1.ebuild            |  2 ++
 2 files changed, 38 insertions(+)

diff --git a/dev-db/sqlite/files/sqlite-3.49.1-jimsh.patch 
b/dev-db/sqlite/files/sqlite-3.49.1-jimsh.patch
new file mode 100644
index 000000000000..68203390c793
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.49.1-jimsh.patch
@@ -0,0 +1,36 @@
+# https://bugs.gentoo.org/949981
+# 
https://github.com/msteveb/jimtcl/commit/9b754b8033b9f2a1dc8ba1227df2e5d75185dda7
+--- a/autosetup/jimsh0.c
++++ b/autosetup/jimsh0.c
+@@ -2088,9 +2088,13 @@ enum wbuftype {
+ #define UNIX_SOCKETS 0
+ #endif
+ 
+-#ifndef MAXPATHLEN
+-#define MAXPATHLEN JIM_PATH_LEN
+-#endif
++# ifndef MAXPATHLEN
++# ifdef PATH_MAX
++# define MAXPATHLEN PATH_MAX
++# else
++# define MAXPATHLEN JIM_PATH_LEN
++# endif
++# endif
+ 
+ 
+ 
+@@ -4173,14 +4177,6 @@ int Jim_regexpInit(Jim_Interp *interp)
+ #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+ #endif
+ 
+-# ifndef MAXPATHLEN
+-# ifdef PATH_MAX
+-# define MAXPATHLEN PATH_MAX
+-# else
+-# define MAXPATHLEN JIM_PATH_LEN
+-# endif
+-# endif
+-
+ #if defined(__MINGW32__) || defined(__MSYS__) || defined(_MSC_VER)
+ #define ISWINDOWS 1
+ 

diff --git a/dev-db/sqlite/sqlite-3.49.1.ebuild 
b/dev-db/sqlite/sqlite-3.49.1.ebuild
index a0c2249a6802..3deeb24b18ab 100644
--- a/dev-db/sqlite/sqlite-3.49.1.ebuild
+++ b/dev-db/sqlite/sqlite-3.49.1.ebuild
@@ -53,6 +53,8 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.47.2-hwtime.h-Don-t-use-rdtsc-on-i486.patch
        # https://sqlite.org/forum/forumpost/f93323a743
        "${FILESDIR}"/${PN}-3.49.0-icu-tests.patch
+       # https://bugs.gentoo.org/949981
+       "${FILESDIR}"/${PN}-3.49.1-jimsh.patch
 )
 
 _fossil_fetch() {

Reply via email to