[GH-ISSUE #1493] If we dont build with github action, app can easily crash #1054

Closed
opened 2026-05-07 00:29:54 +02:00 by BreizhHardware · 1 comment

Originally created by @cyrinux on GitHub (Nov 20, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1493

Hi,
In case for whatever reason we rebuild in piggy way, the code is weak in the main.go for the commit sha reading that can easily lead to overflow and crash.
The culprit is the commit[:7], in my case the main issue was my git version which crash, goreleaser continue and so set the commit and tags to "none". Thus at start the app try to do "none"[:7] and crash.
Can we make the code more robust with something like:

commitShort := commit
if len(commit) > 7 {
    commitShort = commit[:7]
}
...
Originally created by @cyrinux on GitHub (Nov 20, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1493 Hi, In case for whatever reason we rebuild in piggy way, the code is weak in the main.go for the commit sha reading that can easily lead to overflow and crash. The culprit is the `commit[:7]`, in my case the main issue was my git version which crash, goreleaser continue and so set the commit and tags to "none". Thus at start the app try to do `"none"[:7]` and crash. Can we make the code more robust with something like: ``` commitShort := commit if len(commit) > 7 { commitShort = commit[:7] } ... ```
BreizhHardware 2026-05-07 00:29:54 +02:00
Author
Owner

@binwiederhier commented on GitHub (Feb 4, 2026):

This was fixed as part of github.com/binwiederhier/ntfy@856f150958

<!-- gh-comment-id:3848457473 --> @binwiederhier commented on GitHub (Feb 4, 2026): This was fixed as part of https://github.com/binwiederhier/ntfy/commit/856f15095846c0f06275e019b8545276658e2968
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1054
No description provided.