[PATCH v1 1/3] String: tst-memset-overflow.c Add test for overflow case.

Siddhesh Poyarekar siddhesh@gotplt.org
Tue Jun 8 05:15:56 GMT 2021


On 6/7/21 12:40 PM, Noah Goldstein via Libc-alpha wrote:
> The following commit:
> 
> author	Noah Goldstein <goldstein.w.n@gmail.com>
> Thu, 20 May 2021 17:13:51 +0000 (13:13 -0400)
> commit	6abf27980a947f9b6e514d6b33b83059d39566ae
> 
> added a bug to memset so that if destination +
> length overflowed memset would return early rather than throw a
> Segmentation Fault as is expected behavior:
> 
> This commit adds a new test file: tst-memset-overflow.c that is
> expected to Segmentation Fault if that bug is not present

Similar to the memcmp patch, this is undefined behaviour, it doesn't 
make sense to add a test for this or to explicitly modify memset to 
guarantee a segfault if it has a performance impact.

Patch 2/3 looks like it could be included on its own since the new tests 
don't seem to test undefined behaviour.

Siddhesh


More information about the Libc-alpha mailing list