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

            Bug ID: 67535
           Summary: write.c sanitizer detects null pointer passed to
                    memcpy
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

During "make check" a null pointer is sometimes passed to memcpy in
write.c:1877

memcpy (ext_name, base_name, base_name_len);

because base_name == NULL

but base_name_len == 0 so it should be harmless.
To make happy the sanitizer the statement should be

if(base_name_len) memcpy (ext_name, base_name, base_name_len);

Reply via email to