From 45f3ab193dfa5c49ab7b61a7ade2eb5e476641d0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 25 Jan 2018 15:33:36 +0000 Subject: [PATCH] * pecoff.c (coff_add): Another memcpy -> coff_read4 fix. From-SVN: r257052 --- libbacktrace/ChangeLog | 4 ++++ libbacktrace/pecoff.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index a035ec36937..ddad6f0ec2f 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,7 @@ +2018-01-25 Ian Lance Taylor + + * pecoff.c (coff_add): Another memcpy -> coff_read4 fix. + 2018-01-24 Ian Lance Taylor * pecoff.c (coff_add): Use coff_read4, not memcpy. diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c index 48bc7ac4492..015887731a0 100644 --- a/libbacktrace/pecoff.c +++ b/libbacktrace/pecoff.c @@ -631,10 +631,10 @@ coff_add (struct backtrace_state *state, int descriptor, goto fail; { - const char *vptr = (const char *)fhdr_view.data; + const unsigned char *vptr = fhdr_view.data; if (vptr[0] == 'M' && vptr[1] == 'Z') - memcpy (&fhdr_off, vptr + 0x3c, 4); + fhdr_off = coff_read4 (vptr + 0x3c); else fhdr_off = 0; } -- 2.30.2