diff options
-rw-r--r-- | src/appl/telnet/libtelnet/ChangeLog | 4 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/kerberos.c | 17 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/kerberos5.c | 17 |
3 files changed, 20 insertions, 18 deletions
diff --git a/src/appl/telnet/libtelnet/ChangeLog b/src/appl/telnet/libtelnet/ChangeLog index fa3a269ada..9014036daa 100644 --- a/src/appl/telnet/libtelnet/ChangeLog +++ b/src/appl/telnet/libtelnet/ChangeLog @@ -1,3 +1,7 @@ +2002-03-26 Sam Hartman <hartmans@mit.edu> + + * kerberos.c kerberos5.c (Data): Fix indentation; fix termination condition + 2002-03-14 Sam Hartman <hartmans@mit.edu> * 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 06233ebcd0..a4970fef1a 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 8041d1f0c6..50c3742fab 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; |