Fix potentially buffer overrun related to readlink(2)

Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit e6ce806b77)
r14.0.x
OBATA Akio 4 years ago committed by Michele Calgaro
parent 4ed0a29d33
commit ed71e397ed
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

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

Loading…
Cancel
Save