Bug 622628 - fix coverity Defect Type: Integer handling issues
fix coverity Defect Type: Integer handling issues
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
1.2.6
All Linux
low Severity medium
: ---
: ---
Assigned To: Noriko Hosoi
Chandrasekar Kannan
http://10.16.47.145:8080/defects/inde...
:
Depends On:
Blocks: 389_1.2.7 639035
  Show dependency treegraph
 
Reported: 2010-08-09 20:11 EDT by Noriko Hosoi
Modified: 2015-01-04 18:43 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-17 10:08:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
git patch file (master) (1.50 KB, patch)
2010-08-10 12:50 EDT, Noriko Hosoi
nkinder: review+
Details | Diff
git patch file (master) (1.07 KB, patch)
2010-08-10 13:09 EDT, Noriko Hosoi
nkinder: review+
Details | Diff
git patch file (master) (1.57 KB, patch)
2010-08-10 14:04 EDT, Noriko Hosoi
nkinder: review+
Details | Diff

  None (edit)
Description Noriko Hosoi 2010-08-09 20:11:00 EDT
Description of problem:
fix coverity Defect Type: Integer handling issues
Comment 1 Noriko Hosoi 2010-08-10 12:50:14 EDT
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 13:09:46 EDT
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 14:04:53 EDT
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 12:59:34 EDT
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

Note You need to log in before you can comment on or make changes to this bug.