From 023f427856714393a1b9e56ec1ce0395929499d2 Mon Sep 17 00:00:00 2001 From: Cthulhu-throwaway <96153783+Cthulhu-throwaway@users.noreply.github.com> Date: Tue, 22 Feb 2022 04:22:10 -0300 Subject: [PATCH] [UPnP] Stability fixes (#13652) --- libretro-common/net/net_natt.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 01b0e5302c..6b5ab7dc74 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -442,11 +442,14 @@ static bool parse_external_address_node(rxml_node_t *node, /* XML recursion */ rxml_node_t *child = node->children; - do + if (child) { - if (parse_external_address_node(child, device)) - return true; - } while ((child = child->next)); + do + { + if (parse_external_address_node(child, device)) + return true; + } while ((child = child->next)); + } } return false; @@ -522,11 +525,14 @@ static bool parse_open_port_node(rxml_node_t *node, /* XML recursion */ rxml_node_t *child = node->children; - do + if (child) { - if (parse_open_port_node(child, request)) - return true; - } while ((child = child->next)); + do + { + if (parse_open_port_node(child, request)) + return true; + } while ((child = child->next)); + } } return false;