Skip to content

SEGFAULT on tx_run #35

@saulvaldelvira

Description

@saulvaldelvira

When executing a statement on a transaction -via neo4j_run_in_tx- sometimes the program crashes with a segmentation fault.

I've traced the problem to be on line 324 of the transaction.c file.

  if (neo4j_check_failure(tx->results))
    {
      if (strcmp(neo4j_error_code(tx->results),   // <--- this one
                 "Neo.ClientError.Transaction.TransactionTimedOut") == 0) {
        tx->failed = 1;
        tx->is_expired = 1;
        return NULL;
      }
    }

The neo4j_error_code function returns a NULL pointer and causes strcmp to crash.

I don't know if this is a bug on the tx_run function or in neo4j_error_code.
Should neo4j_error_code always return a value?. If not, there should be a check on the tx_run function.

const char *ec = neo4j_error_code(tx->results);
if (ec && strcmp(ec, ....

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