From dfc9a50fcf76896fca5315b2125b5f3a6c4aa44f Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Fri, 17 Jul 2015 10:01:17 +0800 Subject: [PATCH] Fix CID#39903 Unchecked return value. --- bind.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/bind.c b/bind.c index fbc3bff..9733fff 100644 --- a/bind.c +++ b/bind.c @@ -435,22 +435,24 @@ static int strinc( char *source, char *sub) { * int mflag; going for a meta sequence? */ static unsigned int getckey( int mflag) { - unsigned int c; /* character fetched */ + unsigned int c ; /* character fetched */ /* check to see if we are executing a command line */ - if (clexec) { + if( clexec) { char tok[ NSTRING] ; /* command incoming */ - macarg( tok, sizeof tok) ; /* get the next token */ - return stock(tok); - } + if( TRUE != macarg( tok, sizeof tok)) /* get the next token */ + c = 0 ; /* return dummy key on failure */ + else + c = stock( tok) ; + } else { /* or the normal way */ + if( mflag) + c = get1key() ; + else + c = getcmd() ; + } - /* or the normal way */ - if (mflag) - c = get1key(); - else - c = getcmd(); - return c; + return c ; } /*