From: Todd C. Miller Date: Mon, 7 Jun 2010 22:53:28 +0000 (-0400) Subject: Add #define for maximum session id X-Git-Tag: SUDO_1_7_3~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1ad52f53a82b3613f7ef99065d6292af2078526;p=sudo Add #define for maximum session id --HG-- branch : 1.7 --- diff --git a/iolog.c b/iolog.c index 33a4f6c96..51287602f 100644 --- a/iolog.c +++ b/iolog.c @@ -75,6 +75,12 @@ struct script_buf { #define IOFD_TIMING 5 #define IOFD_MAX 6 +#ifdef __STDC__ +# define SESSID_MAX 2176782336U +#else +# define SESSID_MAX (unsigned long)2176782336 +#endif + static sigset_t ttyblock; static struct timeval last_time; static union io_fd io_fds[IOFD_MAX]; @@ -120,7 +126,7 @@ io_nextid() if (nread == -1) log_error(USE_ERRNO, "cannot read %s", pathbuf); id = strtoul(buf, &ep, 36); - if (buf == ep || id >= (unsigned long)2176782336) + if (buf == ep || id >= SESSID_MAX) log_error(0, "invalid sequence number %s", pathbuf); } id++;