This looks like an issue in the current SHA256/512 code, where a pointer outside of the area pointed to may be constructed (this is UB in theory, though in practice every supported platform treats pointers as integers).
Backport of Bitcoin Core PR15950
https://github.com/bitcoin/bitcoin/pull/15950