After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 338254 - control-center settings daemon may overrun mouse button mapping buffer in unusual circumstances
control-center settings daemon may overrun mouse button mapping buffer in unu...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] settings-daemon
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-12 17:58 UTC by Ray Strode [halfline]
Modified: 2006-05-26 05:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
When swapping buttons, if one of them isn't mapped, only map it and not the other one (1.06 KB, patch)
2006-04-13 06:07 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2006-04-12 17:58:15 UTC
Hi,

Today I was doing a bugzilla query and ran across bug 323724.  The patch applied to resolve that bug looks good overall, but there may be a corner case where it could overwrite a byte of memory that it isn't supposed to.

The patch has:

+      /* find the right button */
+      for (i = 0; i < n_buttons; i++)
+        {
+          if (buttons[i] == right_button)
+              break;
+      }
+      /* swap the buttons */
+      buttons[left_button - 1] = right_button;
+      buttons[i] = left_button;

when going to left handed mode (and something similiar when going to right handed mode).  buttons[] is n_buttons bytes long.  If the "buttons[i] == right_button" never succeeds then the loop will end with i == n_buttons, and then the button[i] = left_button will write to memory that is out of bounds.
Comment 1 Ray Strode [halfline] 2006-04-13 06:07:31 UTC
Created attachment 63357 [details] [review]
When swapping buttons, if one of them isn't mapped, only map it and not the other one
Comment 2 Rodrigo Moya 2006-04-17 11:12:06 UTC
If this fixes it, please feel free to commit
Comment 3 Ray Strode [halfline] 2006-04-17 15:13:03 UTC
commited to HEAD and gnome-2-14:

2006-04-17  Ray Strode <rstrode@redhat.com>

        * gnome-settings-mouse.c (configure_button_layout): fix
        potential (tiny, hard to trigger) overrun (bug 338254)
Comment 4 Jeremy Nickurak 2006-05-26 05:56:27 UTC
I just filed bug 342980, which seems to be the same problem under 2.14.1 with the patche from this bug applied to it.