diff options
Diffstat (limited to 'contrib/sendmail/smrsh/smrsh.c')
-rw-r--r-- | contrib/sendmail/smrsh/smrsh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/sendmail/smrsh/smrsh.c b/contrib/sendmail/smrsh/smrsh.c index a37613e..409b13f 100644 --- a/contrib/sendmail/smrsh/smrsh.c +++ b/contrib/sendmail/smrsh/smrsh.c @@ -21,7 +21,7 @@ SM_IDSTR(copyright, Copyright (c) 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.58.2.2 2002/09/24 21:40:05 ca Exp $") +SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.58.2.5 2003/12/15 17:09:39 ca Exp $") /* ** SMRSH -- sendmail restricted shell @@ -119,8 +119,9 @@ addcmd(s, cmd, len) if (s == NULL || *s == '\0') return; + /* enough space for s (len) and CMDDIR + "/" and '\0'? */ if (sizeof newcmdbuf - strlen(newcmdbuf) <= - len + (cmd ? (strlen(CMDDIR) + 1) : 0)) + len + 1 + (cmd ? (strlen(CMDDIR) + 1) : 0)) { (void)sm_io_fprintf(smioerr, SM_TIME_DEFAULT, "%s: command too long: %s\n", prg, par); @@ -131,7 +132,7 @@ addcmd(s, cmd, len) } if (cmd) (void) sm_strlcat2(newcmdbuf, CMDDIR, "/", sizeof newcmdbuf); - (void) sm_strlcat(newcmdbuf, s, sizeof newcmdbuf); + (void) strncat(newcmdbuf, s, len); } int |