-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: read error while invoking formatter API from Python
The `pyo3-file` crate doesn't accept buffers that are shorter than 4 bytes (https://github.com/omerbenamram/pyo3-file/blob/415def8ebdc93899aa130cc23d75afa8baf0349b/src/lib.rs#L102-L106), this causes an issue when an empty vector is passed to the `read` function implemented by `pyo3-file`. This happens at https://github.com/VirusTotal/yara-x/blob/18e2707e2824440ba7878ee6e80308daf75c631c/fmt/src/lib.rs#L344. The issue is fixed by forcing the vector to have some initial capacity larger than 4 bytes. Closes #299
- Loading branch information
Showing
2 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters