Bug 268661

Summary: astro/accrete: segfaults when it attempts to write to file without permissions
Product: Ports & Packages Reporter: Matthew Holevinski <eylusion>
Component: Individual Port(s)Assignee: Muhammad Moinur Rahman <bofh>
Status: Closed FIXED    
Severity: Affects Some People CC: bofh, grahamperrin
Priority: --- Keywords: crash
Version: Latest   
Hardware: amd64   
OS: Any   
URL: https://www.freshports.org/astro/accrete/
Attachments:
Description Flags
git diff of display.c does null check before writing to fp none

Description Matthew Holevinski 2022-12-31 01:43:07 UTC
Created attachment 239138 [details]
git diff of display.c does null check before writing to fp

astro:accrete

display.c

Segmentation Fault occurs if program is executed in a directory without write privileges.

Patch provided exits gracefully if *fp is NULL before fprintf's attempt to write to non-existent file.
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-12-31 22:00:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=39191036a1f8c22f0d1424afa90f2f2559f124ad

commit 39191036a1f8c22f0d1424afa90f2f2559f124ad
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2022-12-31 19:49:42 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2022-12-31 21:58:55 +0000

    astro/accrete: Fix RUNTIME

    Segmentation Fault occurs if program is executed in a directory without
    write privileges.

    Patch provided exits gracefully if *fp is NULL before fprintf's attempt
    to write to non-existent file.

    - Add LICENSE BSD3CLAUSE

    PR:             268661
    Reported by:    eylusion@gmail.com

 astro/accrete/Makefile                    |  3 +++
 astro/accrete/files/patch-display.c (new) | 14 ++++++++++++++
 2 files changed, 17 insertions(+)
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-12-31 22:01:30 UTC
Committed with changes.