summaryrefslogtreecommitdiff
path: root/test/switchlevels.c
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2025-10-10 13:33:53 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2025-10-21 19:48:30 +0200
commitfa09b0558fd30943a65c45e360703c15ec0a72e3 (patch)
tree0313ba60f23df3d73271ab984b7a20f41f553239 /test/switchlevels.c
parentdb3f23f720efdcf2ef5a453592a0d73d40cada99 (diff)
downloadProject-Tick-fa09b0558fd30943a65c45e360703c15ec0a72e3.tar.gz
Project-Tick-fa09b0558fd30943a65c45e360703c15ec0a72e3.zip
Improve resilience of the functable initialization; during functable init,
make sure none of the function pointers are nullpointers. Up until now, zlib-ng and the application would have segfaulted either at the start of processing, or at some point later depending on when a nullpointer call would happen in the processing. In any case most likely after accepting data from the application. Now, the deflateinit/inflateinit functions will error with Z_VERSION_ERROR, and gzopen will return Z_STREAM_ERROR before actually processing any data. Direct calls to functions like adler32 or crc32 will however print an error message and call abort(), as these functions have no actual way of reporting errors. Note: This should never happen with default builds of zlib-ng, only if it is run on a cpu that is missing both the matching optimized and the generic fallback functions. This can currently only happen if zlib-ng is compiled using custom cflags or by editing the code.
Diffstat (limited to 'test/switchlevels.c')
0 files changed, 0 insertions, 0 deletions