[Bug sanitizer/114494] false-positive with -O2 -Wstringop-overflow=2 -fsanitize=address

akihiko.odaki at daynix dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 27 06:33:28 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114494

--- Comment #3 from Akihiko Odaki <akihiko.odaki at daynix dot com> ---
(In reply to Andrew Pinski from comment #2)
> Note the minimized testcase seems to be a real issue. hlen can either be 1
> (the only value that works) or more than 1.

Below is the the error message for the minimized testcase:

<stdin>: In function 'rtl8139_cplus_transmit_one':
<stdin>:23:5: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
<stdin>:4:11: note: at offset 1 into destination object 'ip_ver_len' of size 1

It does not seem to care if hlen == 1 or not.


More information about the Gcc-bugs mailing list