summaryrefslogtreecommitdiff
path: root/src/lib/idmap
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2012-12-03 13:53:04 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-12-04 11:24:48 +0100
commitbd0baea783295bd22aeabdd7f4ce3aa31eb6144d (patch)
tree1e593bc652e66e3216be7e10b9dc0380d81770a2 /src/lib/idmap
parent30812cdfb92923c8d062a5db989015c676a87f07 (diff)
downloadsssd-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/idmap')
-rw-r--r--src/lib/idmap/sss_idmap.c6
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;
}