Fix potentially buffer overrun related to readlink(2)

Signed-off-by: OBATA Akio <obache@wizdas.com>
pull/35/head
OBATA Akio 4 years ago
parent 5c270c3e26
commit e6ce806b77

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