Skip to content

Commit

Permalink
Fix OOB read in inflate_kernel (#15309)
Browse files Browse the repository at this point in the history
Issue #15216

Avoids an OOB read; the read was not causing bugs as the read data was never used.

Addresses the memcheck part of #15216

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Muhammad Haseeb (https://github.com/mhaseeb123)

URL: #15309
  • Loading branch information
vuule authored Mar 15, 2024
1 parent 610c022 commit f305a55
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cpp/src/io/comp/gpuinflate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,7 @@ __device__ void process_symbols(inflate_state_s* s, int t)
dist = symbol >> 16;
for (int i = t; i < len; i += 32) {
uint8_t const* src = out + ((i >= dist) ? (i % dist) : i) - dist;
uint8_t b = (src < outbase) ? 0 : *src;
if (out + i < outend) { out[i] = b; }
if (out + i < outend and src >= outbase) { out[i] = *src; }
}
out += len;
pos++;
Expand Down

0 comments on commit f305a55

Please sign in to comment.