diff options
author | Pavel Březina <pbrezina@redhat.com> | 2013-01-07 10:34:48 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-07 17:35:13 +0100 |
commit | 31c47cacc7f9453153e57319474909d23122883f (patch) | |
tree | d59cbc40a2e7183d6d49f3786d760143611e9c8b /src/responder/nss | |
parent | 528dd4ca82de4f4c2030ae22b723267ebc0d42e7 (diff) | |
download | sssd-31c47cacc7f9453153e57319474909d23122883f.tar.gz sssd-31c47cacc7f9453153e57319474909d23122883f.tar.bz2 sssd-31c47cacc7f9453153e57319474909d23122883f.zip |
memcache: add macro that validates record length
Diffstat (limited to 'src/responder/nss')
-rw-r--r-- | src/responder/nss/nsssrv_mmap_cache.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c index 7149ca80..f72923ea 100644 --- a/src/responder/nss/nsssrv_mmap_cache.c +++ b/src/responder/nss/nsssrv_mmap_cache.c @@ -226,8 +226,7 @@ static bool sss_mc_is_valid_rec(struct sss_mc_ctx *mcc, struct sss_mc_rec *rec) return false; } - if ((rec->len == MC_INVALID_VAL32) || - (rec->len > (mcc->dt_size - ((uint8_t *)rec - mcc->data_table)))) { + if (!MC_CHECK_RECORD_LENGTH(mcc, rec)) { return false; } |