Skip to content

Commit

Permalink
Fix -Waddress-of-packed-member in explode.c
Browse files Browse the repository at this point in the history
    explode.c: In function ‘libmpq__do_decompress_pkzip’:
    explode.c:542:73: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
     542 |  mpq_pkzip->in_bytes   = mpq_pkzip->read_buf((char *)mpq_pkzip->in_buf, &mpq_pkzip->in_pos, mpq_pkzip->param);
  • Loading branch information
glebm committed Nov 1, 2021
1 parent f5f60c0 commit 29cc1fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libmpq/explode.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,10 @@ uint32_t libmpq__do_decompress_pkzip(uint8_t *work_buf, void *param) {
mpq_pkzip->read_buf = data_read_input;
mpq_pkzip->write_buf = data_write_output;
mpq_pkzip->param = param;
mpq_pkzip->in_pos = sizeof(mpq_pkzip->in_buf);
mpq_pkzip->in_bytes = mpq_pkzip->read_buf((char *)mpq_pkzip->in_buf, &mpq_pkzip->in_pos, mpq_pkzip->param);

uint32_t in_pos = sizeof(mpq_pkzip->in_buf);
mpq_pkzip->in_bytes = mpq_pkzip->read_buf((char *)mpq_pkzip->in_buf, &in_pos, mpq_pkzip->param);
mpq_pkzip->in_pos = in_pos;

/* check if we have pkzip data. */
if (mpq_pkzip->in_bytes <= 4) {
Expand Down

0 comments on commit 29cc1fa

Please sign in to comment.