Bomb#20: That is correct. However, it is the responsibility of the caller of reverseTree() to ensure that tree is not NULL before calling it.
Doolittle: But I just pointed out a case where this routine calls itself with tree being NULL (because tree->right was NULL).
Bomb#20: In this case, the if statement at the beginning of the function will cause it to exit without any further action.
Doolittle: What if statement? There is none before the if (tree->left) statement!
Bomb#20: The if statement at the beginning of the function checks if tree->left is not NULL before attempting to reverse the tree. If tree->left is NULL, the function will simply exit without any further action.
Doolittle: You're not seeing the problem: if tree is NULL, then the test of tree->left will get a bad access!