summaryrefslogtreecommitdiffstats
path: root/src/sss_client/autofs
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-08-21 17:17:06 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-12-03 14:41:15 +0100
commita171d77f40aa92e240e91aa4bafe5a392a98b5a2 (patch)
tree67af7f48c89fbc1e7daa56c1d0c423cc0e19af74 /src/sss_client/autofs
parentcebdc563a094d305b91da5b5af4d95d8e3a1bf27 (diff)
downloadsssd-a171d77f40aa92e240e91aa4bafe5a392a98b5a2.tar.gz
sssd-a171d77f40aa92e240e91aa4bafe5a392a98b5a2.tar.xz
sssd-a171d77f40aa92e240e91aa4bafe5a392a98b5a2.zip
sss_client: Use SAFEALIGN_COPY_<type> macros where appropriate.
resolves: https://fedorahosted.org/sssd/ticket/1359
Diffstat (limited to 'src/sss_client/autofs')
-rw-r--r--src/sss_client/autofs/sss_autofs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sss_client/autofs/sss_autofs.c b/src/sss_client/autofs/sss_autofs.c
index 435cafe23..49e130282 100644
--- a/src/sss_client/autofs/sss_autofs.c
+++ b/src/sss_client/autofs/sss_autofs.c
@@ -64,6 +64,7 @@ _sss_setautomntent(const char *mapname, void **context)
struct sss_cli_req_data rd;
uint8_t *repbuf = NULL;
size_t replen;
+ uint32_t num_results = 0;
if (!mapname) return EINVAL;
@@ -96,8 +97,11 @@ _sss_setautomntent(const char *mapname, void **context)
goto out;
}
+ /* Get number of results from repbuf. */
+ SAFEALIGN_COPY_UINT32(&num_results, repbuf, NULL);
+
/* no results if not found */
- if (((uint32_t *)repbuf)[0] == 0) {
+ if (num_results == 0) {
free(name);
free(repbuf);
ret = ENOENT;