On 9/6/21 12:28 PM, Yann Ylavic wrote:
> On Mon, Sep 6, 2021 at 12:16 PM Ruediger Pluem <rpl...@apache.org> wrote:
>>
!ap_cstr_casecmpn(uds_url, "unix:", 5) &&
>>
>> Why doing case insensitive checks here? Shouldn't we insist on case here and
>> use strncmp ?
>
> Yes, correct, spurious change.
>
>>> + {
>>> + apr_table_setn(r->notes, "uds_path", uds_path);
>>> +
>>> + /* Remove the UDS path from *url and r->filename */
>>> + url_len = strlen(origin_url);
>>> + *url = apr_pstrmemdup(r->pool, origin_url, url_len);
>>> + memcpy(uds_url, *url, url_len + 1);
>>
>> With a short uds path and a long origin_url couldn't this be overlapping?
>> I think memcpy is unsafe with overlapping memory and we should stay with
>> memmove.
>
> *url is newly allocated here, so there is no possible overlap with the
> initial r->filename.
Good point. I missed this.
Regards
RĂ¼diger