mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
If the parent parameter of get_dom_node_list_index referred to a node that did not have children, then get_dom_node_list called by it could return the address of a null pointer, and get_dom_node_list_index would then pass that null pointer to get_dom_node_list_pos, which would crash. That would be the same kind of crash as the one in get_dom_node_child. It never happened in practice though: because all calls are in the form get_dom_node_list_index(node->parent, node), the list must contain at least the given node, and the pointer cannot be null. The documentation of get_dom_node_list_index allows arbitrary nodes as arguments however, so it's best to add a check.