From 37121e15741525cd69c5d275f07ef18ecc7f2a90 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 24 Mar 2020 00:18:32 +0100 Subject: [PATCH] tiffdump: avoid unaligned memory access fixes #143 fixes #144 --- tools/tiffdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tiffdump.c b/tools/tiffdump.c index 4cdcda0c..8d9b6a73 100644 --- a/tools/tiffdump.c +++ b/tools/tiffdump.c @@ -451,7 +451,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off) { datafits = 0; datamem = NULL; - dataoffset = *(uint64*)dp; + memcpy(&dataoffset, dp, sizeof(uint64)); if (swabflag) TIFFSwabLong8(&dataoffset); }