Fix potentially buffer overrun related to readlink(2)

Signed-off-by: OBATA Akio <obache@wizdas.com>
master
OBATA Akio 4 years ago committed by Slávek Banko
parent 30a7754971
commit 5c32919647
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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;

Loading…
Cancel
Save