]> Git Repo - secp256k1.git/commit
Return NULL early in context_preallocated_create if flags invalid
authorTim Ruffing <[email protected]>
Mon, 26 Oct 2020 13:38:30 +0000 (14:38 +0100)
committerTim Ruffing <[email protected]>
Tue, 27 Oct 2020 14:03:21 +0000 (15:03 +0100)
commitebfa2058e9cc2999dada47d2f1e1e5c0f4bcf619
tree6d24d744bee35a2f9c69a5762145bc5f582e9472
parentac05f61fcf639a15b5101131561620303e4bd808
Return NULL early in context_preallocated_create if flags invalid

If the user passes invalid flags to _context_create, and the default
illegal callback does not abort the program (which is possible), then we
work with the result of malloc(0), which may be undefined behavior. This
violates the promise that a library function won't crash after the
illegal callback has been called.

This commit fixes this issue by returning NULL early in _context_create
in that case.
src/secp256k1.c
This page took 0.026871 seconds and 4 git commands to generate.