Skip to content

Commit

Permalink
Apply upstream PR ianlancetaylor#105
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonjh committed Feb 2, 2023
1 parent 6cea960 commit cc9b2e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pecoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ coff_add (struct backtrace_state *state, int descriptor,
magic_ok = memcmp (magic, "PE\0", 4) == 0;
fhdr_off += 4;

memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr);
memcpy (&fhdr, magic + 4, sizeof fhdr);
}
else
{
Expand Down Expand Up @@ -682,7 +682,7 @@ coff_add (struct backtrace_state *state, int descriptor,
sects_view_valid = 1;
opt_hdr = (const b_coff_optional_header *) sects_view.data;
sects = (const b_coff_section_header *)
(sects_view.data + fhdr.size_of_optional_header);
(void *)((const char *)sects_view.data + fhdr.size_of_optional_header);

is_64 = 0;
if (fhdr.size_of_optional_header > sizeof (*opt_hdr))
Expand Down Expand Up @@ -726,7 +726,7 @@ coff_add (struct backtrace_state *state, int descriptor,
goto fail;
syms_view_valid = 1;

str_size = coff_read4 (syms_view.data + syms_size);
str_size = coff_read4 ((const unsigned char *)syms_view.data + syms_size);

str_off = syms_off + syms_size;

Expand Down

0 comments on commit cc9b2e3

Please sign in to comment.