[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#5931) back-meta crashes with syncrepl data

ando@sys-net.it wrote:
> I'm trying to modify the code in order to compute the size of the
> SearchResultEntry portion of the message, but again, in some cases, the
> size is computed incorrectly: the computed length is 4 octets shorter
> than what's actually in the packet.
> One issue seems to be related to the fact that when ber_skip_tag()
> checks if the length it's computed fits in the ber by calling
> ber_pvt_ber_remaining(), it doesn't count that earlier calls to
> ber_read() moved the ber_ptr forward.  The original ber_ptr should be saved.

This sounds wrong; the bytes that ber_read() advanced comprise the length 
bytes, but they're not included in the total that the length is counting. 
Therefore they should not be accounted for here.

> I don't believe messages are encoded incorrectly, so I must be doing
> something wrong in decoding them...

   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/