]> git.sur5r.net Git - openldap/commitdiff
ITS#5558 fix buffer count
authorHoward Chu <hyc@openldap.org>
Sat, 14 Jun 2008 02:50:59 +0000 (02:50 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 14 Jun 2008 02:50:59 +0000 (02:50 +0000)
servers/slapd/back-shell/result.c
servers/slapd/back-sock/result.c

index 4713d3057caa820d5ad18b3077767c569ac1d62f..b9a8af976318eeb0d526435ed8d9eee869850b93 100644 (file)
@@ -80,7 +80,7 @@ read_and_send_results(
                }
 
                len = strlen( line );
-               while ( bp + len - buf > bsize ) {
+               while ( bp + len + 1 - buf > bsize ) {
                        size_t offset = bp - buf;
                        bsize += BUFSIZ;
                        buf = (char *) ch_realloc( buf, bsize );
index f6fcad35cebfe9f48cd24a93fd3788ab3f429edf..537d5bc78e34506256205b448015042db79c50b7 100644 (file)
@@ -77,7 +77,7 @@ sock_read_and_send_results(
                }
 
                len = strlen( line );
-               while ( bp + len - buf > bsize ) {
+               while ( bp + len + 1 - buf > bsize ) {
                        size_t offset = bp - buf;
                        bsize += BUFSIZ;
                        buf = (char *) ch_realloc( buf, bsize );