summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1998-01-31 17:06:15 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1998-01-31 17:06:15 +0000
commit1b909317e856bc4214e84a02a83276dd41fa3b2e (patch)
tree8a1b63936aa4e54bcd85d5faa7a1fd1ebccdeaec /bin
parent502d1984bfe0587a5a07142cf3b927565133fd23 (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/csh/csh.c5
-rw-r--r--bin/csh/err.c4
-rw-r--r--bin/csh/proc.c4
3 files changed, 8 insertions, 5 deletions
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index bce651d5d47f..973a97ec9074 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: csh.c,v 1.6 1995/10/23 23:08:25 ache Exp $
+ * $Id: csh.c,v 1.6.2.1 1997/08/24 21:41:29 jkh Exp $
*/
#ifndef lint
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/param.h>
#include <fcntl.h>
#include <errno.h>
#include <pwd.h>
@@ -229,7 +230,7 @@ main(argc, argv)
*/
set(STRstatus, Strsave(STR0));
- if ((tcp = getenv("HOME")) != NULL)
+ if ((tcp = getenv("HOME")) != NULL && strlen(tcp) < MAXPATHLEN)
cp = SAVE(tcp);
else
cp = NULL;
diff --git a/bin/csh/err.c b/bin/csh/err.c
index 5631b8621e40..8124d1e4240a 100644
--- a/bin/csh/err.c
+++ b/bin/csh/err.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: err.c,v 1.2 1994/09/24 02:53:57 davidg Exp $
+ * $Id: err.c,v 1.2.8.1 1997/08/24 21:41:31 jkh Exp $
*/
#ifndef lint
@@ -307,7 +307,7 @@ seterror(id, va_alist)
#endif
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
id = ERR_INVALID;
- vsprintf(berr, errorlist[id], va);
+ vsnprintf(berr, sizeof(berr), errorlist[id], va);
va_end(va);
seterr = strsave(berr);
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index 4b6950beab53..6257a4f42f2b 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: proc.c,v 1.2 1994/09/24 02:54:13 davidg Exp $
+ * $Id: proc.c,v 1.2.8.1 1997/08/24 21:41:37 jkh Exp $
*/
#ifndef lint
@@ -86,6 +86,7 @@ pchild(notused)
struct process *fp;
int pid;
extern int insource;
+ int save_errno = errno;
union wait w;
int jobflags;
struct rusage ru;
@@ -101,6 +102,7 @@ loop:
goto loop;
}
pnoprocesses = pid == -1;
+ errno = save_errno;
return;
}
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)