s3: Fix Coverity ID 1137: CONSTANT_EXPRESSION_RESULT
authorVolker Lendecke <vl@samba.org>
Fri, 1 Apr 2011 06:40:38 +0000 (08:40 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 14 Jun 2011 10:56:41 +0000 (12:56 +0200)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Apr  1 09:35:19 CEST 2011 on sn-devel-104

This patch and the last one address bug #8054 - winbindd cache stores/retrieves
wrong sizes for 16-bit ints.
(cherry picked from commit 5fc7b78c64c43fd345b96dcbc1d30f2cabfaef81)

source3/winbindd/winbindd_cache.c

index 81970d44a4475a7433b9bec6c6cf71d898a3b3a4..64a4a1c064dd84e06591ef98a8c5157d4b8c778c 100644 (file)
@@ -246,7 +246,7 @@ static uint16 centry_uint16(struct cache_entry *centry)
        if (!centry_check_bytes(centry, 2)) {
                smb_panic_fn("centry_uint16");
        }
-       ret = CVAL(centry->data, centry->ofs);
+       ret = SVAL(centry->data, centry->ofs);
        centry->ofs += 2;
        return ret;
 }
@@ -757,7 +757,7 @@ static void centry_put_uint32(struct cache_entry *centry, uint32 v)
 static void centry_put_uint16(struct cache_entry *centry, uint16 v)
 {
        centry_expand(centry, 2);
-       SIVAL(centry->data, centry->ofs, v);
+       SSVAL(centry->data, centry->ofs, v);
        centry->ofs += 2;
 }