зеркало из https://github.com/mozilla/pjs.git
Fix bug # 175727 - strict aliasing bugs in LDAP C SDK.
Avoid casts like (void**)&pRes; use temporary local variables instead.
This commit is contained in:
Родитель
de1dc05d07
Коммит
bc21c3b807
|
@ -1416,8 +1416,9 @@ memcache_access(LDAPMemCache *cache, int mode,
|
|||
unsigned long key = *((unsigned long*)pData1);
|
||||
char *basedn = (char*)pData3;
|
||||
ldapmemcacheRes *pRes = NULL;
|
||||
void* hashResult = NULL;
|
||||
|
||||
nRes = htable_get(cache->ldmemc_resTmp, pData2, (void**)&pRes);
|
||||
nRes = htable_get(cache->ldmemc_resTmp, pData2, &hashResult);
|
||||
if (nRes == LDAP_SUCCESS)
|
||||
return( LDAP_ALREADY_EXISTS );
|
||||
|
||||
|
@ -1446,11 +1447,13 @@ memcache_access(LDAPMemCache *cache, int mode,
|
|||
LDAPMessage *pMsg = (LDAPMessage*)pData2;
|
||||
LDAPMessage *pCopy = NULL;
|
||||
ldapmemcacheRes *pRes = NULL;
|
||||
void* hashResult = NULL;
|
||||
|
||||
nRes = htable_get(cache->ldmemc_resTmp, pData1, (void**)&pRes);
|
||||
nRes = htable_get(cache->ldmemc_resTmp, pData1, &hashResult);
|
||||
if (nRes != LDAP_SUCCESS)
|
||||
return nRes;
|
||||
|
||||
pRes = (ldapmemcacheRes*) hashResult;
|
||||
nRes = memcache_dup_message(pMsg, pMsg->lm_msgid, 0, &pCopy, &size);
|
||||
if (nRes != LDAP_SUCCESS) {
|
||||
nRes = htable_remove(cache->ldmemc_resTmp, pData1, NULL);
|
||||
|
@ -1518,10 +1521,11 @@ memcache_access(LDAPMemCache *cache, int mode,
|
|||
/* Remove cached entries in the temporary cache. */
|
||||
else if (mode == MEMCACHE_ACCESS_DELETE) {
|
||||
|
||||
ldapmemcacheRes *pCurRes = NULL;
|
||||
void* hashResult = NULL;
|
||||
|
||||
if ((nRes = htable_remove(cache->ldmemc_resTmp, pData1,
|
||||
(void**)&pCurRes)) == LDAP_SUCCESS) {
|
||||
&hashResult)) == LDAP_SUCCESS) {
|
||||
ldapmemcacheRes *pCurRes = (ldapmemcacheRes*) hashResult;
|
||||
memcache_free_from_list(cache, pCurRes, LIST_TMP);
|
||||
memcache_free_entry(cache, pCurRes);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче