limit size of input lines sent to setproctitle to avoid buffer overruns
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 11 Dec 1993 04:43:48 +0000 (20:43 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 11 Dec 1993 04:43:48 +0000 (20:43 -0800)
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.21

usr/src/usr.sbin/sendmail/src/srvrsmtp.c

index dcb2eab..606388d 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.20 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.21 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 8.20 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.21 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -180,9 +180,9 @@ smtp(e)
                        fprintf(e->e_xfp, "<<< %s\n", inp);
 
                if (e->e_id == NULL)
                        fprintf(e->e_xfp, "<<< %s\n", inp);
 
                if (e->e_id == NULL)
-                       setproctitle("%s: %s", CurSmtpClient, inp);
+                       setproctitle("%s: %.80s", CurSmtpClient, inp);
                else
                else
-                       setproctitle("%s %s: %s", e->e_id, CurSmtpClient, inp);
+                       setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
 
                /* break off command */
                for (p = inp; isascii(*p) && isspace(*p); p++)
 
                /* break off command */
                for (p = inp; isascii(*p) && isspace(*p); p++)
@@ -279,7 +279,7 @@ smtp(e)
                        define('s', sendinghost, e);
                        initsys(e);
                        nrcpts = 0;
                        define('s', sendinghost, e);
                        initsys(e);
                        nrcpts = 0;
-                       setproctitle("%s %s: %s", e->e_id, CurSmtpClient, inp);
+                       setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
 
                        /* child -- go do the processing */
                        p = skipword(p, "from");
 
                        /* child -- go do the processing */
                        p = skipword(p, "from");