summaryrefslogtreecommitdiff
path: root/fmt-merge-msg.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-07-16 14:17:37 +0200
committerJunio C Hamano <gitster@pobox.com>2017-07-17 14:56:16 -0700
commit268ba20110f9e6aca3a7bf8b256f7a8fbfd2dab9 (patch)
tree23c369ba892f84cbdffdbc7d09e12fa20dc82e34 /fmt-merge-msg.h
parent95d67879735cfecfdd85f89e59d993c5b4de8835 (diff)
downloadgit-268ba20110f9e6aca3a7bf8b256f7a8fbfd2dab9.tar.gz
dir: support platforms that require aligned readsrs/stat-data-unaligned-reads-fix
The untracked cache is stored on disk by concatenating its memory structures without any padding. Consequently some of the structs are not aligned at a particular boundary when the whole extension is read back in one go. That's only OK on platforms without strict alignment requirements, or for byte-aligned data like strings or hash values. Decode struct ondisk_untracked_cache carefully from the extension blob by using explicit pointer arithmetic with offsets, avoiding alignment issues. Use char pointers for passing stat_data objects to stat_data_from_disk(), and use memcpy(3) in that function to get the contents into a properly aligned struct, then perform the byte-order adjustment in place there. Found with Clang's UBSan. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fmt-merge-msg.h')
0 files changed, 0 insertions, 0 deletions