File dhcp-4.2.4-ldap-0002-reset-bufix-in-ldap_read_function.patch of Package dhcp

From fb4408fc8e8e83be9b9e005f30d87ae324879f8d Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
Date: Thu, 15 Nov 2012 14:42:21 +0100
References: bnc#784640
Upstream: sent [ISC-Bugs #32217]
Subject: [PATCH] dhcp-ldap: reset bufix in ldap_read_function

Fixed ldap_read_function to reset bufix variable to 0 and
to set buflen to the complete length (do not discard last
character, usually \n).
This caused a parsing error at further run of the function,
e.g. while processing the second dhcpService container that
the dhcpServer object may refer to.
---
 server/ldap.c |    3 ++-
 1 Datei geändert, 2 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/server/ldap.c b/server/ldap.c
index 390adcf..a607499 100644
--- a/server/ldap.c
+++ b/server/ldap.c
@@ -1748,6 +1748,7 @@ static int
 ldap_read_function (struct parse *cfile)
 {
   cfile->inbuf[0] = '\0';
+  cfile->bufix = 0;
   cfile->buflen = 0;
  
   while (ldap_stack != NULL && *cfile->inbuf == '\0')
@@ -1757,7 +1758,7 @@ ldap_read_function (struct parse *cfile)
     return (EOF);
 
   cfile->bufix = 1;
-  cfile->buflen = strlen (cfile->inbuf) - 1;
+  cfile->buflen = strlen (cfile->inbuf);
   if (cfile->buflen > 0)
     ldap_write_debug (cfile->inbuf, cfile->buflen);
 
-- 
1.7.10.4

openSUSE Build Service is sponsored by