From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 2 01:20:03 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6D231065677 for ; Wed, 2 Jun 2010 01:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9B48FC17 for ; Wed, 2 Jun 2010 01:20:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o521K3eg056313 for ; Wed, 2 Jun 2010 01:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o521K3Hu056312; Wed, 2 Jun 2010 01:20:03 GMT (envelope-from gnats) Resent-Date: Wed, 2 Jun 2010 01:20:03 GMT Resent-Message-Id: <201006020120.o521K3Hu056312@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, FreeBSD 8 /sbin/restore Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAC961065672 for ; Wed, 2 Jun 2010 01:16:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 7ACFE8FC08 for ; Wed, 2 Jun 2010 01:16:05 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o521G5pi002574 for ; Wed, 2 Jun 2010 01:16:05 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o521G5tZ002573; Wed, 2 Jun 2010 01:16:05 GMT (envelope-from nobody) Message-Id: <201006020116.o521G5tZ002573@www.freebsd.org> Date: Wed, 2 Jun 2010 01:16:05 GMT From: FreeBSD 8 /sbin/restore To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/147303: restore(8) uses uninitialized variables: tape.c dirs.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2010 01:20:03 -0000 >Number: 147303 >Category: bin >Synopsis: restore(8) uses uninitialized variables: tape.c dirs.c >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 02 01:20:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: FreeBSD 8 /sbin/restore >Release: FreeBSD {2,3,4,5,6,7,8}R >Organization: >Environment: >Description: in /sbin/restore(8)getvol(): if goto "gethdr" (line 336), variable "newvol" (line 421) is uninitialized. others are some exist (dirs.c, ...). "-Wall". http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/restore/tape.c?rev=1.56 Revision 1.56 Sat Feb 13 10:22:07 2010 UTC (3 months, 2 weeks ago) by jh Branches: MAIN CVS tags: HEAD 312 void 313 getvol(long nextvol) 314 { 315 int64_t prevtapea; 316 long i, newvol, savecnt; 317 union u_spcl tmpspcl; 318 # define tmpbuf tmpspcl.s_spcl 319 char buf[TP_BSIZE]; 320 321 if (nextvol == 1) { 322 tapesread = 0; 323 gettingfile = 0; 324 } 325 prevtapea = tapeaddr; 325 savecnt = blksread; 327 if (pipein) { 328 if (nextvol != 1) { 329 panic("Changing volumes on pipe input?\n"); 330 /* Avoid looping if we couldn't ask the user. */ 331 if (yflag || ferror(terminal) || feof(terminal)) 332 done(1); 333 } 334 if (volno == 1) 335 return; 336 goto gethdr; 337 } 338 again: : 415 if (mt == -1) { 416 fprintf(stderr, "Cannot open %s\n", magtape); 417 volno = -1; 418 goto again; 419 } 420 gethdr: 421 volno = newvol; >How-To-Repeat: gcc -Wall >Fix: >Release-Note: >Audit-Trail: >Unformatted: