diff options
author | Michal Zidek <mzidek@redhat.com> | 2012-12-03 13:53:04 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-04 11:24:48 +0100 |
commit | bd0baea783295bd22aeabdd7f4ce3aa31eb6144d (patch) | |
tree | 1e593bc652e66e3216be7e10b9dc0380d81770a2 /src/lib | |
parent | 30812cdfb92923c8d062a5db989015c676a87f07 (diff) | |
download | sssd-bd0baea783295bd22aeabdd7f4ce3aa31eb6144d.tar.gz sssd-bd0baea783295bd22aeabdd7f4ce3aa31eb6144d.tar.bz2 sssd-bd0baea783295bd22aeabdd7f4ce3aa31eb6144d.zip |
Dereference after null check in sss_idmap_sid_to_unix
https://fedorahosted.org/sssd/ticket/1684
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/idmap/sss_idmap.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |