You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the C level, the open_file method is based on a hack where the libhdfs C structs for the fs and file objects are passed directly to the init method of CoreHdfsFile (a Python object), taking advantage of the fact that the "O" format string in PyArg_Parse* doesn't perform any actual type checking, but rather stores the object as-is. This means that all hell can break loose if a PyObject is passed to the method and, later on, anything is attempted that tries to use the self->file or self->fs refs.
We don't see this much in practice because directly instantiating CoreHdfsFile is explicitly discouraged in the docs, but it's still possible (and not too hard) to break the interpreter due to this.
At the C level, the
open_file
method is based on a hack where thelibhdfs
C structs for the fs and file objects are passed directly to theinit
method ofCoreHdfsFile
(a Python object), taking advantage of the fact that the"O"
format string inPyArg_Parse*
doesn't perform any actual type checking, but rather stores the object as-is. This means that all hell can break loose if aPyObject
is passed to the method and, later on, anything is attempted that tries to use theself->file
orself->fs
refs.We don't see this much in practice because directly instantiating
CoreHdfsFile
is explicitly discouraged in the docs, but it's still possible (and not too hard) to break the interpreter due to this.For instance, this is OK:
But this:
Crashes the JVM with a core dump.
The text was updated successfully, but these errors were encountered: