Skip to content

transport_arbiter addPendingClient with dynamic allocation policy #340

@Diagano

Description

@Diagano

Hi,

First thanks for the latest drop of 1.10.0.
I think this is a potential bug, posting first as Q because this is only from static analysis.

TransportArbitrator::addPendingClient()

    if (m_clientFreeList == NULL)
    {
        info = createPendingClient();
    }

createPendingClient() use of ERPC_CREATE_NEW_OBJECT, which in the case of dynamic allocation uses new (std::nothrow), can return NULL which is not tested. The calling code does test for toke=0 (TransportArbitrator::prepareClientReceive) but before that the following part in addPendingClient () will fail:

    // Add to active list.
    info->m_next = m_clientList; //<--
    m_clientList = info;

Is this analysis correct?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions