}
 }
 
+#define        LDIF_MAXLINE    4096
+
 /*
  * ldif_read_record - read an ldif record.  Return 1 for success, 0 for EOF.
  */
        char        **bufp,     /* ptr to malloced output buffer           */
        int         *buflenp )  /* ptr to length of *bufp                  */
 {
-       char        linebuf[BUFSIZ], *line, *nbufp;
+       char        linebuf[LDIF_MAXLINE], *line, *nbufp;
        ber_len_t   lcur = 0, len, linesize;
        int         last_ch = '\n', found_entry = 0, stop, top_comment = 0;
 
                }
 
                if ( *buflenp - lcur <= len ) {
-                       *buflenp += len + BUFSIZ;
+                       *buflenp += len + LDIF_MAXLINE;
                        nbufp = ber_memrealloc( *bufp, *buflenp );
                        if( nbufp == NULL ) {
                                return 0;