summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOBATA Akio <[email protected]>2020-07-25 11:48:24 +0900
committerMichele Calgaro <[email protected]>2020-07-25 15:44:41 +0900
commited71e397ed3267d0d917e7e470c0702142947f5e (patch)
treea5d34e6c00081efd875d13768dc851ddf0d10a06
parent4ed0a29d338d99971be9eaa9b41db41e02452c15 (diff)
downloadtqt3-ed71e397ed3267d0d917e7e470c0702142947f5e.tar.gz
tqt3-ed71e397ed3267d0d917e7e470c0702142947f5e.zip
Fix potentially buffer overrun related to readlink(2)
Signed-off-by: OBATA Akio <[email protected]> (cherry picked from commit e6ce806b771adc9d963d760dfac46b2c62a57798)
-rw-r--r--qmake/project.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index f60dba06a..e15128109 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -724,7 +724,7 @@ TQMakeProject::isActiveConfig(const TQString &x, bool regex, TQMap<TQString, TQS
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';
TQString r = buffer;