https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101758
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- UBSAN_NULL doesn't check just whether it is non-NULL, but also the alignment. So no, this doesn't look like the right fix.
jakub at gcc dot gnu.org via Gcc-bugs Tue, 03 Aug 2021 11:17:33 -0700
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101758
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- UBSAN_NULL doesn't check just whether it is non-NULL, but also the alignment. So no, this doesn't look like the right fix.