diff options
author | Michal Zidek <mzidek@redhat.com> | 2013-08-26 14:21:39 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-11-15 20:50:35 +0100 |
commit | 0bc28fce13b2e6616892d71a55b7765b8b7b7e74 (patch) | |
tree | bac618bac98d8e7a58e4b1827d69760d548aa6cb /src/sss_client | |
parent | a25a3e56aaf53f2d96dc366eb57e32bed834e18c (diff) | |
download | sssd-0bc28fce13b2e6616892d71a55b7765b8b7b7e74.tar.gz sssd-0bc28fce13b2e6616892d71a55b7765b8b7b7e74.tar.xz sssd-0bc28fce13b2e6616892d71a55b7765b8b7b7e74.zip |
sss_client: Use SAFEALIGN_SETMEM_<type> macros where appropriate.
https://fedorahosted.org/sssd/ticket/1359
Diffstat (limited to 'src/sss_client')
-rw-r--r-- | src/sss_client/pam_sss.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c index 3734c8f08..7a14963cb 100644 --- a/src/sss_client/pam_sss.c +++ b/src/sss_client/pam_sss.c @@ -228,8 +228,7 @@ static int pack_message_v3(struct pam_items *pi, size_t *size, uint8_t **buffer) { int len; uint8_t *buf; - int rp; - uint32_t terminator = SSS_END_OF_PAM_REQUEST; + size_t rp; len = sizeof(uint32_t) + 2*sizeof(uint32_t) + pi->pam_user_size + @@ -255,8 +254,7 @@ static int pack_message_v3(struct pam_items *pi, size_t *size, } rp = 0; - ((uint32_t *)(&buf[rp]))[0] = SSS_START_OF_PAM_REQUEST; - rp += sizeof(uint32_t); + SAFEALIGN_SETMEM_UINT32(buf, SSS_START_OF_PAM_REQUEST, &rp); rp += add_string_item(SSS_PAM_ITEM_USER, pi->pam_user, pi->pam_user_size, &buf[rp]); @@ -283,8 +281,7 @@ static int pack_message_v3(struct pam_items *pi, size_t *size, pi->pam_newauthtok, pi->pam_newauthtok_size, &buf[rp]); - memcpy(&buf[rp], &terminator, sizeof(uint32_t)); - rp += sizeof(uint32_t); + SAFEALIGN_SETMEM_UINT32(buf + rp, SSS_END_OF_PAM_REQUEST, &rp); if (rp != len) { D(("error during packet creation.")); |