From b09fdd31aa555addfe87d14225d65dd3e82a9b09 Mon Sep 17 00:00:00 2001 From: ormorph Date: Fri, 2 Feb 2024 13:17:34 +0300 Subject: Added a patch for tqt, solves the buffer overflow problem Solution to problem #351, TDE/tqt3#100 Signed-off-by: ormorph (cherry picked from commit 24b756f9e2a24bd46f144fc99796fa0fba9a0c62) --- dev-tqt/tqt/files/tqt-buffer.patch | 29 +++++++++++++++++++++++++++++ dev-tqt/tqt/tqt-14.1.0.ebuild | 3 ++- dev-tqt/tqt/tqt-14.1.1.ebuild | 7 ++++++- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 dev-tqt/tqt/files/tqt-buffer.patch diff --git a/dev-tqt/tqt/files/tqt-buffer.patch b/dev-tqt/tqt/files/tqt-buffer.patch new file mode 100644 index 00000000..abe642c3 --- /dev/null +++ b/dev-tqt/tqt/files/tqt-buffer.patch @@ -0,0 +1,29 @@ +--- a/src/tools/qglobal.cpp ++++ b/src/tools/qglobal.cpp +@@ -520,7 +520,7 @@ void tqDebug( const char *msg, ... ) + va_list ap; + va_start( ap, msg ); // use variable arg list + #if defined(QT_VSNPRINTF) +- QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH, msg, ap ); ++ QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH-len, msg, ap ); + #else + vsprintf( &buf[len], msg, ap ); + #endif +@@ -555,7 +555,7 @@ void tqWarning( const char *msg, ... ) + va_list ap; + va_start( ap, msg ); // use variable arg list + #if defined(QT_VSNPRINTF) +- QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH, msg, ap ); ++ QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH-len, msg, ap ); + #else + vsprintf( &buf[len], msg, ap ); + #endif +@@ -590,7 +590,7 @@ void tqFatal( const char *msg, ... ) + va_list ap; + va_start( ap, msg ); // use variable arg list + #if defined(QT_VSNPRINTF) +- QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH, msg, ap ); ++ QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH-len, msg, ap ); + #else + vsprintf( &buf[len], msg, ap ); + #endif diff --git a/dev-tqt/tqt/tqt-14.1.0.ebuild b/dev-tqt/tqt/tqt-14.1.0.ebuild index 93379b6b..f1dec6aa 100644 --- a/dev-tqt/tqt/tqt-14.1.0.ebuild +++ b/dev-tqt/tqt/tqt-14.1.0.ebuild @@ -64,7 +64,6 @@ RDEPEND=" DEPEND="${RDEPEND} x11-base/xorg-proto " - pkg_setup() { if use imext; then ewarn @@ -111,6 +110,8 @@ pkg_setup() { } src_prepare() { + # Solution to problem #351, TDE/tqt3#100 + eapply "${FILESDIR}/${PN}-buffer.patch" # Apply user-provided patches eapply_user diff --git a/dev-tqt/tqt/tqt-14.1.1.ebuild b/dev-tqt/tqt/tqt-14.1.1.ebuild index ba9cd379..508ad7dc 100644 --- a/dev-tqt/tqt/tqt-14.1.1.ebuild +++ b/dev-tqt/tqt/tqt-14.1.1.ebuild @@ -31,6 +31,10 @@ REQUIRED_USE="mysql? ( !mariadb )" # Don't use Gentoo mirrors RESTRICT="mirror" +PATCHES=( + "${FILESDIR}"/${PN}-buffer.patch +) + RDEPEND=" media-libs/freetype media-libs/libpng:= @@ -65,7 +69,6 @@ RDEPEND=" DEPEND="${RDEPEND} x11-base/xorg-proto " - pkg_setup() { if use imext; then ewarn @@ -112,6 +115,8 @@ pkg_setup() { } src_prepare() { + # Solution to problem #351, TDE/tqt3#100 + eapply "${FILESDIR}/${PN}-buffer.patch" # Apply user-provided patches eapply_user -- cgit v1.2.1