QDoc: Ensure readIndexSection() does not create Nodes with null parent
readIndexSection() in QDocIndexFiles is used both for constructing
new Node (subclass) instances, and amending already created nodes
with new information. Therefore, the 'parent' node may or may not be
valid for an individual call of readIndexSection().
The only Node instance that is allowed to have a null parent is the
root NamespaceNode, and that node is not constructed by
QDocIndexFiles.
Not checking for a valid parent before constructing nodes leads to
potential memory leaks and/or null pointer dereferences if the
.index file being read is malformed.
Add such checks.
Fixes: QTBUG-146642
Pick-to: 6.11
Change-Id: I1a3b0af519980168ed3e2a5102bea697ba72cd87
Reviewed-by: Paul Wicking <paul.wicking@qt.io>