Skip to content

Commit

Permalink
chore(mac): change bitmapoffset + bitmapsize to prvent buffer problems
Browse files Browse the repository at this point in the history
  • Loading branch information
SabineSIL committed Aug 16, 2024
1 parent dd0ebc4 commit 963bb52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mac/mcompile/keymap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ KMX_DWORD mac_KMX_get_KeyVal_From_KeyCode_dk(const UCKeyboardLayout* keyboard_la
* or else the keyval obtained from Keycode and shiftstate and caps;
*/
KMX_DWORD mac_KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(const UCKeyboardLayout* keyboard_layout, KMX_DWORD kc_underlying, KMX_DWORD vk_ShiftState, PKMX_WCHAR deadKey) {
PKMX_WCHAR dky = NULL;
UInt32 isdk = 0;
KMX_DWORD keyV;
int caps = 0;
Expand All @@ -315,7 +314,9 @@ KMX_DWORD mac_KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(const UCKeyboardLa

// if there was a deadkey return 0xFFFF and copy deadkey into dky; else return the keyvalue
if (isdk != 0) {
dky = (PKMX_WCHAR)(std::u16string(1, keyV)).c_str();
PKMX_WCHAR dky = NULL;
std::u16string keyVS(1, keyV);
dky = (PKMX_WCHAR) keyVS.c_str();
*deadKey = *dky;
return 0xFFFF;
}
Expand Down
3 changes: 3 additions & 0 deletions mac/mcompile/mc_kmxfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ LPKMX_KEYBOARD KMX_CopyKeyboard(PKMX_BYTE bufp, PKMX_BYTE base) {
kbp->dwFlags = ckbp->dwFlags;
kbp->dwHotKey = ckbp->dwHotKey;

kbp->dpBitmapOffset = ckbp->dpBitmapOffset;
kbp->dwBitmapSize = ckbp->dwBitmapSize;

kbp->dpStoreArray = (LPKMX_STORE)bufp;
bufp += sizeof(KMX_STORE) * kbp->cxStoreArray;

Expand Down

0 comments on commit 963bb52

Please sign in to comment.