krb5 commit [krb5-1.14]: Remove meaningless checks decoding DB2 principals
Tom Yu
tlyu at mit.edu
Fri Sep 9 17:07:55 EDT 2016
https://github.com/krb5/krb5/commit/47a0ec41d5860b3c4d9241735370bf4c20fb3d8e
commit 47a0ec41d5860b3c4d9241735370bf4c20fb3d8e
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.
(cherry picked from commit c0f08f2eadbf179ec30008893a125722536c7802)
ticket: 8491
version_fixed: 1.14.4
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 9c2614a..e6a030f 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