Source-Changes-HG archive

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

[src/netbsd-3]: src/lib/libc/db/recno Pull up revision 1.14 (requested by luk...



details:   https://anonhg.NetBSD.org/src/rev/955cbb5d7937
branches:  netbsd-3
changeset: 576184:955cbb5d7937
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jun 11 12:17:29 2005 +0000

description:
Pull up revision 1.14 (requested by lukem in ticket #395):
Ensure dbp is initialized to NULL before trying to use it in an error codepath.
Detected with gcc -Wuninitialized.
(The bug was introduced in rev 1.13.  Hi Mycroft! :)

diffstat:

 lib/libc/db/recno/rec_open.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r e48cc6681365 -r 955cbb5d7937 lib/libc/db/recno/rec_open.c
--- a/lib/libc/db/recno/rec_open.c      Sat Jun 11 12:15:25 2005 +0000
+++ b/lib/libc/db/recno/rec_open.c      Sat Jun 11 12:17:29 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rec_open.c,v 1.13 2005/01/19 00:23:44 mycroft Exp $    */
+/*     $NetBSD: rec_open.c,v 1.13.2.1 2005/06/11 12:17:29 tron Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)rec_open.c 8.10 (Berkeley) 9/1/94";
 #else
-__RCSID("$NetBSD: rec_open.c,v 1.13 2005/01/19 00:23:44 mycroft Exp $");
+__RCSID("$NetBSD: rec_open.c,v 1.13.2.1 2005/06/11 12:17:29 tron Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -72,6 +72,7 @@
        int rfd = -1;   /* pacify gcc */
        int sverrno;
 
+       dbp = NULL;
        /* Open the user's file -- if this fails, we're done. */
        if (fname != NULL) {
                if ((rfd = open(fname, flags, mode)) == -1)
@@ -81,7 +82,6 @@
        }
 
        /* Create a btree in memory (backed by disk). */
-       dbp = NULL;
        if (openinfo) {
                if (openinfo->flags & ~(R_FIXEDLEN | R_NOKEY | R_SNAPSHOT))
                        goto einval;



Home | Main Index | Thread Index | Old Index