summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2020-07-25 11:48:24 +0900
committerSlávek Banko <slavek.banko@axis.cz>2021-02-02 01:42:04 +0100
commit5c32919647732d0e20dc08ad4a8d24193238174f (patch)
treee1a4aa92503ecd73a7a1bd3893df4f321ae291a1
parent30a7754971fee794819df164dd1601b2af49587a (diff)
downloadqt3-5c32919647732d0e20dc08ad4a8d24193238174f.tar.gz
qt3-5c32919647732d0e20dc08ad4a8d24193238174f.zip
Fix potentially buffer overrun related to readlink(2)
Signed-off-by: OBATA Akio <obache@wizdas.com>
-rw-r--r--qmake/project.cpp2
1 files changed, 1 insertions, 1 deletions
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;