https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67535
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Thu, Sep 10, 2015 at 09:00:06AM +0000, zeccav at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67535 > > --- Comment #3 from Vittorio Zecca <zeccav at gmail dot com> --- > (In reply to kargl from comment #1) > > > What happens to performance? Simply making changes to > > make sanitizer happy seems rather questionable. It's clear > > from context that if base_name == NULL, then base_name_len > > == 0, and the memcpy should be a NOP. > > How costly is that NOP compared to if(base_name_len)? I don't know. Of course, I'm not the one purposing a change. > > How costly is to let go an undefined behaviour? > It's undefined behavior to pass a NULL pointer into a function?