Skip to content

scintilla: buffer: fixed invalid read in the stack when loading a file#144

Merged
donho merged 1 commit intonotepad-plus-plus:masterfrom
milipili:fix-invalid-stack-read-when-loading-file
Jun 1, 2015
Merged

scintilla: buffer: fixed invalid read in the stack when loading a file#144
donho merged 1 commit intonotepad-plus-plus:masterfrom
milipili:fix-invalid-stack-read-when-loading-file

Conversation

@milipili
Copy link
Contributor

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).

This patch actually follows #145 but they are independant

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`).
@milipili
Copy link
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.

@milipili milipili added the bug label May 30, 2015
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
@donho donho merged commit 6df7762 into notepad-plus-plus:master Jun 1, 2015
@milipili milipili modified the milestone: 6.x Jun 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants