aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssar Westerlund <assar@FreeBSD.org>2002-10-24 02:49:08 +0000
committerAssar Westerlund <assar@FreeBSD.org>2002-10-24 02:49:08 +0000
commit6f51866403425ec8b22e15fa55ab843afdab47b3 (patch)
tree7c3757aea4bf7fa01496063b54d3b628b63b9334
parent40095fd9d61c1b27411627079f21d706d1e3e21d (diff)
downloadsrc-6f51866403425ec8b22e15fa55ab843afdab47b3.tar.gz
src-6f51866403425ec8b22e15fa55ab843afdab47b3.zip
MFC kadm_ser_wrap.c:1.1.1.4: fix buffer overflow
MFC updating kerberosIV version Obtained from: kth-krb CVS
Notes
Notes: svn path=/stable/3/; revision=105843
-rw-r--r--crypto/kerberosIV/kadmin/kadm_ser_wrap.c13
-rw-r--r--kerberosIV/include/version.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/crypto/kerberosIV/kadmin/kadm_ser_wrap.c b/crypto/kerberosIV/kadmin/kadm_ser_wrap.c
index 196a89c8fe11..29f142c63661 100644
--- a/crypto/kerberosIV/kadmin/kadm_ser_wrap.c
+++ b/crypto/kerberosIV/kadmin/kadm_ser_wrap.c
@@ -117,16 +117,25 @@ kadm_ser_in(u_char **dat, int *dat_len, u_char *errdat)
u_char *retdat, *tmpdat;
int retval, retlen;
- if (strncmp(KADM_VERSTR, (char *)*dat, KADM_VERSIZE)) {
+ if (*dat_len < (KADM_VERSIZE + sizeof(u_int32_t))
+ || strncmp(KADM_VERSTR, (char *)*dat, KADM_VERSIZE) != 0) {
errpkt(errdat, dat, dat_len, KADM_BAD_VER);
return KADM_BAD_VER;
}
in_len = KADM_VERSIZE;
/* get the length */
- if ((retc = stv_long(*dat, &r_len, in_len, *dat_len)) < 0)
+ if ((retc = stv_long(*dat, &r_len, in_len, *dat_len)) < 0 ||
+ (r_len > *dat_len - KADM_VERSIZE - sizeof(u_int32_t))) {
+ errpkt(errdat, dat, dat_len, KADM_LENGTH_ERROR);
return KADM_LENGTH_ERROR;
+ }
+
in_len += retc;
authent.length = *dat_len - r_len - KADM_VERSIZE - sizeof(u_int32_t);
+ if (authent.length > MAX_KTXT_LEN) {
+ errpkt(errdat, dat, dat_len, KADM_LENGTH_ERROR);
+ return KADM_LENGTH_ERROR;
+ }
memcpy(authent.dat, (char *)(*dat) + in_len, authent.length);
authent.mbz = 0;
/* service key should be set before here */
diff --git a/kerberosIV/include/version.h b/kerberosIV/include/version.h
index b8bf37be4afb..13355fe0cd56 100644
--- a/kerberosIV/include/version.h
+++ b/kerberosIV/include/version.h
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-char *krb4_long_version = "@(#)$Version: krb4-1.0 by root on greenpeace.grondar.za (i386-unknown-freebsd3.something) Sat Jan 8 19:34:57 SAST 2000 $";
-char *krb4_version = "krb4-1.0";
+char *krb4_long_version = "@(#)$Version: krb4-1.0fb1 by root on greenpeace.grondar.za (i386-unknown-freebsd3.something) Sat Jan 8 19:34:57 SAST 2000 $";
+char *krb4_version = "krb4-1.0fb1";
char *heimdal_long_version = "@(#)$Version: heimdal-0.1l by root on greenpeace.grondar.za (i386-unknown-freebsd3.something) Sat Jan 8 20:56:02 SAST 2000 $";
char *heimdal_version = "heimdal-0.1l";