From: Michael Jerris Date: Mon, 2 Jun 2014 14:10:59 +0000 (+0000) Subject: CID:1216560 Unchecked return value from ioctl X-Git-Tag: v1.4.6~1^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e992c4c4d823dae494a90ea0141f763b4f5d4df1;p=thirdparty%2Ffreeswitch.git CID:1216560 Unchecked return value from ioctl --- diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index b7b764427d..55b299b570 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -139,10 +139,10 @@ static void screen_size(int *x, int *y) #elif defined(TIOCGWINSZ) struct winsize w; - ioctl(0, TIOCGWINSZ, &w); - - if (x) *x = w.ws_col; - if (y) *y = w.ws_row; + if ( (ioctl(0, TIOCGWINSZ, &w)) >= 0 ) { + if (x) *x = w.ws_col; + if (y) *y = w.ws_row; + } #else if (x) *x = 80; if (y) *y = 24;