Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/vi/common Pull up revision 1.10 (requested by luk...



details:   https://anonhg.NetBSD.org/src/rev/18d9c62ab565
branches:  netbsd-3
changeset: 576229:18d9c62ab565
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Jun 15 05:27:39 2005 +0000

description:
Pull up revision 1.10 (requested by lukem in ticket #409):
Don't attempt to dereference an uninitialized 'ep' pointer if we can't
make a temporary file to mail to the user.
Detected with gcc -Wuninitialized.

diffstat:

 usr.bin/vi/common/recover.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 41c577721d9d -r 18d9c62ab565 usr.bin/vi/common/recover.c
--- a/usr.bin/vi/common/recover.c       Wed Jun 15 05:24:06 2005 +0000
+++ b/usr.bin/vi/common/recover.c       Wed Jun 15 05:27:39 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: recover.c,v 1.9 2005/01/19 01:20:24 mycroft Exp $      */
+/*     $NetBSD: recover.c,v 1.9.2.1 2005/06/15 05:27:39 snj Exp $      */
 
 /*-
  * Copyright (c) 1993, 1994
@@ -16,7 +16,7 @@
 #if 0
 static const char sccsid[] = "@(#)recover.c    10.21 (Berkeley) 9/15/96";
 #else
-__RCSID("$NetBSD: recover.c,v 1.9 2005/01/19 01:20:24 mycroft Exp $");
+__RCSID("$NetBSD: recover.c,v 1.9.2.1 2005/06/15 05:27:39 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -360,6 +360,7 @@
        char host[MAXHOSTNAMELEN];
 
        gp = sp->gp;
+       ep = sp->ep;
        if ((pw = getpwuid(uid = getuid())) == NULL) {
                msgq(sp, M_ERR,
                    "062|Information on user id %u not found", uid);
@@ -381,7 +382,6 @@
         * be recovered.  There's an obvious window between the mkstemp call
         * and the lock, but it's pretty small.
         */
-       ep = sp->ep;
        if (file_lock(sp, NULL, NULL, fd, 1) != LOCK_SUCCESS)
                msgq(sp, M_SYSERR, "063|Unable to lock recovery file");
        if (!issync) {



Home | Main Index | Thread Index | Old Index