diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-11-17 11:19:55 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-11-17 11:19:55 +0000 |
commit | ba9d78faeba9024c3e8840579c3b0e959ae2cb0f (patch) | |
tree | 70ca8a9272467113b7f91e91734a4121bb557c9e | |
parent | Prevent deref null pointer in HTMLlineproc0() (diff) | |
download | w3m-ba9d78faeba9024c3e8840579c3b0e959ae2cb0f.tar.gz w3m-ba9d78faeba9024c3e8840579c3b0e959ae2cb0f.zip |
Prevent global-buffer-overflow in parseURL()
Bug-Debian: https://github.com/tats/w3m/issues/41
-rw-r--r-- | url.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -841,7 +841,10 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current) case '#': p_url->host = copyPath(q, p - q, COPYPATH_SPC_IGNORE | COPYPATH_LOWERCASE); - p_url->port = DefaultPort[p_url->scheme]; + if (p_url->scheme != SCM_UNKNOWN) + p_url->port = DefaultPort[p_url->scheme]; + else + p_url->port = 0; break; } analyze_file: |