Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hangs reading xml #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix hangs reading xml #27

wants to merge 2 commits into from

Commits on Jun 10, 2021

  1. Fix hangs when reading bad xml

    The xml library functions return -1 on error and 0 on EOF.  A number of
    loops of the form "while (result)" would loop forever on an error.
    
    Change this to "while (result > 0)", so that they exit on an error.
    
    The return value of the functions in xml.c that did this will be 1 on
    success and 0 on EOF *or error*.  So the code using the xml.c functions
    will be ok as is.
    
    Example that hangs:
    <listen> <port> 123 <port> </listen>
    
    The 2nd <port> is missing the slash and doesn't terminate the element,
    so </listen> is unmatched and it will hang on that error.
    xyzzy42 committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    f575507 View commit details
    Browse the repository at this point in the history
  2. Fix hang on unknown element in listen section

    The code that parsed a listen section would go into an infinite loop if
    it encountered a element with an unknown tag.  Example:
    
    <listen> <typo> hostname </typo> </listen>
    
    It will loop forever on the typo element and not skip it.  Change this
    to print an error and skip the element.
    xyzzy42 committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    c967cd1 View commit details
    Browse the repository at this point in the history