bug#79805: possible missing null check in tostring()

Grisha Levit <[email protected]> Mon, 10 Nov 2025 19:29:16 -0500
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <CAMu=BrqrCKqbAdmLYZkKODUgtR8phA8oair1-Yf+jVkN68_J_Q@mail.gmail.com>
On Mon, Nov 10, 2025, 01:10 Ray steven <[email protected]> wrote:
> Reasoning:
> By default, GMP aborts on allocation failure, but this behavior can be
> changed by registering custom memory functions.

Only if one registers a custom allocation function whose behavior violates
the documented [1] requirement to terminate the program on failure.

    No error return is allowed from any of these functions, if they
    return then they must have performed the specified operation.
    In particular note that allocate_function or reallocate_function
    mustn’t return NULL.

[1] https://gmplib.org/manual/Custom-Allocation