https://bugs.openldap.org/show_bug.cgi?id=9417
Issue ID: 9417 Summary: ldapexop: exit with indeterminate status Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: client tools Assignee: bugs@openldap.org Reporter: danix800@gmail.com Target Milestone: ---
In clients/tools/ldapexop.c:354 'main' calls 'tool_exit' with testing result of 'code' to 'LDAP_SUCCESS' as argument, but clang static analyzer finds that at line 103 if 'ldap_whoami' fails then 'main' should exit, leaving 'code' uninitialized, the test result is indeterminate. After further inspection I can conclude that 'rc' is set all the way down so I think 'tool_exit' should be called with 'rc' directly.
See MR!207 for potential fix for this.
https://bugs.openldap.org/show_bug.cgi?id=9417
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.4.57 Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #1 from Quanah Gibson-Mount quanah@openldap.org --- Commits: • 66254781 by Ding Fei at 2020-12-04T20:00:47+08:00 ITS #9417 ldapexop exit with correct rc value
`rc` collects exit status all the way down but is not used at all? If `code` comparison at exit is intended then there exists some path that leaves it in garbage value, say when `ldap_whoami` or `ldap_cancel` fails.
https://bugs.openldap.org/show_bug.cgi?id=9417
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- RE24:
Commits: • 8e738d75 by Ding Fei at 2020-12-08T00:09:51+00:00 ITS #9417 ldapexop exit with correct rc value
`rc` collects exit status all the way down but is not used at all? If `code` comparison at exit is intended then there exists some path that leaves it in garbage value, say when `ldap_whoami` or `ldap_cancel` fails.
https://bugs.openldap.org/show_bug.cgi?id=9417
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED