Bug 172566

Summary: Fix analyzer warnings in /games
Product: Base System Reporter: Erik Cederstrand <erik>
Component: binAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
fortune.txt none

Description Erik Cederstrand 2012-10-10 12:00:00 UTC
Fix 4 warnings in /games reported by Clang Static Analyzer: 

bcd and caesar are not installed SETGID (at least on my system). Remove the call to setgid() as it becomes redundant.

In fortune, make sure a tail file is passed in the args if mandated in the logic. Bail if not.

In random(6), fix a memory leak in randomize_fd()

Fix: Se attached patch

Patch attached with submission follows:
Comment 1 Erik Cederstrand 2012-10-10 12:20:42 UTC
Den 10/10/2012 kl. 13.00 skrev FreeBSD-gnats-submit@freebsd.org:

>> Category:       misc
>> Responsible:    freebsd-bugs
>> Synopsis:       Fix analyzer warnings in /games
>> Arrival-Date:   Wed Oct 10 11:00:00 UTC 2012

Forgot to link to the reports: =
http://scan.freebsd.your.org/freebsd-head/games/2012-10-07-amd64/

Erik=
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-10-10 13:37:09 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I'll take it.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-10-13 05:45:43 UTC
State Changed
From-To: open->analyzed

I've submitted changes for bcd, caesar, and random. fortune appears to 
be a false positive - although an assert might help.
Comment 4 Erik Cederstrand 2012-10-22 12:18:55 UTC
Here's a new patch for fortune with an assert() instead.

Thanks,
Erik
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2012-10-26 00:24:19 UTC
State Changed
From-To: analyzed->patched

committed in HEAD
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2013-02-03 03:47:40 UTC
State Changed
From-To: patched->closed

I shall not MFC this PR