Menu

#49 Compatibility with _FORTIFY_SOURCE=3

Unstable_(example)
open
nobody
None
5
2024-10-09
2024-10-09
Ken Rossato
No

On my distro (Fedora) attempting to perform any operations with actual files causes gtkpod to crash. This is due to the distro compiling packages with -D_FORTIFY_SOURCE=3, which is a GCC/glibc flag that adds extra bounds checking. The offending line triggers on the last loop of any SHA calculation, when snprintf attempts to write the last 3 characters (two hex and a null terminator) to an array with 3 bytes remaining, but using an argument of 4 to snprintf, which is sufficient to trigger termination even though 4 bytes are never actually written.

Background information on _FORTIFY_SOURCE=3: https://developers.redhat.com/articles/2022/09/17/gccs-new-fortification-level
Fedora gtkpod bug (with backtrace): https://bugzilla.redhat.com/show_bug.cgi?id=2256643

I will submit the same patch to Fedora for inclusion there until included in a new gtkpod release (since without the patch gtkpod is effectively unusable).

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.