jcd(a)tribudubois.net wrote:
> Full_Name: Jean-Christophe Dubois
> Version: 2.4.40
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (78.235.240.156)
>
>
> In mdb_cursor_prev() there is some dead code as the (op == MDB_PREV_DUP) cannot
> be reached in the else block of the following if condition:
Apparently caused by commit 6423c877 for ITS#7671. Unfortunately you've
identified an actual bug, the current code will fail to return NOTFOUND when
it should. I.e., if the caller used MDB_PREV_DUP and the current node has no
DUPDATA.
Fixed in mdb.master.
>
> if (op == MDB_PREV || op == MDB_PREV_DUP) {
> ...
> } else {
> ...
> if (op == MDB_PREV_DUP)
> ...
> }
>
> The dead code can be removed.
>
> Patch available at the following URL:
>
> https://github.com/jcdubois/lmdb/commit/87c58701f7b7226d6d7bcf6be18db085cce…
>
> JC
>
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
Le 10/02/2014 10:41 PM, Howard Chu a =E9crit :
> jcd(a)tribudubois.net wrote:
>> Full_Name: Jean-Christophe Dubois
>> Version: 2.4.40
>> OS: Linux
>> URL: ftp://ftp.openldap.org/incoming/
>> Submission from: (NULL) (78.235.240.156)
>>
>>
>> In the mdb_env_cwalk() function the mc_flags member of the "mc"=20
>> MDB_cursor
>> instance is not initialized.
>>
>> But in the mdb_page_search_root() called a bit later (line 8407) this=20
>> flag will
>> be updated from this uninitialized value.
>>
>> The mc_flags member needs to be initialized to a known value.
>
> The mc_flags member is never referenced again, so this is irrelevant.
It is referenced here:
https://gitorious.org/mdb/mdb/source/61dd017808f66ada27e89c58bc9567d5b2ad=
e884:libraries/liblmdb/mdb.c#L5057
This function(mdb_page_search_root()) is called from mdb_env_cwalk()=20
with a reference to mc. and mc_flages is not initialized.
JC
>>
>> Patch available at URL below:
>>
>> https://github.com/jcdubois/lmdb/commit/57d0d380a18957245c8a011e735649=
09966eb399=20
>>
>>
>> JC
>>
>>
>
>
Full_Name: Jean-Christophe Dubois
Version: 2.4.40
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (78.235.240.156)
In mdb_cursor_prev() there is some dead code as the (op == MDB_PREV_DUP) cannot
be reached in the else block of the following if condition:
if (op == MDB_PREV || op == MDB_PREV_DUP) {
...
} else {
...
if (op == MDB_PREV_DUP)
...
}
The dead code can be removed.
Patch available at the following URL:
https://github.com/jcdubois/lmdb/commit/87c58701f7b7226d6d7bcf6be18db085cce…
JC
jcd(a)tribudubois.net wrote:
> Full_Name: Jean-Christophe Dubois
> Version: 2.4.40
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (78.235.240.156)
>
>
> In the mdb_env_cwalk() function the mc_flags member of the "mc" MDB_cursor
> instance is not initialized.
>
> But in the mdb_page_search_root() called a bit later (line 8407) this flag will
> be updated from this uninitialized value.
>
> The mc_flags member needs to be initialized to a known value.
The mc_flags member is never referenced again, so this is irrelevant.
>
> Patch available at URL below:
>
> https://github.com/jcdubois/lmdb/commit/57d0d380a18957245c8a011e73564909966…
>
> JC
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
Full_Name: Jean-Christophe Dubois
Version: 2.4.40
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (78.235.240.156)
In the mdb_env_cwalk() function the mc_flags member of the "mc" MDB_cursor
instance is not initialized.
But in the mdb_page_search_root() called a bit later (line 8407) this flag will
be updated from this uninitialized value.
The mc_flags member needs to be initialized to a known value.
Patch available at URL below:
https://github.com/jcdubois/lmdb/commit/57d0d380a18957245c8a011e73564909966…
JC