mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-18 16:49:18 +03:00
Test numbers before calling strncmp.
svn path=/trunk/netsurf/; revision=13107
This commit is contained in:
parent
d64e09aef7
commit
a4dc04e44a
@ -853,14 +853,13 @@ static nserror nsurl__create_from_section(const char const *url_s,
|
|||||||
1 : 0;
|
1 : 0;
|
||||||
sec_start = norm_start + colon - pegs->at +
|
sec_start = norm_start + colon - pegs->at +
|
||||||
skip;
|
skip;
|
||||||
if (url->scheme != NULL &&
|
if (url->scheme != NULL && length -
|
||||||
strncmp(lwc_string_data(
|
|
||||||
url->scheme), "http",
|
|
||||||
SLEN("http")) == 0 &&
|
|
||||||
length -
|
|
||||||
(colon - pegs->at + 1) == 2 &&
|
(colon - pegs->at + 1) == 2 &&
|
||||||
*sec_start == '8' &&
|
*sec_start == '8' &&
|
||||||
*(sec_start + 1) == '0') {
|
*(sec_start + 1) == '0' &&
|
||||||
|
strncmp(lwc_string_data(
|
||||||
|
url->scheme), "http",
|
||||||
|
SLEN("http")) == 0) {
|
||||||
/* Scheme is http, and port is default
|
/* Scheme is http, and port is default
|
||||||
* (80) */
|
* (80) */
|
||||||
flags |= NSURL_F_NO_PORT;
|
flags |= NSURL_F_NO_PORT;
|
||||||
|
Loading…
Reference in New Issue
Block a user