Bug 1127031
Summary: | bug in GCC/G++ or Runtime Libraray | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Sergey <ska> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | qe-baseos-tools-bugs |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.5 | CC: | mfranc, mpolacek |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-08-06 04:29:44 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Sergey
2014-08-06 01:45:50 UTC
I agree there's a bug, but only in your code. Calling strcpy with overlapping strings is an undefined behaviour. Yeah. See e.g. ISO C99, 7.21.2.3/2: "If copying takes place between objects that overlap, the behavior is undefined.", or http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcpy.html (or man 3p strcpy) for the same wording. Well, I agree, you are FORMALLY right :-( And it's well known for memcpy which has memmove for that purposes, but strcpy was working fine on all platforms I know since 1982, including previous version of RedHat, and unfortunately it is all over some old code :-( No problem. Will replace strcpy. Regards, Sergey |