Protect against negative n_ks_tuple values and against randkey returning negative n_keys
This commit is contained in:
@@ -395,6 +395,12 @@ kadmind_dispatch(void *kadm_handlep, krb5_boolean initial,
|
||||
} else if (ret == 0) {
|
||||
size_t i;
|
||||
|
||||
if (n_ks_tuple < 0) {
|
||||
ret = EOVERFLOW;
|
||||
krb5_free_principal(contextp->context, princ);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ks_tuple = calloc(n_ks_tuple, sizeof (*ks_tuple))) == NULL) {
|
||||
ret = errno;
|
||||
krb5_free_principal(contextp->context, princ);
|
||||
|
Reference in New Issue
Block a user