From 9da35acf4421a0d57b7b8be1c67e4e8a7021049d Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 14 May 2004 08:03:25 +0000 Subject: [PATCH] Fix ITS#3139, empty output buffer when sb_sasl_write fails --- libraries/libldap/cyrus.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index cb4a25c94b..2b632482a8 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -374,8 +374,11 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) p->buf_out.buf_end = p->buf_out.buf_size; ret = ber_pvt_sb_do_write( sbiod, &p->buf_out ); - if ( ret <= 0 ) + if ( ret <= 0 ) { + /* caller will retry, so clear this buffer out */ + p->buf_out.buf_ptr = p->buf_out.buf_end; return ret; + } return len; } -- 2.39.5