The Birdfont Source Code


All Repositories / birdfont.git / commit – 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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 07 Oct 2015 18:24:53 +0000 (20:24 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 07 Oct 2015 20:24:38 +0000 (22:24 +0200)
commit bd709a51289bd75410160de665184c1d5e03aca6
tree bb9f41c47750a74660451cdfb956044ce2530a8c
parent d2c625866e82560fa3dd7b0bbcd3beafdd830d27
Validate character input

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; }