summaryrefslogtreecommitdiffstats
path: root/qmake/project.cpp
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:17 +0100
commit6da58c88045502a19f7f5ea54fca0bf079afff26 (patch)
tree0ff67ea44f75f909f8c03d72744004db2e1978b0 /qmake/project.cpp
parentccb28f09f42d22eea45ed25f791cdc8c71d751f5 (diff)
downloadqt3-6da58c88045502a19f7f5ea54fca0bf079afff26.tar.gz
qt3-6da58c88045502a19f7f5ea54fca0bf079afff26.zip
Fix potentially buffer overrun related to readlink(2)
Signed-off-by: OBATA Akio <obache@wizdas.com> (cherry picked from commit 5c32919647732d0e20dc08ad4a8d24193238174f)
Diffstat (limited to 'qmake/project.cpp')
-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;