Skip to content

Commit

Permalink
Remove meaningless checks decoding DB2 principals
Browse files Browse the repository at this point in the history
Commit e3d9f03 (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
  • Loading branch information
greghudson committed Sep 7, 2016
1 parent a2ff1d9 commit c0f08f2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/plugins/kdb/db2/kdb_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c0f08f2

Please sign in to comment.