Skip to content

Segfault on calling neo4j_free_tx with null pointer #33

@johannessen

Description

@johannessen

Calling free() with a null pointer should be a no-op in C. But neo4j_free_tx() currently tries to dereference the given pointer without verifying it’s valid, which causes a segmentation fault.

neo4j_transaction_t *tx = 0;
neo4j_free_tx(tx);
// Segmentation fault

If the given pointer is null, neo4j_free_tx() should simply return immediately, just like neo4j_config_free() correctly does:

void neo4j_config_free(neo4j_config_t *config)
{
if (config == NULL)
{
return;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions