[Bug 2408] XStringToKeysym return cannot possibly be correct

bugzilla-daemon@freedesktop.org bugzilla-daemon@freedesktop.org
Fri Jan 28 10:39:15 PST 2005


Please do not reply to this email: if you want to comment on the bug, go to            
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=2408          
     

Markus.Kuhn@cl.cam.ac.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From Markus.Kuhn@cl.cam.ac.uk  2005-01-28 10:39 -------
Yes, there was a redundant Boolean term left. Cosmetic problem, fixed now in
1.4. Thanks for the repoprt. I also cleaned up the entire boundary-case handling
a bit, to prevent robustly that the Uxxxx notation is abused to generate
non-Unicode or non-Latin-1 keysyms.

--- lib/X11/StrKeysym.c 26 Sep 2004 20:46:18 -0000      1.3
+++ lib/X11/StrKeysym.c 28 Jan 2005 18:31:31 -0000      1.4
@@ -134,16 +134,18 @@
        val = 0;
         for (p = &s[1]; *p; p++) {
             c = *p;
            if ('0' <= c && c <= '9') val = (val<<4)+c-'0';
            else if ('a' <= c && c <= 'f') val = (val<<4)+c-'a'+10;
            else if ('A' <= c && c <= 'F') val = (val<<4)+c-'A'+10;
            else return NoSymbol;
+           if (val > 0x10ffff)
+               return NoSymbol;
        }
+       if (val < 0x20 || (val > 0x7e && val < 0xa0))
+           return NoSymbol;
        if (val < 0x100)
            return val;
-       if (val > 0x10ffff || val < 0x100)
-           return NoSymbol;
         return val | 0x01000000;
     }
-    return (NoSymbol);
+    return NoSymbol;
 }          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list