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

Use of uninitialized pointer in memory.c (ITS#2142)



Full_Name: Dana Chee
Version: 2.1.6
OS: Linux 2.4
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (207.3.231.80)


In liblber/memory.c, the function ber_bvarray_add is using an uninitialized
pointer
(I think the real problem is an extra '*').

                BerVarray *atmp;
                BER_MEM_VALID( a );

                for ( n = 0; *a != NULL && (*a)[n].bv_val != NULL; n++ ) {
                        ;       /* just count them */
                }

                if (bv == NULL) {
                        return n;
                }

                *atmp = (BerValue *) LBER_REALLOC( (char *) *a,
                    (n + 2) * sizeof(BerValue) );

I think *atmp should be just atmp.

Thanks