The functions tree_min and tree_max try to go through the treetable from the given node until finding a sentinel. However, when the function receives a sentinel, It will try to go to its children, which have been allocated with calloc to 0. As the children do not correspond to the sentinel, they will try to be dereferenced, causing a segfault.
Here is a minimal program example that will trigger this segfault (the function get first key will use tree_min with the root node, which in this case is the sentinel).
The functions tree_min and tree_max try to go through the treetable from the given node until finding a sentinel. However, when the function receives a sentinel, It will try to go to its children, which have been allocated with calloc to 0. As the children do not correspond to the sentinel, they will try to be dereferenced, causing a segfault. Here is a minimal program example that will trigger this segfault (the function get first key will use tree_min with the root node, which in this case is the sentinel).