krb5 commit: Remove meaningless checks decoding DB2 principals
Greg Hudson
ghudson at mit.edu
Wed Sep 7 00:41:06 EDT 2016
https://github.com/krb5/krb5/commit/c0f08f2eadbf179ec30008893a125722536c7802
commit c0f08f2eadbf179ec30008893a125722536c7802
Author: Greg Hudson <ghudson at mit.edu>
Date: Tue Sep 6 12:58:57 2016 -0400
Remove meaningless checks decoding DB2 principals
Commit e3d9f03a658e247dbb43cb345aa93a28782fd995 (ticket 8481) added
several checks for negative length values when decoding DB2 principal
entries, including two unnecessary checks on unsigned values. Remove
those checks as they can generate warnings.
ticket: 8491 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup
src/plugins/kdb/db2/kdb_xdr.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/plugins/kdb/db2/kdb_xdr.c b/src/plugins/kdb/db2/kdb_xdr.c
index e476e10..694c759 100644
--- a/src/plugins/kdb/db2/kdb_xdr.c
+++ b/src/plugins/kdb/db2/kdb_xdr.c
@@ -364,8 +364,7 @@ krb5_decode_princ_entry(krb5_context context, krb5_data *content,
krb5_kdb_decode_int16(nextloc, (*tl_data)->tl_data_length);
nextloc += 2;
- if ((*tl_data)->tl_data_length < 0 ||
- (*tl_data)->tl_data_length > sizeleft) {
+ if ((*tl_data)->tl_data_length > sizeleft) {
retval = KRB5_KDB_TRUNCATED_RECORD;
goto error_out;
}
@@ -414,8 +413,7 @@ krb5_decode_princ_entry(krb5_context context, krb5_data *content,
krb5_kdb_decode_int16(nextloc, key_data->key_data_length[j]);
nextloc += 2;
- if (key_data->key_data_length[j] < 0 ||
- key_data->key_data_length[j] > sizeleft) {
+ if (key_data->key_data_length[j] > sizeleft) {
retval = KRB5_KDB_TRUNCATED_RECORD;
goto error_out;
}
More information about the cvs-krb5
mailing list