https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98109
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Bernd Buschinski from comment #4)
> Can someone tell me if this should be a new bug or is just a duplicate?
It's the same bug. The sanitizer transforms the source code into the following
IR (note the 0B argument to my_memmem):
<bb 8> [local count: 390331996]:
if (str_path$buffer_7 == 0B)
goto <bb 9>; [0.00%]
else
goto <bb 14>; [100.00%]
<bb 9> [count: 0]:
__builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data2);
_12 = my_memmem (0B, str_path$length_11, ".abcd", 5); <<< warning here
if (_12 != 0B)
goto <bb 18>; [54.59%]
else
goto <bb 19>; [45.41%]