Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add limit configuration tests #650

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

jbowler
Copy link
Contributor

@jbowler jbowler commented Jan 31, 2025

nocompile-limits.dfa: turns off all limits including run-time limits

nolimits.dfa: makes the compile time limits unlimited while leaving on
the run-time limits.

Fixes compiler warnings exposed by these tests. These are just warnings,
there were no bugs other than a failure to handle systems with a 16-bit
at the appropriate time which would result in a later failure on malloc.

png.c: png_icc_check_length: in-line code was still used in place of
png_chunk_max when checking the current chunk allocation limit. The
in-line code did not handle PNG_MAXSEG_64K and, anyway, issued
compiler warnings in the 'nocompile-limits' case. Changed to use
png_malloc_max.

pngrutil.c: eliminated an erroneous 'truncation' warning with GCC-14 by
using a safe cast.

pngtest.c: failed to check for PNG_USER_LIMITS_SUPPORTED around API
calls which don't exist without PNG_USER_LIMITS.

Signed-off-by: John Bowler jbowler@acm.org

nocompile-limits.dfa: turns off all limits including run-time limits

nolimits.dfa: makes the compile time limits unlimited while leaving on
    the run-time limits.

Fixes compiler warnings exposed by these tests. These are just warnings,
there were no bugs other than a failure to handle systems with a 16-bit
at the appropriate time which would result in a later failure on malloc.

png.c: png_icc_check_length: in-line code was still used in place of
    png_chunk_max when checking the current chunk allocation limit.  The
    in-line code did not handle PNG_MAXSEG_64K and, anyway, issued
    compiler warnings in the 'nocompile-limits' case.  Changed to use
    png_malloc_max.

pngrutil.c: eliminated an erroneous 'truncation' warning with GCC-14 by
    using a safe cast.

pngtest.c: failed to check for PNG_USER_LIMITS_SUPPORTED around API
    calls which don't exist without PNG_USER_LIMITS.

Signed-off-by: John Bowler <jbowler@acm.org>
@ctruta ctruta merged commit 812c34c into pnggroup:libpng16 Jan 31, 2025
1 check passed
@jbowler jbowler deleted the add-limit-configuration-tests branch February 1, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants