6 ms·
ctypes, c extensions, and CFFI are unsafe. Python doesn't have an unsafe keyword like Rustlang. In Python, you can dereference a null pointer and cause a Segm
by westurner 3y ago
ctypes, c extensions, and CFFI are unsafe.
Python doesn't have an unsafe keyword like Rustlang.
In Python, you can dereference a null pointer and cause a Segmentation fault given a ctypes import.
lancedb/lance and/or pandas' dtype_backend="pyarrow" might work with pygame
- Retr0id 3y agoYou don't even need a ctypes import for it, you'll get a segfault from this: eval((lambda:0).__code__.replace(co_consts=())) cpython is not memory safe.
- westurner 3y agoStatic analysis of Python code should include review of "unsafe" things like exec(), eval(), ctypes, c strings, memcpy (*),. Containers are considered nearly sufficient to sandbox Python, which cannot be effectively sandboxed using Python itself. Isn't that actually true for all languages though? There's a RustPython, but it does support CFFI and __builtins__.eval, so
- maple3142 3y agoThe example given by parent does not need eval to trigger though. Just create a function and replace its code object then call it, it will easily segfault.