bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ptrdiff_t overflow checks for malloc-posix etc.


From: Bruno Haible
Subject: Re: ptrdiff_t overflow checks for malloc-posix etc.
Date: Sun, 18 Apr 2021 22:23:19 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

> > How about extending the unit test (tests/test-malloc-gnu.c) accordingly?
> 
> Won't that raise the possibility of the tests being too expensive, in 
> case the C library actually attempts to allocate PTRDIFF_MAX + 1 bytes?

In those cases where our code has a bug and the xalloc_oversized test in
malloc.c is not effective, yes, the test program may allocate a lot of memory.
If we put the test in a module that is marked as

    Status:
    privileged-test

normal users will never get to execute this test.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]