Bug 630097

Summary: fix coverity Defect Type: Null pointer dereferences issues
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: Directory ServerAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2.6CC: amsharma, benl, jgalipea
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: 2011-05-17 14:08:46 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#11933
nhosoi: review+, nkinder: review?
Patch for cov#11938
none
Patch for cov#11946
nhosoi: review-
Revised patch for cov#11938
nhosoi: review+, nkinder: review?
Patch for cov#11964
nhosoi: review+, nkinder: review?
Patch for cov#12143
nhosoi: review+, nkinder: review?
Patch for cov#12148
nhosoi: review+, nkinder: review?
Patch for cov#12182
none
Patch for cov#12182 & cov#12183
nhosoi: review+, nkinder: review?
Patch for cov#15460
nhosoi: review+, nkinder: review?
Patch for cov#15461
nhosoi: review+, nkinder: review?
Patch for cov#15462
nhosoi: review+, nkinder: review?
Patch for cov#15463
nhosoi: review+, nkinder: review?
Patch for cov#15464
nhosoi: review+, nkinder: review?
Patch for cov#15465
nhosoi: review+, nkinder: review?
Patch for cov#15473
nhosoi: review+, nkinder: review?
Patch for cov#15505
nhosoi: review+, nkinder: review?
Patch for cov#15506
nhosoi: review+, nkinder: review?
Patch for cov#15507
none
Patch for cov#15507 & cov#15508
nhosoi: review+, nkinder: review?
Patch for cov#15509
nhosoi: review+, nkinder: review?
Additional patch for cov#11938
nhosoi: review+, nkinder: review?
Patch for cov#15477 nkinder: review?, nkinder: review?, rmeggins: review+

Description Nathan Kinder 2010-09-03 17:19:36 UTC
fix coverity Defect Type: Memory - Null pointer dereferences issues

Comment 2 Nathan Kinder 2010-09-13 17:00:19 UTC
Created attachment 446995 [details]
Patch for cov#11933

Comment 3 Nathan Kinder 2010-09-13 20:29:24 UTC
Created attachment 447036 [details]
Patch for cov#11938

Comment 4 Nathan Kinder 2010-09-13 20:35:54 UTC
Created attachment 447038 [details]
Patch for cov#11946

Comment 5 Nathan Kinder 2010-09-13 21:58:46 UTC
Created attachment 447061 [details]
Revised patch for cov#11938

Comment 6 Nathan Kinder 2010-09-13 21:59:16 UTC
Created attachment 447062 [details]
Patch for cov#11964

Comment 7 Nathan Kinder 2010-09-13 22:07:37 UTC
Created attachment 447067 [details]
Patch for cov#12143

Comment 8 Nathan Kinder 2010-09-14 15:37:46 UTC
Created attachment 447250 [details]
Patch for cov#12148

Comment 9 Nathan Kinder 2010-09-14 16:15:03 UTC
Created attachment 447257 [details]
Patch for cov#12182

Comment 10 Nathan Kinder 2010-09-14 16:23:29 UTC
Created attachment 447259 [details]
Patch for cov#12182 & cov#12183

Comment 11 Nathan Kinder 2010-09-14 17:30:41 UTC
Created attachment 447279 [details]
Patch for cov#15460

Comment 12 Nathan Kinder 2010-09-14 18:02:19 UTC
Created attachment 447293 [details]
Patch for cov#15461

Comment 13 Nathan Kinder 2010-09-14 18:20:09 UTC
Created attachment 447297 [details]
Patch for cov#15462

Comment 14 Nathan Kinder 2010-09-14 18:29:25 UTC
Created attachment 447299 [details]
Patch for cov#15463

Comment 15 Nathan Kinder 2010-09-14 18:45:01 UTC
Created attachment 447300 [details]
Patch for cov#15464

Comment 16 Nathan Kinder 2010-09-14 20:54:48 UTC
Created attachment 447321 [details]
Patch for cov#15465

Comment 17 Nathan Kinder 2010-09-14 21:55:08 UTC
Created attachment 447336 [details]
Patch for cov#15473

Comment 18 Nathan Kinder 2010-09-14 22:46:16 UTC
Created attachment 447351 [details]
Patch for cov#15505

Comment 19 Nathan Kinder 2010-09-15 15:29:52 UTC
Created attachment 447503 [details]
Patch for cov#15506

Comment 20 Nathan Kinder 2010-09-15 15:48:24 UTC
Created attachment 447506 [details]
Patch for cov#15507

Comment 21 Nathan Kinder 2010-09-15 15:51:37 UTC
Created attachment 447508 [details]
Patch for cov#15507 & cov#15508

Comment 22 Nathan Kinder 2010-09-15 15:56:48 UTC
Created attachment 447509 [details]
Patch for cov#15509

Comment 23 Noriko Hosoi 2010-09-15 16:18:24 UTC
Comment on attachment 447038 [details]
Patch for cov#11946

It looks (theoretically :) there's a case pResHash itself is NULL...  (from line 256: "goto error")

Comment 24 Noriko Hosoi 2010-09-15 16:28:32 UTC
Comment on attachment 447061 [details]
Revised patch for cov#11938

I was wondering if (numb > tot_b) AND (a == NULL), what would happen.  But the condition is avoided by the outer while (line 1067), so I think the original code is safe.  But having the check to make coverity happy should be good. :)

Comment 25 Noriko Hosoi 2010-09-15 16:46:04 UTC
Comment on attachment 447321 [details]
Patch for cov#15465

Thanks!! :)

Comment 26 Noriko Hosoi 2010-09-15 16:52:28 UTC
Comment on attachment 447038 [details]
Patch for cov#11946

Patch for cov#15473 covers this case...

Comment 27 Noriko Hosoi 2010-09-15 16:54:29 UTC
Comment on attachment 447508 [details]
Patch for cov#15507 & cov#15508

Oops. :p  Thanks!!

Comment 28 Nathan Kinder 2010-09-15 16:58:39 UTC
Pushed patches to master.  Thanks to Noriko for reviewing all of the patches!

Counting objects: 153, done.
Delta compression using 2 threads.
Compressing objects: 100% (117/117), done.
Writing objects: 100% (117/117), 13.48 KiB, done.
Total 117 (delta 81), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   9098fc7..55f94d2  master -> master

Comment 29 Nathan Kinder 2010-09-15 19:17:47 UTC
Created attachment 447549 [details]
Additional patch for cov#11938

Comment 30 Nathan Kinder 2010-09-15 20:32:36 UTC
Created attachment 447566 [details]
Patch for cov#15477

Comment 31 Nathan Kinder 2010-09-15 20:41:44 UTC
Pushed the last 2 patches to master.  Thanks to Rich and Noriko for the additional reviews!

Counting objects: 23, done.
Delta compression using 2 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.54 KiB, done.
Total 14 (delta 10), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   529b056..b83f966  master -> master

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