This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/85310] optimization ignoring strlen() results
- From: "kees at outflux dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Apr 2018 05:23:51 +0000
- Subject: [Bug c/85310] optimization ignoring strlen() results
- Auto-submitted: auto-generated
- References: <bug-85310-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310
--- Comment #4 from Kees Cook <kees at outflux dot net> ---
But it's optimizing away the check. If strlen() were suddenly acting like
strnlen(), that'd be one thing, but the return value from strlen() is being
used by the memcpy() without the actual test in between. That's not sensible.