Bug 750624 - Fix Coverity (11053) Explicit null dereferenced: slapi_dn_normalize_ext (slapd/dn.c)
Summary: Fix Coverity (11053) Explicit null dereferenced: slapi_dn_normalize_ext (slap...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.2.10
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: 389_1.2.10 781504
TreeView+ depends on / blocked
 
Reported: 2011-11-01 19:32 UTC by Noriko Hosoi
Modified: 2015-12-10 18:44 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 781504 (view as bug list)
Environment:
Last Closed: 2015-12-10 18:44:43 UTC
Embargoed:


Attachments (Terms of Use)
git patch file (master) (1.63 KB, patch)
2011-11-02 17:02 UTC, Noriko Hosoi
nhosoi: review?
rmeggins: review+
Details | Diff

Description Noriko Hosoi 2011-11-01 19:32:04 UTC
Description of problem:
If NULL string or size 0 string to slapi_dn_normalization_ext, NULL dereference would occur.

Comment 1 Noriko Hosoi 2011-11-01 22:52:29 UTC
Actually, there is no possibility to set '\0' to *d if "d == NULL" because the condition "rc > 0" never be fulfilled. (rc > 0 is set only when the input string contains '"' or '\'.) Thus, change the severity to minor.

Comment 2 Noriko Hosoi 2011-11-02 17:02:11 UTC
Created attachment 531390 [details]
git patch file (master)

Bug Description: Dereferencing null variable "d".
There is no possibility that (rc > 0) && (d == NULL), but it's
safe to check if d is not NULL before assigning '\0' to *d.

Fix Description: add checking if "d" is NULL or not before
assigning '\0' to *d.

Comment 3 Noriko Hosoi 2011-11-02 23:10:19 UTC
Reviewed by Rich (Thank you!!)

Pushed to master.

commit 54a3d99a96d84b42f680da43c7f638009c0f64d4
Author: Noriko Hosoi <nhosoi.redhat.com>
Date:   Tue Nov 1 16:05:12 2011 -0700

    Bug 750624 - Fix Coverity (11053) Explicit null dereferenced:
                 slapi_dn_normalize_ext (slapd/dn.c)

$ git merge 54a3d99a96d84b42f680da43c7f638009c0f64d4
Updating 6af5ece..54a3d99
Fast-forward
 ldap/servers/slapd/dn.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

$ git push
Counting objects: 11, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 870 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   6af5ece..54a3d99  master -> master

Comment 4 Rich Megginson 2012-01-10 20:18:22 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/241


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