Skip to content

Commit

Permalink
fix <select>/<option> parsing bug
Browse files Browse the repository at this point in the history
The Juniper form-handling code was setting <select>/<option> labels
identically to their values.

Presumably, this was never caught before because they never actually differ
in real Juniper login forms? (but they do in F5 forms)

That is, a Juniper <option> field always looks like…

    <select name="realm">
      <option value="Something">Something</option>
      <option value="Another">Another</option>
    </select>

… and never like this:

    <select name="realm">
      <option value="group1">Something</option>
      <option value="group2">Another</option>
    </select>

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
  • Loading branch information
dlenski committed Feb 23, 2021
1 parent 488e802 commit 00dd4ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions auth-html.c
Expand Up @@ -170,9 +170,8 @@ int parse_select_node(struct openconnect_info *vpninfo, struct oc_auth_form *for
return -ENOMEM;
}

xmlnode_get_prop(node, "name", &choice->name);
xmlnode_get_prop(child, "value", &choice->name);
choice->label = (char *)xmlNodeGetContent(child);
choice->name = strdup(choice->label);
new_choices = realloc(opt->choices, sizeof(opt->choices[0]) * (opt->nr_choices+1));
if (!new_choices) {
free_opt((void *)opt);
Expand Down

0 comments on commit 00dd4ce

Please sign in to comment.