From: Howard Chu Date: Sat, 14 Jun 2008 02:50:59 +0000 (+0000) Subject: ITS#5558 fix buffer count X-Git-Tag: LOCKER_IDS~109 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=04c841209dc03dd54fdb6cb527054e0acf310db4;p=openldap ITS#5558 fix buffer count --- 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 );