andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From b7437122220518261d34b84aae200140ef1f7c4e Mon Sep 17 00:00:00 2001
dc8c34
From: Stanislav Zidek <szidek@redhat.com>
dc8c34
Date: Wed, 21 Oct 2015 17:58:31 -0700
dc8c34
Subject: [PATCH 369/370] Ticket #48289 - 389-ds-base: ldclt-bin killed by
dc8c34
 SIGSEGV
dc8c34
dc8c34
Description: If NULL source string was passed to parseFilter, it caused
dc8c34
NULL dereference.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/48289
dc8c34
dc8c34
Reviewed by nhosoi@redhat.com.
dc8c34
dc8c34
(cherry picked from commit 5b33c781d2568c930a0856f0a42c1e1d53e3358f)
dc8c34
(cherry picked from commit 8cd610a944daf72a41e5b35065f8b363f8154f28)
dc8c34
(cherry picked from commit 49d0ef667441e009af071fd0f4d48f31f3514063)
dc8c34
---
dc8c34
 ldap/servers/slapd/tools/ldclt/ldclt.c | 5 +++++
dc8c34
 1 file changed, 5 insertions(+)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.c b/ldap/servers/slapd/tools/ldclt/ldclt.c
dc8c34
index 7d22c2d..41ef2c0 100644
dc8c34
--- a/ldap/servers/slapd/tools/ldclt/ldclt.c
dc8c34
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.c
dc8c34
@@ -1213,6 +1213,11 @@ parseFilter (
dc8c34
 {
dc8c34
   int	 i, j;
dc8c34
 
dc8c34
+  if (!src) {
dc8c34
+    printf ("Error: NULL source string is passed.\n");
dc8c34
+    return (-1);
dc8c34
+  }
dc8c34
+
dc8c34
   for (i=0 ; (i
dc8c34
   *head = (char *)malloc(i+1);
dc8c34
   if (*head == NULL)
dc8c34
-- 
dc8c34
2.4.3
dc8c34