The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Validate character input

These changes was commited to the Birdfont repository Wed, 07 Oct 2015 18:24:53 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Wed, 07 Oct 2015 18:24:53 +0000]

Updated Files

libbirdfont/TabContent.vala
--- a/libbirdfont/TabContent.vala +++ b/libbirdfont/TabContent.vala @@ -132,6 +132,13 @@ public static void key_press (uint keyval) { if (MenuTab.has_suppress_event ()) { + return; + } + + unichar c = (unichar) keyval; + + if (unlikely (!c.validate ())) { + warning ("Invalid unichar: $(keyval)"); return; } @@ -147,6 +154,13 @@ public static void key_release (uint keyval) { if (MenuTab.has_suppress_event ()) { + return; + } + + unichar c = (unichar) keyval; + + if (unlikely (!c.validate ())) { + warning ("Invalid unichar: $(keyval)"); return; }