Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 630093

Summary: fix coverity Defect Type: Uninitialized variables issues
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: Directory ServerAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2.6CC: amsharma, jgalipea, nhosoi
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 17:18:08 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: 639035    
Attachments:
Description Flags
Patch for cov#15511
nhosoi: review+, nkinder: review?
Patch for cov#15518
none
Patch for cov#15518 nhosoi: review+, nkinder: review?

Description Nathan Kinder 2010-09-03 17:15:28 UTC
fix coverity Defect Type: Memory - Uninitialized variables issues

Comment 2 Nathan Kinder 2010-09-08 15:33:48 UTC
Created attachment 446014 [details]
Patch for cov#15511

Comment 3 Nathan Kinder 2010-09-08 15:55:07 UTC
Created attachment 446023 [details]
Patch for cov#15518

Comment 4 Noriko Hosoi 2010-09-08 16:36:17 UTC
(In reply to comment #3)
> Created attachment 446023 [details]
> Patch for cov#15518

I'm sure it won't happen, but could you check fd with 3 instead of 0?  (we want to clearly say we won't close STDIN and STDERR... :)
-    if (fd != FD_STDOUT) {
+    if ((fd >= 0) && (fd != FD_STDOUT)) { 
                ^
                3

Then, we don't need to check with FD_STDOUT...

Probably, we want to do "if (fd > STDERR_FILENO)"?  STDERR_FILENO is defined in unistd.h which is included in back-ldbm.h.

Also, instead of defining a macro in the file, we may want to use STDOUT_FILENO...
ldap/servers/slapd/back-ldbm/ldif2ldbm.c
 888 #define FD_STDOUT 1
 889

Comment 5 Nathan Kinder 2010-09-08 16:58:52 UTC
Created attachment 446044 [details]
Patch for cov#15518

Comment 6 Nathan Kinder 2010-09-08 17:29:48 UTC
Pushed patches to master.  Thanks to Noriko for her reviews!

Counting objects: 23, done.
Delta compression using 2 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 2.12 KiB, done.
Total 14 (delta 9), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   44e10f3..cd99e19  master -> master

Comment 7 Amita Sharma 2011-05-13 07:01:41 UTC
Coverity Related, Can I request Dev to test this.