Bug 700890 - Check return value of open() properly in libadmin
Summary: Check return value of open() properly in libadmin
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Admin
Version: 1.2.8
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 434915
TreeView+ depends on / blocked
 
Reported: 2011-04-29 18:27 UTC by Nathan Kinder
Modified: 2015-12-07 16:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 16:31:48 UTC


Attachments (Terms of Use)
Patch for cov#10812 (1.06 KB, patch)
2011-04-29 18:33 UTC, Nathan Kinder
nhosoi: review+
Details | Diff

Description Nathan Kinder 2011-04-29 18:27:38 UTC
We do not properly check the return value of open() in the run_cmd() function in libadmin.  The open() function will return -1 if the open failed.  The if condition needs to check if the return value is <= 0 so if can bail out properly.

Comment 1 Nathan Kinder 2011-04-29 18:33:15 UTC
Created attachment 495832 [details]
Patch for cov#10812

Comment 2 Nathan Kinder 2011-04-29 18:43:52 UTC
Pushed to master.  Thanks to Noriko for her reviews!

Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 679 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/admin.git
   cc422c4..5a52f43  master -> master

Comment 5 Rich Megginson 2011-06-06 21:40:52 UTC
coverity is clean - marking verified


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