From: Ezra Peisach Date: Fri, 6 Jul 2001 15:51:22 +0000 (+0000) Subject: * sys_term.c (addarg): Cast char to long in indexing array X-Git-Tag: krb5-1.3-alpha1~1233 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=850b49f073460d88daa1f43be7d9ef8a952574f1;p=krb5.git * sys_term.c (addarg): Cast char to long in indexing array git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13570 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index 5a3de7537..abbf6df65 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,7 @@ +2001-07-06 Ezra Peisach + + * sys_term.c (addarg): Cast char to long in indexing array. + 2001-07-01 Ezra Peisach * state.c: Declate doclientstat() static and conditionalize diff --git a/src/appl/telnet/telnetd/sys_term.c b/src/appl/telnet/telnetd/sys_term.c index 7905a29fb..16c66e4ca 100644 --- a/src/appl/telnet/telnetd/sys_term.c +++ b/src/appl/telnet/telnetd/sys_term.c @@ -1409,6 +1409,12 @@ start_login(host, autologin, name) /*NOTREACHED*/ } +/* + * This code returns a pointer to the first element of the array and + * expects the same to be called with. + * Therefore the -1 reference is legal. + */ + static char ** addarg(argv, val) register char **argv; @@ -1428,14 +1434,14 @@ addarg(argv, val) } for (cpp = argv; *cpp; cpp++) ; - if (cpp == &argv[(int)argv[-1]]) { + if (cpp == &argv[(long)argv[-1]]) { --argv; - *argv = (char *)((int)(*argv) + 10); - argv = (char **)realloc(argv, (int)(*argv) + 2); + *argv = (char *)((long)(*argv) + 10); + argv = (char **)realloc(argv, (long)(*argv) + 2); if (argv == NULL) return(NULL); argv++; - cpp = &argv[(int)argv[-1] - 10]; + cpp = &argv[(long)argv[-1] - 10]; } *cpp++ = val; *cpp = 0;