libdbiDrivers: take upstream patch to prevent buffer overflow triggered by glibc 2.38 fortification

This commit is contained in:
StephenWithPH
2024-03-18 11:12:37 -07:00
parent ce8e7baf9b
commit 88801dab5e
2 changed files with 16 additions and 0 deletions
@@ -16,6 +16,11 @@ stdenv.mkDerivation rec {
buildInputs = [ libdbi sqlite postgresql ] ++ lib.optional (libmysqlclient != null) libmysqlclient;
patches = [
# https://sourceforge.net/p/libdbi-drivers/libdbi-drivers/ci/24f48b86c8988ee3aaebc5f303d71e9d789f77b6
./libdbi-drivers-0.9.0-buffer_overflow.patch
];
postPatch = ''
sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
'';
@@ -0,0 +1,11 @@
--- a/drivers/sqlite3/dbd_sqlite3.c
+++ b/drivers/sqlite3/dbd_sqlite3.c
@@ -1451,7 +1451,7 @@ static int getTables(char** tables, int
break;
}
- word_lower[item-start+1];
+ char word_lower[item-start+1];
strncpy(word_lower,start,item-start);
word_lower[item-start] = '\0';
int i = 0;