https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80365
--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> --- Or you may add assert(buf); just before the memcpy library call. If nbyte==0 then it should be harmless, but undefined. assert(buf || !nbyte) should catch an error situation