Module Name:    src
Committed By:   christos
Date:           Fri Oct 18 20:17:59 UTC 2013

Modified Files:
        src/usr.bin/mail: cmd1.c

Log Message:
avoid longjmp clobber.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/mail/cmd1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/mail/cmd1.c
diff -u src/usr.bin/mail/cmd1.c:1.33 src/usr.bin/mail/cmd1.c:1.34
--- src/usr.bin/mail/cmd1.c:1.33	Tue Jun 12 15:03:26 2012
+++ src/usr.bin/mail/cmd1.c	Fri Oct 18 16:17:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmd1.c,v 1.33 2012/06/12 19:03:26 christos Exp $	*/
+/*	$NetBSD: cmd1.c,v 1.34 2013/10/18 20:17:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)cmd1.c	8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: cmd1.c,v 1.33 2012/06/12 19:03:26 christos Exp $");
+__RCSID("$NetBSD: cmd1.c,v 1.34 2013/10/18 20:17:59 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -325,6 +325,7 @@ type1(int *msgvec, int doign, int mime_d
 	 * not what it is pointing at!
 	 */
 	FILE *volatile obuf;		/* avoid longjmp clobbering */
+	int * volatile mvec;
 	sig_t volatile oldsigpipe;	/* avoid longjmp clobbering? */
 #ifdef MIME_SUPPORT
 	struct mime_info *volatile mip;	/* avoid longjmp clobbering? */
@@ -332,6 +333,7 @@ type1(int *msgvec, int doign, int mime_d
 	mip = NULL;
 #endif
 
+	mvec = msgvec;
 	if ((obuf = last_registered_file(0)) == NULL)
 		obuf = stdout;
 
@@ -348,7 +350,7 @@ type1(int *msgvec, int doign, int mime_d
 	msgCount = get_msgCount();
 
 	recursive = do_recursion();
-	for (ip = msgvec; *ip && ip - msgvec < msgCount; ip++) {
+	for (ip = mvec; *ip && ip - mvec < msgCount; ip++) {
 		struct type1_core_args_s args;
 		struct message *mp;
 

Reply via email to