Subject: | $dbEnv->log_archive ( DB_ARCH_REMOVE ) causes seg fault |
For some reason in the log_archive API, the list pointer is not set to NULL if it were specified along with the DB_ARCH_REMOVE flag. I guess this was to avoid a NULL check on listp. Here's the code snippet from the API:
if (flags != DB_ARCH_REMOVE)
*listp = NULL;
Because of this, this line in BerkeleyDB.xs:
if (env->Status == 0 && list != NULL)
should be this
if (env->Status == 0 && list != NULL && flags != DB_ARCH_REMOVE)
to avoid derefencing an unitialized pointer. (Or I suppose the pointer could be initialized as NULL.)