Description of problem: fix coverity Defect Type: Integer handling issues
Created attachment 437950 [details] git patch file (master) Comment: This is a typo where a bitwise AND was used instead of a logical AND on line 2185. The issue is not serious, as it only affect the "number of operations" counter for ldclt. The second half of the condition is not even needed in fact, since we are guaranteed that "(ret == LDAP_ALREADY_EXISTS)" is true at line 2185. Fix Description: Based upon the comment, removing the unnecessary second half of the condition.
Created attachment 437952 [details] git patch file (master) Comment: slapd_system_strerror does not cover the return codes from the libdb functions. Instead, use dblayer_strerror for describing error number.
Created attachment 437960 [details] git patch file (master) Comment: There is a suspicious implicit sign extension. Instead of direct bit shifting, use ntohl to decode buffer length.
Thanks to Nathan for his reviews and comments! Pushed to master. $ git merge coverity Updating 9f07f9d..100785a Fast-forward ldap/servers/slapd/back-ldbm/dbtest.c | 2 +- ldap/servers/slapd/sasl_io.c | 7 ++++--- ldap/servers/slapd/tools/ldclt/ldapfct.c | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) $ git push Counting objects: 31, done. Delta compression using up to 4 threads. Compressing objects: 100% (21/21), done. Writing objects: 100% (21/21), 2.47 KiB, done. Total 21 (delta 15), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 9f07f9d..100785a master -> master