Issue 8576 - Broken LDAP_TAILQ_ macros
Summary: Broken LDAP_TAILQ_ macros
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-01 10:40 UTC by Howard Chu
Modified: 2017-06-01 22:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Howard Chu 2017-02-01 10:40:49 UTC
Full_Name: Howard Chu
Version: HEAD etc
OS: 
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (195.235.15.200)
Submitted by: hyc


In commit 8ee824832844c16d4199f3aacd8b1d613933a7d5 we have "LDAP_TAILQ fix" but
no explanation of what was broken. In particular though, the LDAP_TAILQ_PREV
macro is now broken. It checks for foo == LDAP_TAILQ_FIRST(head) which becomes
foo == (head)->tqh_first but the initializer actually used foo =
&(head).tqh_first so this comparison will always be false.

I don't see any clear reason why these were changed from the originals. I'm
inclined to revert the change. Reverting will affect a few uses of
LDAP_TAILQ_LAST in back-ldap and back-meta but the other affected macros appear
to be unused in our source tree.

Tripped over this while attempting to use LDAP_TAILQ_PREV in new code.
Comment 1 Quanah Gibson-Mount 2017-02-03 22:45:04 UTC
changed notes
changed state Open to Release
moved from Incoming to Software Bugs
Comment 2 OpenLDAP project 2017-06-01 22:09:49 UTC
Fixed in master
Fixed in RE25
Fixed in RE24 (2.4.45)
Comment 3 Quanah Gibson-Mount 2017-06-01 22:09:49 UTC
changed notes
changed state Release to Closed