@mdperry and I independently found a SEGV condition when switching to the latest version of usher/matUtils: when MAT::get_subtree is called without keep_clade_annotations=true, and the tree contains clade annotations, get_subtree creates new nodes with clade_annotations size 0 but then attempts to copy the existing node's clade annotations. This was an unintended side effect of 052cf4a6 (which solved a different problem that could occur when keep_clade_annotations=true is passed in).
The solution is to limit the loop that copies clade annotations into the new node to the minimum of num_annotations (which is 0 when keep_clade_annotations is false) and source node's clade_annotations.size(), so overrun of clade_annotations is prevented for both the new node and the existing node.
@mdperry and I independently found a SEGV condition when switching to the latest version of usher/matUtils: when MAT::get_subtree is called without keep_clade_annotations=true, and the tree contains clade annotations, get_subtree creates new nodes with clade_annotations size 0 but then attempts to copy the existing node's clade annotations. This was an unintended side effect of 052cf4a6 (which solved a different problem that could occur when keep_clade_annotations=true is passed in).
The solution is to limit the loop that copies clade annotations into the new node to the minimum of num_annotations (which is 0 when keep_clade_annotations is false) and source node's clade_annotations.size(), so overrun of clade_annotations is prevented for both the new node and the existing node.