Fix heap buffer overflow in mako

This commit is contained in:
Andrew Noyes 2020-02-28 11:10:42 -08:00
parent a97d0df07e
commit fd180e242d
1 changed files with 1 additions and 1 deletions

View File

@ -1711,7 +1711,7 @@ int main(int argc, char *argv[]) {
shm->readycount = 0;
/* fork worker processes */
worker_pids = (pid_t *)calloc(sizeof(pid_t), args.num_processes);
worker_pids = (pid_t*)calloc(sizeof(pid_t), args.num_processes + 1);
if (!worker_pids) {
fprintf(stderr, "ERROR: cannot allocate worker_pids (%d processes)\n",
args.num_processes);