[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-13 Thread AL
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #13 from AL --- >BTW. The gcc 13 does produce a pretty clear warning for this code if we help >it see the exact length >vbug.c:11:5: warning: ‘strncat’ output truncated before terminating nul >copying 7 bytes from a string of the same

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-10 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #12 from Paul Floyd --- This is one of those things where the more I think about it the more I get confused, at least to start with. I think I can summarize this as dst can point to the nul terminator of src as long as n is less than or

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-10 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #11 from Mark Wielaard --- (In reply to Paul Floyd from comment #9) > > src_orig, \ > > (Addr)dst-(Addr)dst_orig+1, \ > > - (Addr)src-(Addr)src_orig+1)) \ > > +

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 Paul Floyd changed: What|Removed |Added Resolution|--- |FIXED Status|CONFIRMED

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #9 from Paul Floyd --- > src_orig, \ > (Addr)dst-(Addr)dst_orig+1, \ > - (Addr)src-(Addr)src_orig+1)) \ > + n)) \ >

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread AL
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #8 from AL --- > $ gcc -O2 -Wall -g -o vbug vbug.c > vbug.c: In function ‘main’: > vbug.c:10:5: warning: ‘strncat’ accessing between 1 and 9223372036854775805 > bytes at offsets [0, 9223372036854775805] and 0 may overlap 1 byte at offset

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #7 from Paul Floyd --- I don't get any errors with either clang or gcc asan on FreeBSD or Linux. -- You are receiving this mail because: You are watching all bug changes.

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #6 from Paul Floyd --- I can't see anything in the standard that defines overlap. The difference between str(n)cat and functions like memcpy/memmove is that one character gets lost in the process - one of the terminating nulls. -- You are

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #5 from Paul Floyd --- I think that this is incorrect. The C standard says "The initial character of s2 overwrites the null character at the end of s1." In this case we're complaining about just that. I can't see any -- You are

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #4 from Mark Wielaard --- (In reply to AL from comment #3) > My point was that strncat() will never even encounter the terminating '\0' > byte in the source string because its counter (5) will be depleted to 0 > before then (or, in a

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread AL
https://bugs.kde.org/show_bug.cgi?id=401284 --- Comment #3 from AL --- My point was that strncat() will never even encounter the terminating '\0' byte in the source string because its counter (5) will be depleted to 0 before then (or, in a generic case, the '\0' would have been encountered in

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Mark Wielaard
https://bugs.kde.org/show_bug.cgi?id=401284 Mark Wielaard changed: What|Removed |Added CC||m...@klomp.org --- Comment #2 from Mark

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2023-11-09 Thread Paul Floyd
https://bugs.kde.org/show_bug.cgi?id=401284 Paul Floyd changed: What|Removed |Added Ever confirmed|0 |1 Status|REPORTED

[valgrind] [Bug 401284] False positive "Source and destination overlap in strncat"

2018-11-21 Thread AL
https://bugs.kde.org/show_bug.cgi?id=401284 AL changed: What|Removed |Added Version|unspecified |3.11.0 -- You are receiving this mail because: You are