--- embedaddon/sudo/common/ttysize.c 2013/07/22 10:46:11 1.1.1.2 +++ embedaddon/sudo/common/ttysize.c 2014/06/15 16:12:54 1.1.1.3 @@ -33,9 +33,11 @@ # include #endif /* HAVE_UNISTD_H */ #include +#include #include "missing.h" #include "sudo_debug.h" +#include "sudo_util.h" /* Compatibility with older tty systems. */ #if !defined(TIOCGWINSZ) && defined(TIOCGSIZE) @@ -77,10 +79,14 @@ get_ttysize(int *rowp, int *colp) char *p; /* Fall back on $LINES and $COLUMNS. */ - if ((p = getenv("LINES")) == NULL || (*rowp = atoi(p)) <= 0) + if ((p = getenv("LINES")) == NULL || + (*rowp = strtonum(p, 1, INT_MAX, NULL)) <= 0) { *rowp = 24; - if ((p = getenv("COLUMNS")) == NULL || (*colp = atoi(p)) <= 0) + } + if ((p = getenv("COLUMNS")) == NULL || + (*colp = strtonum(p, 1, INT_MAX, NULL)) <= 0) { *colp = 80; + } } debug_return;