diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-23 17:17:30 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-23 17:17:30 -0700 |
commit | e4808ae72cffe024907651c5e0c897c1cfb71b88 (patch) | |
tree | 9e233cc89893241841de0b61fe01229e6874bfae /ldap/servers | |
parent | e63bd50a2ee4de726c29ad656335c456b900ed9a (diff) | |
download | ds-e4808ae72cffe024907651c5e0c897c1cfb71b88.tar.gz ds-e4808ae72cffe024907651c5e0c897c1cfb71b88.tar.xz ds-e4808ae72cffe024907651c5e0c897c1cfb71b88.zip |
Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
https://bugzilla.redhat.com/show_bug.cgi?id=611790
Resolves: bug 611790
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Fix description: Catch possible NULL pointer in cos_cache_add_defn().
Note: committing the fix on behalf of Endi (edewata@redhat.com).
Diffstat (limited to 'ldap/servers')
-rw-r--r-- | ldap/servers/plugins/cos/cos_cache.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c index 8631c3d2..8c72b8ff 100644 --- a/ldap/servers/plugins/cos/cos_cache.c +++ b/ldap/servers/plugins/cos/cos_cache.c @@ -1387,10 +1387,18 @@ static int cos_cache_add_defn( cosAttrValue *pDummyAttrVal = 0; cosAttrValue *pAttrsIter = 0; cosAttributes *pDummyAttributes = 0; - cosAttrValue *pSpecsIter = *spec; + cosAttrValue *pSpecsIter = 0; LDAPDebug( LDAP_DEBUG_TRACE, "--> cos_cache_add_defn\n",0,0,0); + if (!spec) { + LDAPDebug( LDAP_DEBUG_ANY, "missing spec\n",0,0,0); + ret = -1; + goto out; + } + + pSpecsIter = *spec; + /* we don't want cosspecifiers that can be supplied by the same scheme */ while( pSpecsIter ) { @@ -1481,7 +1489,7 @@ static int cos_cache_add_defn( ret = -1; } } - +out: if(ret < 0) { if(dn) |