scintilla: buffer: fixed invalid read in the stack when loading a file#144
Merged
donho merged 1 commit intonotepad-plus-plus:masterfrom Jun 1, 2015
milipili:fix-invalid-stack-read-when-loading-file
Merged
scintilla: buffer: fixed invalid read in the stack when loading a file#144donho merged 1 commit intonotepad-plus-plus:masterfrom milipili:fix-invalid-stack-read-when-loading-file
donho merged 1 commit intonotepad-plus-plus:masterfrom
milipili:fix-invalid-stack-read-when-loading-file
Conversation
The method `FileManager::loadFileData` uses a stack-based buffer for reading a file. However, due to the optimization used by `Utf8_16_Read` (`UnicodeConvertor`), this buffer is not copied, but a pointer to this object is kept. After `loadFileData`, this object is destroyed, but is used afterward (via `UnicodeConvertor.getNewBuf`).
Contributor
Author
|
This patch does not fully satisfy me (the additional parameter should not be required) but the objective was to provide a simple fix. This code may require some refactoring for a more proper design. |
donho
added a commit
that referenced
this pull request
Jun 1, 2015
…ding-file [BUG_FIXED] buffer: fixed invalid read in the stack when loading a file
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The method
FileManager::loadFileDatauses a stack-based buffer for readinga file. However, due to the optimization used by
Utf8_16_Read(UnicodeConvertor),this buffer is not copied, but a pointer to this object is kept.
After
loadFileData, this object is destroyed, but is used afterward(via
UnicodeConvertor.getNewBuf).This patch actually follows #145 but they are independant