Re: [PATCH 1/2] Fix nonnull errors reported by UBSAN with GCC 7.
- From
Jeff King <peff@peff.net>
- Date
- Apr 6, 2017, 08:34 UTC
- Message-ID
- <20170406083425.7psdmrploxar3h6v@sigill.intra.peff.net>
- In-Reply-To
- <295981e7-d2e9-d3db-e32d-8dd80ca47136@suse.cz>
On Thu, Apr 06, 2017 at 10:02:22AM +0200, Martin Liška wrote:
> Subject: [PATCH 1/2] Fix nonnull errors reported by UBSAN with GCC 7. > > Memory functions like memmove and memcpy should not be called > with an argument equal to NULL.
Yeah, makes sense. Your fixes are obviously correct. In other cases we've added wrappers like sane_qsort() that do the size check automatically. I'm not sure if we'd want to do the same here.
Either way, it probably makes sense to take this as a quick fix and worry about refactoring as a possible patch on top.
Thanks.
-Peff