-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: F2Py Invalid read in string_from_pyobj
#18431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
It is also a bit worrying that it uses |
I can take a look at this, thanks for the heads up, @seberg ! |
This was referenced Apr 12, 2021
pearu
added a commit
to pearu/numpy
that referenced
this issue
May 10, 2021
pearu
added a commit
that referenced
this issue
May 28, 2021
BUG: revise string_from_pyobj/try_pyarr_from_string with respect to malloc and copy.
charris
added a commit
that referenced
this issue
Jun 17, 2021
BUG: revise string_from_pyobj/try_pyarr_from_string with respect to malloc and copy (the second round)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this chunk of code:
numpy/numpy/f2py/cfuncs.py
Lines 652 to 663 in cafda24
F2Py is always copying one byte too much. But it seems that it expects a byte to be copied even for 0 length strings, this is also what happens for normal strings (simple copy, null byte is never reached). My gut feeling would be to copy
*len
and then dump\0
in the last*len
item of the output, but apparently that fails the tests (excerpt):Honestly, I am suprised how few problems there, maybe some vanished recently, but it might be with this fixed (and one more small refcount issue), valgrind may stop complaining about f2py tests.
The text was updated successfully, but these errors were encountered: