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
{{ message }}
Repository navigation
Harden feed_data() buffer handling for memoryview input #157
I'm opening this mainly to ask whether you consider it worth fixing.
These are corner cases that I handcrafted, and practically, they cannot be triggered by data coming off the network; only by how the calling code handles the object it passes to feed_data().
If you'd rather keep the current fast path, feel free to close this.
feed_data() has a fast path for memoryview that borrows the view's internal Py_buffer instead of acquiring an export of its own (parser.pyx:213-220):
Because no export is held, nothing keeps the memory valid while llhttp reads it, and the view is never validated.
If the view is released before or during the call (for example by a callback that recycles a receive buffer), llhttp reads freed memory:
Activity