Merge lp:~chasedouglas/geis/prevent_device_overrun into lp:geis

Proposed by Chase Douglas
Status: Merged
Merged at revision: 161
Proposed branch: lp:~chasedouglas/geis/prevent_device_overrun
Merge into: lp:geis
Diff against target: 20 lines (+8/-2)
1 file modified
libutouch-geis/backend/xcb/geis_xcb_backend_token.c (+8/-2)
To merge this branch: bzr merge lp:~chasedouglas/geis/prevent_device_overrun
Reviewer Review Type Date Requested Status
Open Input Framework Team Pending
Review via email: mp+73268@code.launchpad.net
To post a comment you must log in.
161. By Chase Douglas

Prevent overrun of devices array in xcb backend token

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend_token.c'
--- libutouch-geis/backend/xcb/geis_xcb_backend_token.c 2011-07-25 14:02:47 +0000
+++ libutouch-geis/backend/xcb/geis_xcb_backend_token.c 2011-08-29 17:51:04 +0000
@@ -434,8 +434,14 @@
434 {434 {
435 GeisInteger device_id = *(GeisInteger*)value;435 GeisInteger device_id = *(GeisInteger*)value;
436 geis_debug("attr name=\"%s\" value=%d", name, device_id);436 geis_debug("attr name=\"%s\" value=%d", name, device_id);
437 t->devices[t->device_count++] = device_id;437 if (t->device_count < MAX_NUM_DEVICES) {
438 status = GEIS_STATUS_SUCCESS;438 t->devices[t->device_count++] = device_id;
439 status = GEIS_STATUS_SUCCESS;
440 }
441 else {
442 geis_warning("too many devices in xcb backend token");
443 status = GEIS_STATUS_UNKNOWN_ERROR;
444 }
439 }445 }
440 else if (0 == strcmp(name, GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH)446 else if (0 == strcmp(name, GEIS_DEVICE_ATTRIBUTE_DIRECT_TOUCH)
441 && op == GEIS_FILTER_OP_EQ)447 && op == GEIS_FILTER_OP_EQ)

Subscribers

People subscribed via source and target branches