From 04c841209dc03dd54fdb6cb527054e0acf310db4 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 14 Jun 2008 02:50:59 +0000 Subject: [PATCH] ITS#5558 fix buffer count --- servers/slapd/back-shell/result.c | 2 +- servers/slapd/back-sock/result.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-shell/result.c b/servers/slapd/back-shell/result.c index 4713d3057c..b9a8af9763 100644 --- a/servers/slapd/back-shell/result.c +++ b/servers/slapd/back-shell/result.c @@ -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 ); diff --git a/servers/slapd/back-sock/result.c b/servers/slapd/back-sock/result.c index f6fcad35ce..537d5bc78e 100644 --- a/servers/slapd/back-sock/result.c +++ b/servers/slapd/back-sock/result.c @@ -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 ); -- 2.39.5