Skip Menu |

This queue is for tickets about the BerkeleyDB CPAN distribution.

Report information
The Basics
Id: 12000
Status: resolved
Priority: 0/
Queue: BerkeleyDB

People
Owner: pmqs [...] cpan.org
Requestors: barborak [...] basikgroup.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



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.)
[guest - Fri Mar 25 10:49:40 2005]: Show quoted text
> 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.)
Thanks. I've applied the patch to my development copy. Paul