summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2002-03-27 02:48:43 +0000
committerSam Hartman <hartmans@mit.edu>2002-03-27 02:48:43 +0000
commitf61084dde25fe7e2701ac59a468b6a15b0650ac5 (patch)
tree34c5658860b98cb95a0084fac856fe8d4b4d891e
parentc1632cd8d0f48e2af7cacb5b47210c0b05d358cc (diff)
downloadkrb5-f61084dde25fe7e2701ac59a468b6a15b0650ac5.tar.gz
krb5-f61084dde25fe7e2701ac59a468b6a15b0650ac5.tar.xz
krb5-f61084dde25fe7e2701ac59a468b6a15b0650ac5.zip
Updated telnet patch
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14295 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/appl/telnet/libtelnet/ChangeLog4
-rw-r--r--src/appl/telnet/libtelnet/kerberos.c17
-rw-r--r--src/appl/telnet/libtelnet/kerberos5.c17
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;