From: Sam Hartman Date: Wed, 27 Mar 2002 02:48:43 +0000 (+0000) Subject: Updated telnet patch X-Git-Tag: krb5-1.3-alpha1~816 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f61084dde25fe7e2701ac59a468b6a15b0650ac5;p=krb5.git Updated telnet patch git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14295 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/telnet/libtelnet/ChangeLog b/src/appl/telnet/libtelnet/ChangeLog index fa3a269ad..9014036da 100644 --- a/src/appl/telnet/libtelnet/ChangeLog +++ b/src/appl/telnet/libtelnet/ChangeLog @@ -1,3 +1,7 @@ +2002-03-26 Sam Hartman + + * kerberos.c kerberos5.c (Data): Fix indentation; fix termination condition + 2002-03-14 Sam Hartman * kerberos5.c kerberos.c (Data): Don't overflow diff --git a/src/appl/telnet/libtelnet/kerberos.c b/src/appl/telnet/libtelnet/kerberos.c index 06233ebcd..a4970fef1 100644 --- a/src/appl/telnet/libtelnet/kerberos.c +++ b/src/appl/telnet/libtelnet/kerberos.c @@ -161,15 +161,14 @@ Data(ap, type, d, c) *p++ = type; spaceleft -= 3; while (c-- > 0) { -if ((*p++ = *cd++) == IAC) { -*p++ = IAC; -spaceleft--; -} -if (--spaceleft <= 4) { -errno = ENOMEM; -return -1; -} - + if ((*p++ = *cd++) == IAC) { + *p++ = IAC; + spaceleft--; + } + if ((--spaceleft < 4)&&c) { + errno = ENOMEM; + return -1; + } } *p++ = IAC; *p++ = SE; diff --git a/src/appl/telnet/libtelnet/kerberos5.c b/src/appl/telnet/libtelnet/kerberos5.c index 8041d1f0c..50c3742fa 100644 --- a/src/appl/telnet/libtelnet/kerberos5.c +++ b/src/appl/telnet/libtelnet/kerberos5.c @@ -156,15 +156,14 @@ Data(ap, type, d, c) *p++ = type; spaceleft -= 3; while (c-- > 0) { -if ((*p++ = *cd++) == IAC) { -*p++ = IAC; -spaceleft--; -} -if (--spaceleft <= 4) { -errno = ENOMEM; -return -1; -} - + if ((*p++ = *cd++) == IAC) { + *p++ = IAC; + spaceleft--; + } + if ((--spaceleft < 4)&&c) { + errno = ENOMEM; + return -1; + } } *p++ = IAC; *p++ = SE;