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
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
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)) \
> > +
https://bugs.kde.org/show_bug.cgi?id=401284
Paul Floyd changed:
What|Removed |Added
Resolution|--- |FIXED
Status|CONFIRMED
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)) \
>
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
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.
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
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
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
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
https://bugs.kde.org/show_bug.cgi?id=401284
Mark Wielaard changed:
What|Removed |Added
CC||m...@klomp.org
--- Comment #2 from Mark
https://bugs.kde.org/show_bug.cgi?id=401284
Paul Floyd changed:
What|Removed |Added
Ever confirmed|0 |1
Status|REPORTED
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
14 matches
Mail list logo