On Wed, 2018-03-07 at 09:34 +0000, David Woodhouse wrote:
> Maybe we should pass the xmlNode into add_option() not a string? Then
> it's nice and simple. And more xmlnode_get_text() invocations can turn
> into simple xmlnode_is_named()? The above code becomes
>         for (xml_node = xml_node->children; xml_node; 
> xml_node=xml_node->next) {
>                 if (!xmlnode_is_named(xml_node, "ip-address"))
>                         vpninfo->ip_info.addr = add_option(vpninfo, "ipaddr", 
> xml_node);

There's a problem with that suggestion if xmlNodeGetContent() on the
node returns NULL. Previously, xmlnode_get_text() would fail on that
one, while xmlnode_is_named() would have matched it. Is that a thing
that can actually happen? Do we need to cope gracefully, or merely make
sure we don't crash? 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

openconnect-devel mailing list

Reply via email to