switch-coreboot/util/ifdtool
Ronald G. Minnich 33d4ebe304 UPSTREAM: ifdtool: avoid potential unaligned pointer usage
In get_region, ifdtool assigns a not-known-to-be-aligned
pointer to a uint32_t *. Now you know and I know that it is
almost certainly aligned, but clang on OSX doesn't like this,
and it's a dicey thing to do in any event, just waiting
to hit someone hard at some future date.

Assign the pointer to a void * and use memmove to copy
the value to a uint32_t.

This usage is more portable to all little-endian architectures,
now, but is still not endian-safe. I doubt we'll ever care.

BUG=none
BRANCH=none
TEST=none

Change-Id: I85be85b9e78c74dde72584f848441a6ddd0ec0c2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 8db3c2a485
Original-Change-Id: Ifb2f260c3363ab0f5b4a59e5a4e0b5ecf049fa96
Original-Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/19921
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://chromium-review.googlesource.com/522709
2017-06-02 10:38:55 -07:00
..
ifdtool.c UPSTREAM: ifdtool: avoid potential unaligned pointer usage 2017-06-02 10:38:55 -07:00
ifdtool.h UPSTREAM: ifdtool: Add option to specify platform (-p) quirks 2016-11-08 23:24:23 -08:00
Makefile UPSTREAM: ifdtool/Makefile: use static dependencies 2016-09-13 22:20:19 -07:00