TheAssemblyArmada / Thyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
584 stars 59 forks source link

Fix memset size in IMEManager::Update_Candidate_List #1150

Open xezon opened 2 months ago

xezon commented 2 months ago

Looks like memset had wrong size.

tomsons26 commented 2 months ago

read https://learn.microsoft.com/en-us/windows/win32/api/imm/nf-imm-immgetcandidatelistcounta

xezon commented 2 months ago

@tomsons26 I still think it is wrong in Thyme. We memset too little of the allocated array. It should be sizeof struct * count, no?

Edit: Ah no.

It should be CANDIDATELIST *list = new CANDIDATELIST[count]; instead of CANDIDATELIST *list = new CANDIDATELIST[size];

xezon commented 2 months ago

Let's try this: #1154