Project

General

Profile

Submit #2895 ยป 0001-Change-the-format-for-fscanf-so-atrun-correctly-read.patch

peeter, 03/17/2016 03:02 AM

View differences:

libexec/atrun/atrun.c
fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC);
snprintf(fmt, sizeof(fmt),
"#!/bin/sh\n# atrun uid=%%ld gid=%%ld\n# mail %%%ds %%d",
"#!/bin/sh\n# atrun uid=%%u gid=%%u\n# mail %%%ds %%d",
MAXLOGNAME - 1);
if (fscanf(stream, fmt, &nuid, &ngid, mailbuf, &send_mail) != 4)
    (1-1/1)