notepad-plus-plus/PowerEditor
Don HO 10f6ff6c1f
Fix a crash (regression) due to "new-less" of NppParameters
The commit 'Make NppParameters singleton "new-less"' make NppParameters instantiate in the stack instead of allocating in the heap:
3dbb2c4b8e

It makes Notepad++ crash:
https://community.notepad-plus-plus.org/topic/18316/notepad-7-8-release-candidate-3/4

The crash is on following code:

  vector<MacroShortcut> & vShortcuts = NppParameters::getInstance().getMacroList();
  size_t nbItems = vShortcuts.size();
  for (size_t itemIndex2 = 0; itemIndex2 < nbItems; ++itemIndex2)
  {
  ...

vShortcuts.size() here return a random large number, which makes crash.

The explanation about vector::size() unexpected behaviour:
https://stackoverflow.com/questions/30548944/c-vector-size-is-wrong-and-higher-than-the-number-of-elements

Obviously the stack size is not large enough to contain NppParameters singleton in 64 bits.
2019-10-03 14:05:50 +02:00
..
Test/FunctionList
bin Code enhancement: Use C++11 =default & =delete for the constructor & destructor 2019-08-19 02:05:21 +02:00
gcc
installer Fix include new release files problem 2019-10-02 03:36:26 +02:00
misc/chameleon
scintilla.original.forUpdating
src Fix a crash (regression) due to "new-less" of NppParameters 2019-10-03 14:05:50 +02:00
visual.net Use standard C++11 mutex 2019-08-25 23:34:30 +02:00