diff options
author | Nathan Kinder <nkinder@redhat.com> | 2010-09-15 08:28:17 -0700 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2010-09-15 09:11:06 -0700 |
commit | f78a37579df8f9c60b4742019231b0dfa49a87a9 (patch) | |
tree | a072f2ce3bdbac39e3689c0225422b3ff4193d75 | |
parent | 6319623ea54435610f573e1a1d7b9bbe7b16e878 (diff) | |
download | ds-f78a37579df8f9c60b4742019231b0dfa49a87a9.tar.gz ds-f78a37579df8f9c60b4742019231b0dfa49a87a9.tar.xz ds-f78a37579df8f9c60b4742019231b0dfa49a87a9.zip |
Bug 630097 - (cov#15506) NULL dereference in dblayer code
The first parameter of dblayer_set_env_debugging() is dereferenced
inside of that function without NULL checking. We pass the env
variable to this function without first checking if it is NULL.
We should move the existing NULL check of env up to the top of the
dblayer_copy_file_keybybey() function.
-rw-r--r-- | ldap/servers/slapd/back-ldbm/dbhelp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ldap/servers/slapd/back-ldbm/dbhelp.c b/ldap/servers/slapd/back-ldbm/dbhelp.c index f1f232a4..93a0de88 100644 --- a/ldap/servers/slapd/back-ldbm/dbhelp.c +++ b/ldap/servers/slapd/back-ldbm/dbhelp.c @@ -65,15 +65,15 @@ static int dblayer_copy_file_keybykey(DB_ENV *env, char *source_file_name, char LDAPDebug( LDAP_DEBUG_TRACE, "=> dblayer_copy_file_keybykey\n", 0, 0, 0 ); - if (priv->dblayer_file_mode) - mode = priv->dblayer_file_mode; - dblayer_set_env_debugging(env, priv); - if (!env) { LDAPDebug(LDAP_DEBUG_ANY, "dblayer_copy_file_keybykey, Out of memory\n", 0, 0, 0); goto error; } + if (priv->dblayer_file_mode) + mode = priv->dblayer_file_mode; + dblayer_set_env_debugging(env, priv); + /* Open the source file */ retval = db_create(&source_file, env, 0); if (retval) { |