mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-18 21:26:29 -05:00
ITS#9959 Nul-terminate addresses
Debug(LDAP_DEBUG_CONNS, ...) gets these passed as %s, reaching just beyond the allocated buffer.
This commit is contained in:
parent
dcbb48dec7
commit
cb6e2e555e
1 changed files with 4 additions and 2 deletions
|
|
@ -255,17 +255,19 @@ upstream_name_cb( int result, struct evutil_addrinfo *res, void *arg )
|
|||
}
|
||||
|
||||
conn = ch_calloc( 1, sizeof(LloadPendingConnection) +
|
||||
peerbv.bv_len + localbv.bv_len );
|
||||
peerbv.bv_len + 1 + localbv.bv_len + 1 );
|
||||
LDAP_LIST_ENTRY_INIT( conn, next );
|
||||
conn->backend = b;
|
||||
conn->fd = s;
|
||||
|
||||
conn->localbv.bv_val = (char *)(conn + 1);
|
||||
memcpy( conn->localbv.bv_val, localbv.bv_val, localbv.bv_len );
|
||||
conn->localbv.bv_val[localbv.bv_len] = '\0';
|
||||
conn->localbv.bv_len = localbv.bv_len;
|
||||
|
||||
conn->peerbv.bv_val = conn->localbv.bv_val + localbv.bv_len;
|
||||
conn->peerbv.bv_val = conn->localbv.bv_val + localbv.bv_len + 1;
|
||||
memcpy( conn->peerbv.bv_val, peerbv.bv_val, peerbv.bv_len );
|
||||
conn->peerbv.bv_val[peerbv.bv_len] = '\0';
|
||||
conn->peerbv.bv_len = peerbv.bv_len;
|
||||
|
||||
conn->event = event_new( lload_get_base( s ), s, EV_WRITE|EV_PERSIST,
|
||||
|
|
|
|||
Loading…
Reference in a new issue