Re: [dev] Re: [st] [PATCH] Avoid buffer overflows in the case of key-mapped strings.

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 7 Oct 2013 21:17:43 +0200

         for(mk = mshortcuts; mk < mshortcuts + LEN(mshortcuts); mk++) {
                 if(e->xbutton.button == mk->b
- && match(mk->mask, e->xbutton.state)) {
+ && match(mk->mask, e->xbutton.state)
+ && mk->s) {
                         ttysend(mk->s, strlen(mk->s));
                         return;

mk->s is a string that are assigned in config.h, so I don't think we
should check aginst NULL, because the only way it becomes NULL is
a stupid user who put a NULL in it, and this case let to the luser
get a good BOOOOOM!

What do you think?


-- 
Roberto E. Vargas Caballero
----------------------------
k0ga_AT_shike2.com
http://www.shike2.com
Received on Mon Oct 07 2013 - 21:17:43 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 07 2013 - 21:24:12 CEST