summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2010-09-13 13:50:42 -0700
committerNathan Kinder <nkinder@redhat.com>2010-09-15 09:11:05 -0700
commit243ba589c5a69a42bdae8459bd3e6d2e65853de8 (patch)
tree35c80e1e19b5a4d3a1234e3d6545a4d2a3286e49
parent839e52c73e04e782c8069fe9c9e1aeea0b73a1c0 (diff)
downloadds-243ba589c5a69a42bdae8459bd3e6d2e65853de8.tar.gz
ds-243ba589c5a69a42bdae8459bd3e6d2e65853de8.tar.xz
ds-243ba589c5a69a42bdae8459bd3e6d2e65853de8.zip
Bug 630097 - (cov#11938) NULL dereference in mmldif
There is a chance that we can deference a NULL pointer in the mmldif code. If "(numb > tot_b)" is true, it is not guaranteed that "a" is non-NULL. We need to check if "a" is NULL before dereferencing it in the "(cmp < 0)" case.
-rw-r--r--ldap/servers/slapd/tools/mmldif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c
index 291702a8..665452cb 100644
--- a/ldap/servers/slapd/tools/mmldif.c
+++ b/ldap/servers/slapd/tools/mmldif.c
@@ -1086,7 +1086,7 @@ addmodified(FILE * edf3, attrib1_t * attrib, record_t * first)
} else {
cmp = stricmp(a->name, attribname(b));
}
- if (cmp < 0) {
+ if ((cmp < 0) && (a != NULL)) {
/* a < b: a is deleted */
attrname = a->name;
fprintf(edf3, "delete: %s\n-\n", attrname);