URL:
https://github.com/SSSD/sssd/pull/455
Title: #455: mmap_cache: make checks independent of input size
sumit-bose commented:
"""
I think it has to be at least
- if (key->len > strs_len) {
+ if (key->len + name_ptr - strs_offset > strs_len) {
because name_ptr is relative to rec->data and includes some other uint32_t values the
different record structs starts with which are not include in strs_len/data_len. But I
think being more strict here is not needed because also for the passwd and group case
strs_len includes other strings as well making the whole check only a rough estimate.
About
IMHO it's faster then trying to find '\0'.
I already removed the check in the latest version.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/455#issuecomment-347196012