Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > 8b64012b63902b1198d390743392223d > files > 5

at-3.1.8-20mdv2007.1.src.rpm

--- at-3.1.8/atd.c.buflen	Thu Jan 17 13:34:05 2002
+++ at-3.1.8/atd.c	Thu Jan 17 13:35:10 2002
@@ -159,7 +159,7 @@
  */
     pid_t pid;
     int fd_out, fd_in;
-    char mailbuf[17], jobbuf[9];
+    char mailbuf[256], jobbuf[9];
     char *mailname = NULL;
     char *newname;
     FILE *stream;
@@ -260,10 +260,11 @@
     if(fcntl(fd_in, F_SETFD, fflags | FD_CLOEXEC) < 0)
     perr("Error in fcntl");
 
-    if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %16s %d",
+    if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %255s %d",
 	       &nuid, &ngid, mailbuf, &send_mail) != 4)
 	pabort("File %.500s is in wrong format - aborting",
 	       filename);
+	mailbuf[255] = '\0';
 
     if (mailbuf[0] == '-')
 	pabort("illegal mail name %.300s in job %8lu (%.300s)", mailbuf,