Bug 630097 - fix coverity Defect Type: Null pointer dereferences issues
Summary: fix coverity Defect Type: Null pointer dereferences issues
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.2.6
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks: 639035
TreeView+ depends on / blocked
 
Reported: 2010-09-03 17:19 UTC by Nathan Kinder
Modified: 2015-01-04 23:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-17 14:08:46 UTC


Attachments (Terms of Use)
Patch for cov#11933 (1.29 KB, patch)
2010-09-13 17:00 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#11938 (1.36 KB, patch)
2010-09-13 20:29 UTC, Nathan Kinder
no flags Details | Diff
Patch for cov#11946 (1.07 KB, patch)
2010-09-13 20:35 UTC, Nathan Kinder
nhosoi: review-
Details | Diff
Revised patch for cov#11938 (1.09 KB, patch)
2010-09-13 21:58 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#11964 (4.71 KB, patch)
2010-09-13 21:59 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#12143 (1.26 KB, patch)
2010-09-13 22:07 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#12148 (1.25 KB, patch)
2010-09-14 15:37 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#12182 (1.09 KB, patch)
2010-09-14 16:15 UTC, Nathan Kinder
no flags Details | Diff
Patch for cov#12182 & cov#12183 (1.34 KB, patch)
2010-09-14 16:23 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15460 (1.43 KB, patch)
2010-09-14 17:30 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15461 (1.27 KB, patch)
2010-09-14 18:02 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15462 (1.28 KB, patch)
2010-09-14 18:20 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15463 (1.38 KB, patch)
2010-09-14 18:29 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15464 (1.09 KB, patch)
2010-09-14 18:45 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15465 (1.13 KB, patch)
2010-09-14 20:54 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15473 (1.15 KB, patch)
2010-09-14 21:55 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15505 (1.78 KB, patch)
2010-09-14 22:46 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15506 (1.43 KB, patch)
2010-09-15 15:29 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15507 (1.44 KB, patch)
2010-09-15 15:48 UTC, Nathan Kinder
no flags Details | Diff
Patch for cov#15507 & cov#15508 (1.45 KB, patch)
2010-09-15 15:51 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15509 (969 bytes, patch)
2010-09-15 15:56 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Additional patch for cov#11938 (1.00 KB, patch)
2010-09-15 19:17 UTC, Nathan Kinder
nhosoi: review+
nkinder: review?
Details | Diff
Patch for cov#15477 (1.27 KB, patch)
2010-09-15 20:32 UTC, Nathan Kinder
nkinder: review?
nkinder: review?
rmeggins: review+
Details | Diff

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.


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