From bd0baea783295bd22aeabdd7f4ce3aa31eb6144d Mon Sep 17 00:00:00 2001 From: Michal Zidek Date: Mon, 3 Dec 2012 13:53:04 +0100 Subject: Dereference after null check in sss_idmap_sid_to_unix https://fedorahosted.org/sssd/ticket/1684 --- src/lib/idmap/sss_idmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/idmap') diff --git a/src/lib/idmap/sss_idmap.c b/src/lib/idmap/sss_idmap.c index d7254e3e..3615e9d5 100644 --- a/src/lib/idmap/sss_idmap.c +++ b/src/lib/idmap/sss_idmap.c @@ -298,11 +298,15 @@ enum idmap_error_code sss_idmap_sid_to_unix(struct sss_idmap_ctx *ctx, long long rid; char *endptr; + if (sid == NULL || id == NULL) { + return IDMAP_ERROR; + } + CHECK_IDMAP_CTX(ctx, IDMAP_CONTEXT_INVALID); idmap_domain_info = ctx->idmap_domain_info; - if (sid && sss_idmap_sid_is_builtin(sid)) { + if (sss_idmap_sid_is_builtin(sid)) { return IDMAP_BUILTIN_SID; } -- cgit