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: Dec 23 2024 at 14:03 UTC