mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
s4:kdc: Check for overflow before calling smb_krb5_princ_component()
smb_krb5_princ_component() takes its component index parameter as ‘int’, not ‘unsigned int’. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15482 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
1221173577
commit
ea6d2ddb66
@ -912,6 +912,11 @@ static krb5_error_code principal_comp_strcmp_int(krb5_context context,
|
||||
size_t len;
|
||||
krb5_data d;
|
||||
krb5_error_code ret = 0;
|
||||
|
||||
if (component > INT_MAX) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if (component >= krb5_princ_size(context, principal)) {
|
||||
/* A non‐existent component compares less than any string. */
|
||||
*cmp = -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user