Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

src: fix url parsing crash on missing host #222

Closed
wants to merge 1 commit into from
Closed

Conversation

jay
Copy link
Contributor

@jay jay commented Feb 23, 2015

(http_parse_host)

  • Check for invalid parameters.
  • Cast field offset assignment to proper type.

(http_parser_parse_url)

  • Check for invalid parameters.
  • Cast field offset assignment to proper type.
  • Fail if the schema field was found but the host field was not found.
  • Call http_parse_host only if the host field was found.

Prior to this change http_parse_host, which expects the UF_HOST field to
be filled, could be called even when that field was not filled resulting
in a crash. Refer to issue #209.

(http_parse_host)
- Check for invalid parameters.
- Cast field offset assignment to proper type.

(http_parser_parse_url)
- Check for invalid parameters.
- Cast field offset assignment to proper type.
- Fail if the schema field was found but the host field was not found.
- Call http_parse_host only if the host field was found.

Prior to this change http_parse_host, which expects the UF_HOST field to
be filled, could be called even when that field was not filled resulting
in a crash. Refer to issue nodejs#209.
@indutny
Copy link
Member

indutny commented Feb 24, 2015

Thanks, but this change is unnecessary. The problem is that the structure should be zero-initialized and this is not documented anywhere (nor used in url_parser).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants