Skip to content

Avoid use of libcgi_error() and add real error handling #53

@LeSpocky

Description

@LeSpocky

That API function is problematic in multiple ways:

  • exit terminates the whole process, from a library, … well you don't do that, pass your error codes and let the application decide!
  • cgi_init_headers() is called, if you want or not
  • no actual error handling, which could lead to all kinds of null pointer dereferences, use after free, and so on :-/
  • all depending on global variable cgi_display_errors (initialized with 1 aka true)
    • if cgi_display_errors is set, the process will be terminated (see above)
    • if cgi_display_errors is not set, libcgi_error() returns short and there's actually no error handling at all (see above)
  • the function is exposed to the API, so a consumer could call it: WHY? o.O

NOTE: just avoiding libcgi_error() does not solve that missing error handling!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions