Merge pull request #1399 from emersion/fix-wl-backend-zero-vla

backend/wayland: fix zero-length VLA
This commit is contained in:
Drew DeVault 2018-11-28 07:41:55 -05:00 committed by GitHub
commit 3033f33a1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,7 +203,7 @@ static void keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard,
uint32_t time = get_current_time_msec();
uint32_t pressed[dev->keyboard->num_keycodes];
uint32_t pressed[dev->keyboard->num_keycodes + 1];
memcpy(pressed, dev->keyboard->keycodes,
dev->keyboard->num_keycodes * sizeof(uint32_t));