summaryrefslogtreecommitdiff
path: root/src/sss_client/nss_mc_common.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-01-07 10:35:34 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-07 17:35:13 +0100
commit5fbd461972cb4da117cc6b3d70a932ae4de6becf (patch)
treee321e76c07ab3326b782fdd33ebef86bfdb4099d /src/sss_client/nss_mc_common.c
parent31c47cacc7f9453153e57319474909d23122883f (diff)
downloadsssd-5fbd461972cb4da117cc6b3d70a932ae4de6becf.tar.gz
sssd-5fbd461972cb4da117cc6b3d70a932ae4de6becf.tar.bz2
sssd-5fbd461972cb4da117cc6b3d70a932ae4de6becf.zip
explicit null dereferenced in sss_nss_mc_get_record()
https://fedorahosted.org/sssd/ticket/1724
Diffstat (limited to 'src/sss_client/nss_mc_common.c')
-rw-r--r--src/sss_client/nss_mc_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sss_client/nss_mc_common.c b/src/sss_client/nss_mc_common.c
index 59f5b257..f777890a 100644
--- a/src/sss_client/nss_mc_common.c
+++ b/src/sss_client/nss_mc_common.c
@@ -220,6 +220,11 @@ errno_t sss_nss_mc_get_record(struct sss_cli_mc_ctx *ctx,
continue;
}
+ if (!MC_CHECK_RECORD_LENGTH(ctx, rec)) {
+ /* record has invalid length */
+ return EINVAL;
+ }
+
if (rec_len > buf_size) {
free(copy_rec);
copy_rec = malloc(rec_len);