mity / mctrl

C library providing set of additional user interface controls for Windows, intended to be complementary to standard Win32API controls from USER32.DLL and COMCTL32.DLL.
http://mctrl.org
235 stars 52 forks source link

[Bug] MC_GM_SETSELECTION with NULL lParam crash #83

Closed matwachich closed 4 years ago

matwachich commented 4 years ago

mCtrl version: 0.11.5 both x86 and x64

Windows version: Windows 10 x64

Describe the bug: Setting lParam = NULL when calling MC_GM_SETSELECTION crashes the application

Is the issue related to building? No

Attachments: Documentation of MC_GM_SETSELECTION states: [in] lParam (MC_GSELECTION*) Pointer to structure describing the selection, or NULL to reset selection.

But when doing this, the application crashes.

I took a look at source code, and I see no NULL pointer check in

static int
grid_set_selection(grid_t* grid, MC_GSELECTION* gsel)
mity commented 4 years ago

Ack. Looking at it.