summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2001-07-25 10:26:42 +0000
committerEzra Peisach <epeisach@mit.edu>2001-07-25 10:26:42 +0000
commite17f6194d3b238d4dfb67f14a9b18f3449ab5975 (patch)
tree76ea43174d239e5205cc5100987f224c985f47ad
parentad7ee54b12e5f479f561a889a994d869081ebf4d (diff)
downloadkrb5-e17f6194d3b238d4dfb67f14a9b18f3449ab5975.tar.gz
krb5-e17f6194d3b238d4dfb67f14a9b18f3449ab5975.tar.xz
krb5-e17f6194d3b238d4dfb67f14a9b18f3449ab5975.zip
* rc_dfl.c (krb5_rc_io_fetch): Once length element read from
cache, and verified to be positive, put into unsigned int variable for passing to other functions that expect such. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13638 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/rcache/ChangeLog6
-rw-r--r--src/lib/krb5/rcache/rc_dfl.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog
index 36372cc033..103f9b5c76 100644
--- a/src/lib/krb5/rcache/ChangeLog
+++ b/src/lib/krb5/rcache/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-24 Ezra Peisach <epeisach@mit.edu>
+
+ * rc_dfl.c (krb5_rc_io_fetch): Once length element read from
+ cache, and verified to be positive, put into unsigned int variable
+ for passing to other functions that expect such.
+
2001-07-04 Ezra Peisach <epeisach@mit.edu>
* rc_io.c: Declare krb5_rc_io_open_internal static.
diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c
index 5225a64e19..589fcd383d 100644
--- a/src/lib/krb5/rcache/rc_dfl.c
+++ b/src/lib/krb5/rcache/rc_dfl.c
@@ -312,18 +312,21 @@ static krb5_error_code
krb5_rc_io_fetch(krb5_context context, struct dfl_data *t,
krb5_donot_replay *rep, int maxlen)
{
- int len;
+ int len2;
+ unsigned int len;
krb5_error_code retval;
rep->client = rep->server = 0;
- retval = krb5_rc_io_read(context, &t->d, (krb5_pointer) &len, sizeof(len));
+ retval = krb5_rc_io_read(context, &t->d, (krb5_pointer) &len2,
+ sizeof(len2));
if (retval)
return retval;
- if ((len <= 0) || (len >= maxlen))
+ if ((len2 <= 0) || (len2 >= maxlen))
return KRB5_RC_IO_EOF;
+ len = len2;
rep->client = malloc (len);
if (!rep->client)
return KRB5_RC_MALLOC;
@@ -332,14 +335,16 @@ krb5_rc_io_fetch(krb5_context context, struct dfl_data *t,
if (retval)
goto errout;
- retval = krb5_rc_io_read(context, &t->d, (krb5_pointer) &len, sizeof(len));
+ retval = krb5_rc_io_read(context, &t->d, (krb5_pointer) &len2,
+ sizeof(len2));
if (retval)
goto errout;
- if ((len <= 0) || (len >= maxlen)) {
+ if ((len2 <= 0) || (len2 >= maxlen)) {
retval = KRB5_RC_IO_EOF;
goto errout;
}
+ len = len2;
rep->server = malloc (len);
if (!rep->server) {