about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-02-22 20:41:13 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-02-23 09:51:02 -0500
commit478cf8b3a455db83473d89f8d856ae309974e4ee (patch)
tree7278228180517e8152233f899aa5b138c01e192d /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parent5bd1ec3283874b97b27da4539b2950fbd01c4b0e (diff)
downloadrust-478cf8b3a455db83473d89f8d856ae309974e4ee.tar.gz
rust-478cf8b3a455db83473d89f8d856ae309974e4ee.zip
fs: Don't dereference a pointer to a too-small allocation
ptr::addr_of!((*ptr).field) still requires ptr to point to an
appropriate allocation for its type.  Since the pointer returned by
readdir() can be smaller than sizeof(struct dirent), we need to entirely
avoid dereferencing it as that type.

Link: https://github.com/rust-lang/miri/pull/1981#issuecomment-1048278492
Link: https://github.com/rust-lang/rust/pull/93459#discussion_r795089971
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions