https://bugs.openldap.org/show_bug.cgi?id=10452

--- Comment #2 from [email protected] ---
I have a follow-up question regarding a similar issue in slap_acl_mask()
(source file servers/slapd/acl.c, openldap 2.6.8).

There is a null check for `op->o_conn->c_listener` around lines 1245-1248:
```
if ( !BER_BVISEMPTY( &b->a_sockurl_pat ) ) {
        if ( ! op->o_conn->c_listener ) {
                continue;
        }
```

If this field is not present, the current iteration is safely skipped. However,
this only happens when `&b->a_sockurl_pat` is not empty.

Later in the same function, around lines 1491-1494, `c_listener` is
dereferenced via `c_sock_name` (`c_listener->sl_name`) without an explicit
null-check:
```
if ( !BER_BVISEMPTY( &b->a_sockname_pat ) ) {
        if ( BER_BVISNULL( &op->o_conn->c_sock_name ) ) {
                continue;
        }
```

I'm trying to understand whether the conditions `!BER_BVISEMPTY(
&b->a_sockname_pat )` and `!BER_BVISEMPTY( &b->a_sockurl_pat )` are correlated
in any way that ensures we cannot reach lines 1491-1494 with
`op->o_conn->c_listener == NULL`. If not, it might be safer to add a null check
here. I'd appreciate any clarification.

-- 
You are receiving this mail because:
You are on the CC list for the issue.

Reply via email to