Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 1997 19:00:59 -0800 (PST)
From:      garbanzo@hooked.net
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   misc/5187: phantasia will segfault if it can't open certian files
Message-ID:  <199712020300.TAA18188@hub.freebsd.org>
Resent-Message-ID: <199712020310.TAA18912@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         5187
>Category:       misc
>Synopsis:       phantasia will segfault if it can't open certian files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec  1 19:10:01 PST 1997
>Last-Modified:
>Originator:     Alex
>Organization:
>Release:        3.0-current
>Environment:
FreeBSD zippy.dyn.ml.org 3.0-CURRENT FreeBSD 3.0-CURRENT #0:
Mon Dec  1 00:29:42 PST 1997     root@zippy.dyn.ml.org:/usr/src/sys/compile/ZIPPY  i386

>Description:
When phantasia is run, it expects to have access to various
/var/games/phantasia files, if it doesn't it calls a function
to theoretically shut itself down nicely.  However that function
doesn't check to see if the fds it's fclosing are open or not.	
>How-To-Repeat:
Run phantasia as a user that doesn't have read or write
access to /var/games.
>Fix:
*** main.c.orig Mon Dec  1 18:59:03 1997
--- main.c      Mon Dec  1 18:59:32 1997
***************
*** 1277,1286 ****
        endwin();
        }
  
!     fclose(Playersfp);
!     fclose(Monstfp);
!     fclose(Messagefp);
!     fclose(Energyvoidfp);
  
      if (doexit)
        exit(0);
--- 1277,1290 ----
        endwin();
        }
  
!     if (Playersfp)
!       fclose(Playersfp);
!     if (Monstfp)
!       fclose(Monstfp);
!     if (Messagefp)
!       fclose(Messagefp);
!     if (Energyvoidfp)
!       fclose(Energyvoidfp);
  
      if (doexit)
        exit(0);
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712020300.TAA18188>