Bug 268661 - astro/accrete: segfaults when it attempts to write to file without permissions
Summary: astro/accrete: segfaults when it attempts to write to file without permissions
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Muhammad Moinur Rahman
URL: https://www.freshports.org/astro/accr...
Keywords: crash
Depends on:
Blocks:
 
Reported: 2022-12-31 01:43 UTC by Matthew Holevinski
Modified: 2022-12-31 22:01 UTC (History)
2 users (show)

See Also:


Attachments
git diff of display.c does null check before writing to fp (611 bytes, patch)
2022-12-31 01:43 UTC, Matthew Holevinski
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.