#496 Bugfix: overwriting memory

Next_major_release
closed
nobody
None
8
2013-07-10
2013-07-05
No

https://sourceforge.net/p/notepad-plus/bugs/4386/

You can reproduce this in various ways, for instance:

1) Open the Find dialog.
2) Press Count.
3) Press "Find All in Current Document".
4) Open Find again.
5) Observe garbage letters in status bar of the find dialog. (I actually got it to display "notepad++" once).

The problem is this: you set the status bar by sending SB_SETTEXT with a pointer to a string. When FindReplaceDlg::drawItem() is called, the text pointer in LPDRAWITEMSTRUCT points to the same address as the "old" pointer. Depending on scopes etc you get this unwanted behavior.

Solution: save a copy of the last set status bar text in the status bar object.

1 Attachments

Discussion

  • Andreas Jonsson

    Andreas Jonsson - 2013-07-05

    Here is "notepad++.exe" displayed in the status bar of the find dialog...

     
  • Don HO

    Don HO - 2013-07-07
    • Priority: 5 --> 8
     
  • Don HO

    Don HO - 2013-07-07
    • status: open --> accepted
     
  • Don HO

    Don HO - 2013-07-10
    • status: accepted --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks