Bug 622628

Summary: fix coverity Defect Type: Integer handling issues
Product: [Retired] 389 Reporter: Noriko Hosoi <nhosoi>
Component: Directory ServerAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 1.2.6CC: benl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://10.16.47.145:8080/defects/index.htm?projectId=10030
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-17 14:08:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 576869, 639035    
Attachments:
Description Flags
git patch file (master)
nkinder: review+
git patch file (master)
nkinder: review+
git patch file (master) nkinder: review+

Description Noriko Hosoi 2010-08-10 00:11:00 UTC
Description of problem:
fix coverity Defect Type: Integer handling issues

Comment 1 Noriko Hosoi 2010-08-10 16:50:14 UTC
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.

Comment 2 Noriko Hosoi 2010-08-10 17:09:46 UTC
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.

Comment 3 Noriko Hosoi 2010-08-10 18:04:53 UTC
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.

Comment 4 Noriko Hosoi 2010-08-11 16:59:34 UTC
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