File qt3-trinity-fix-potential-buffer-overrun.patch of Package qt3

From 5c32919647732d0e20dc08ad4a8d24193238174f Mon Sep 17 00:00:00 2001
From: OBATA Akio <obache@wizdas.com>
Date: Sat, 25 Jul 2020 11:48:24 +0900
Subject: Fix potentially buffer overrun related to readlink(2)

Signed-off-by: OBATA Akio <obache@wizdas.com>
---
 qmake/project.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qmake/project.cpp b/qmake/project.cpp
index efc465d..081143c 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -724,7 +724,7 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QString
 	static char *buffer = NULL;
 	if(!buffer)
 	    buffer = (char *)malloc(1024);
-	int l = readlink(Option::mkfile::qmakespec, buffer, 1024);
+	int l = readlink(Option::mkfile::qmakespec, buffer, 1023);
 	if(l != -1) {
 	    buffer[l] = '\0';
 	    QString r = buffer;
-- 
cgit v1.2.1

openSUSE Build Service is sponsored by