mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
ipasam: fix a use-after-free issue
Since endptr points to a location inside of dummy, dummy should be freed only after dereferencing endptr. Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
99cfc979d5
commit
657cf958c6
@ -2103,11 +2103,12 @@ static bool get_uint32_t_from_ldap_msg(struct ldapsam_privates *ldap_state,
|
||||
}
|
||||
|
||||
l = strtoul(dummy, &endptr, 10);
|
||||
TALLOC_FREE(dummy);
|
||||
|
||||
if (l < 0 || l > UINT32_MAX || *endptr != '\0') {
|
||||
TALLOC_FREE(dummy);
|
||||
return false;
|
||||
}
|
||||
TALLOC_FREE(dummy);
|
||||
|
||||
*val = l;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user