char asc[2 * HASH2_SIZE + 1];
int ret;
char afsi_buf[AFSI_SIZE];
- char *slpr = buf + read_u32(buf + CAB_LPR_OFFSET);
+ uint32_t slpr_offset = read_u32(buf + CAB_LPR_OFFSET);
+ char *slpr = buf + slpr_offset;
struct afs_info default_afsi = {.last_played = 0};
uint16_t afhi_offset, chunks_offset;
const struct lls_command *cmd = SERVER_CMD_CMD_PTR(ADD);
/* no hs or force mode, child must have sent afhi */
afhi_offset = read_u32(buf + CAB_AFHI_OFFSET_POS);
chunks_offset = read_u32(buf + CAB_CHUNKS_OFFSET_POS);
+ assert(chunks_offset <= slpr_offset);
objs[AFTCOL_AFHI].data = buf + afhi_offset;
objs[AFTCOL_AFHI].size = chunks_offset - afhi_offset;
if (!objs[AFTCOL_AFHI].size) /* "impossible" */
goto out;
objs[AFTCOL_CHUNKS].data = buf + chunks_offset;
- objs[AFTCOL_CHUNKS].size = aca->query.size - chunks_offset;
+ objs[AFTCOL_CHUNKS].size = slpr_offset - chunks_offset;
if (pb && !hs) { /* update pb's hash */
char old_asc[2 * HASH2_SIZE + 1];
unsigned char *old_hash;