Bug 216590
Summary: | gcc -O2 -D_FORTIFY_SOURCE=2 truncates string | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Richard Chan <rc556677> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2006-11-21 07:35:35 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Richard Chan
2006-11-21 07:03:30 UTC
The testcase is invalid. Please read: http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html "If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined." That's the exact case here, and any result is conforming undefined behavior. ISO C99 has similar wording for this. Aaaah - tks - audacious in Fedora Extras uses exactly this (undefined) construct and is generating bad strings. ./Plugins/Input/cdaudio/cddb.c sprintf(buffer, "%s+%d", buffer, LBA(info->track[i])); .... this is how I encountered the problem. I have referred this bug to audacious maintainer (see 216571) and upstream. |