Stream: git-cranelift

Topic: cranelift / Issue #798 possible unsafety issue


view this post on Zulip GitHub (Feb 28 2020 at 23:26):

alexcrichton transferred Issue #798:

The function cranelift_simplejit::SimpleJITBuilder::symbol (as it's close related friend symbols, and maybe other funcions) take a *const u8 as parameter.
From what I can see, there is no check whatsoever on the value provided before it gets used here.
This function should probably either be marked as unsafe, or take something less permissive than a *const u8 (maybe a NewType whose builder is marked unsafe?). As of now it is possible to pass it a null pointer or a dangling pointer (dropped Vec, pointer to data from an old stack-frame...), and writing to any of those is definitely Undefined Behavior


Last updated: Nov 22 2024 at 16:03 UTC