This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix gcc -fsanitize=nonnull-attribute issues


GCC 5.1 includes -fsanitize=nonnull-attribute in -fsanitize=undefined.
This showed a couple of places where we were passing a NULL argument
to functions not expecting them. Even though these functions might not
actually use the argument (if for example the size argument of a buffer
is zero), gcc might use the information to assume the passed in variables
are always nonnull, which might cause unexpected optimizations.

 libdwfl: Check file_name is not NULL before calling canonicalize_file_name.
 libelf: Don't call mempcpy with possible NULL d_buf.
 libelf: Don't call memmove with possible NULL buffer.
 elfcmp: Don't call memcmp with possible NULL d_buf.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]