Skip to content

Calling NPPM_GETLANGUAGENAME with a WPARAM value of -1 might crash Npp #12009

@Ekopalypse

Description

@Ekopalypse

When calling NPPM_GETLANGUAGENAME with a WPARAM value of -1, Npp can crash.
I could reproduce this with Npp 8.4.2, but it did not happen with 8.4.4, here memory garbage was returned to me

I assume that the issue manifests in Notepad_plus::getLangDesc(LangType langType, bool getName)
A backtrace when this happens looks like

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff6413bc493 in notepad++!GetNameSpace ()
(gdb) bt
#0  0x00007ff6413bc493 in notepad++!GetNameSpace ()
#1  0x00007ff6413d8f2d in notepad++!GetNameSpace ()
#2  0x00007ff6413dab12 in notepad++!GetNameSpace ()
#3  0x00007ff6413d4ce1 in notepad++!GetNameSpace ()
#4  0x00007ffd14c0e858 in USER32!CallWindowProcW () from C:\WINDOWS\System32\user32.dll
#5  0x00007ffd14c0e3dc in USER32!DispatchMessageW () from C:\WINDOWS\System32\user32.dll
#6  0x00007ffd14c20bc3 in USER32!SendMessageTimeoutW () from C:\WINDOWS\System32\user32.dll
#7  0x00007ffd16ed0d74 in ntdll!KiUserCallbackDispatcher () from C:\WINDOWS\SYSTEM32\ntdll.dll
#8  0x00007ffd14251124 in win32u!NtUserMessageCall () from C:\WINDOWS\System32\win32u.dll
#9  0x00007ffd14c0df02 in USER32!SendMessageW () from C:\WINDOWS\System32\user32.dll
#10 0x00007ffd14c0d68a in USER32!SendMessageW () from C:\WINDOWS\System32\user32.dll
#11 0x00007ffce3751888 in notepadpp__Npp_call (n=..., msg=2107, wparam=18446744073709551615, lparam=0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions