[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: using uninitialised value? (ITS#3086)



> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of
praveen@messagecare.com

Thanks for the detailed report.

> this issue does not seem to have an impact, but purify
> complains about using
> uninitialised values in decode.c.
>
> I could not find any issues but it this is there from
> openldap 2.0.23. My logs
> are for openldap2.1.29.

There is most likely no impact from this bug since the uninitialized byte is
just an extra padding byte allocated by the library. The BER decoder will
never try to read it since the decoder already knows the actual length of the
message buffer.

Anyway, it is patched now in HEAD. You can try the same fix to whatever
version of the source you're using:

head/libraries/liblber> cvs diff -r1.105 io.c
Index: io.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/libraries/liblber/io.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- io.c        1 Jan 2004 18:15:25 -0000       1.105
+++ io.c        15 Apr 2004 08:25:14 -0000      1.106
@@ -1,5 +1,5 @@
 /* io.c - ber general i/o routines */
-/* $OpenLDAP: pkg/ldap/libraries/liblber/io.c,v 1.105 2004/01/01 18:15:25
kurt Exp $ */
+/* $OpenLDAP: pkg/ldap/libraries/liblber/io.c,v 1.106 2004/04/15 08:25:14
hyc Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
  * Copyright 1998-2004 The OpenLDAP Foundation.
@@ -657,6 +657,7 @@
                                AC_MEMCPY(ber->ber_buf + sblen, ber->ber_ptr,
l);
                                sblen += l;
                        }
+                       *ber->ber_end = '\0';
                        ber->ber_ptr = ber->ber_buf;
                        ber->ber_usertag = 0;
                        if ((ber_len_t)sblen == ber->ber_len) {

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support