From owner-freebsd-bugs Sun May 5 00:20:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA03532 for bugs-outgoing; Sun, 5 May 1996 00:20:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA03518 Sun, 5 May 1996 00:20:02 -0700 (PDT) Resent-Date: Sun, 5 May 1996 00:20:02 -0700 (PDT) Resent-Message-Id: <199605050720.AAA03518@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, enami@ba2.so-net.or.jp Received: from mail.ba2.so-net.or.jp (mail.ba2.so-net.or.jp [202.238.95.33]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id AAA03437 for ; Sun, 5 May 1996 00:18:54 -0700 (PDT) Received: from euphoria.enami.ba2.so-net.or.jp (root@ppp582a.ykhm.ap.so-net.or.jp [202.238.88.42]) by mail.ba2.so-net.or.jp (8.7.5/3.4W396011914) with ESMTP id QAA15066 for ; Sun, 5 May 1996 16:18:50 +0900 Received: (from enami@localhost) by euphoria.enami.ba2.so-net.or.jp (8.7.5/3.4W4-euphoria) id PAA12300; Sun, 5 May 1996 15:25:27 +0900 (JST) Message-Id: <199605050625.PAA12300@euphoria.enami.ba2.so-net.or.jp> Date: Sun, 5 May 1996 15:25:27 +0900 (JST) From: enami@ba2.so-net.or.jp Reply-To: enami@ba2.so-net.or.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/1174: uninitialized auto variable shmseg is used in shget_allocate_segment Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1174 >Category: kern >Synopsis: uninitialized auto variable shmseg is used in shget_allocate_segment >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 5 00:20:01 PDT 1996 >Last-Modified: >Originator: enami tsugutomo >Organization: >Release: FreeBSD 2.2-CURRENT i386 >Environment: FreeBSD current around 1996 May 4 (GMT+0900) >Description: When compiling kern/sysv_shm.c, compile gives following warning. cc -c -O -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Winline -nostdinc -I. -I../.. -I../../sys -I../../../include -DI386_CPU -DI486_CPU -DDIAGNOSTIC -DCOMPAT_43 -DCD9660 -DNFS -DFFS -DINET -DKERNEL ../../kern/sysv_shm.c ../../kern/sysv_shm.c: In function `shmget_allocate_segment': ../../kern/sysv_shm.c:459: warning: `shmseg' might be used uninitialized in this function >How-To-Repeat: Compile kernel with option SYSVSHM. >Fix: I think it is a typo introduced during sysv_shm.c 1.18 and 1.19. Here is a diff to correct it. Index: sysv_shm.c =================================================================== RCS file: /mnt/freebsd/src/sys/kern/sysv_shm.c,v retrieving revision 1.20 diff -u -r1.20 sysv_shm.c --- sysv_shm.c 1996/05/03 21:01:24 1.20 +++ sysv_shm.c 1996/05/05 05:36:00 @@ -463,7 +463,7 @@ return EINVAL; if (shm_nused >= shminfo.shmmni) /* any shmids left? */ return ENOSPC; - size = round_page(shmseg->shm_segsz); + size = round_page(uap->size); if (shm_committed + btoc(size) > shminfo.shmall) return ENOMEM; if (shm_last_free < 0) { >Audit-Trail: >Unformatted: