Bug 622628 - fix coverity Defect Type: Integer handling issues
Summary: fix coverity Defect Type: Integer handling issues
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server   
(Show other bugs)
Version: 1.2.6
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Chandrasekar Kannan
URL: http://10.16.47.145:8080/defects/inde...
Whiteboard:
Keywords:
Depends On:
Blocks: 389_1.2.7 639035
TreeView+ depends on / blocked
 
Reported: 2010-08-10 00:11 UTC by Noriko Hosoi
Modified: 2015-01-04 23:43 UTC (History)
1 user (show)

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: ---


Attachments (Terms of Use)
git patch file (master) (1.50 KB, patch)
2010-08-10 16:50 UTC, Noriko Hosoi
nkinder: review+
Details | Diff
git patch file (master) (1.07 KB, patch)
2010-08-10 17:09 UTC, Noriko Hosoi
nkinder: review+
Details | Diff
git patch file (master) (1.57 KB, patch)
2010-08-10 18:04 UTC, Noriko Hosoi
nkinder: review+
Details | Diff

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


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