diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2024-08-26 23:51:11 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2024-09-01 13:17:29 -0700 |
commit | f7d01aae6ec6115184de821b93fa47810abd88f9 (patch) | |
tree | 04132b01fdaf4e540e67a1005e2f3d7f2ff79263 /inflate.c | |
parent | 2968a496d9e297b75bee0d0887f94005799b2d07 (diff) | |
download | zlib-f7d01aae6ec6115184de821b93fa47810abd88f9.tar.gz zlib-f7d01aae6ec6115184de821b93fa47810abd88f9.tar.bz2 zlib-f7d01aae6ec6115184de821b93fa47810abd88f9.zip |
Avoid out-of-bounds pointer arithmetic in inflateCopy().
Though it does not matter for code correctness, clang's UBSan
injects code that complains about computing a pointer from an array
where the result is out-of-bounds for that array, even though the
pointer is never dereferenced. Go figure. This commit avoids that
possibility when computing distcode in inflateCopy().
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -923,7 +923,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) { | |||
923 | while (state->have < 19) | 923 | while (state->have < 19) |
924 | state->lens[order[state->have++]] = 0; | 924 | state->lens[order[state->have++]] = 0; |
925 | state->next = state->codes; | 925 | state->next = state->codes; |
926 | state->lencode = (const code FAR *)(state->next); | 926 | state->lencode = state->distcode = (const code FAR *)(state->next); |
927 | state->lenbits = 7; | 927 | state->lenbits = 7; |
928 | ret = inflate_table(CODES, state->lens, 19, &(state->next), | 928 | ret = inflate_table(CODES, state->lens, 19, &(state->next), |
929 | &(state->lenbits), state->work); | 929 | &(state->lenbits), state->work); |