Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
48054086
Commit
48054086
authored
May 09, 2012
by
Kristian Lyngstol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify range of port numbers before using them
Fixes #1035
parent
a0e3078f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
r01035.vtc
bin/varnishtest/tests/r01035.vtc
+8
-0
vss.c
lib/libvarnish/vss.c
+6
-1
No files found.
bin/varnishtest/tests/r01035.vtc
0 → 100644
View file @
48054086
varnishtest "Test case for #1035"
varnish v1 -arg "-a 127.0.0.1:80 -b localhost:8080"
varnish v1 -cliok "param.set listen_address 127.0.0.1:80"
varnish v1 -clierr 106 "param.set listen_address 127.0.0.1:65540"
varnish v1 -clierr 106 "param.set listen_address 127.0.0.1:65536"
varnish v1 -clierr 106 "param.set listen_address 127.0.0.1:-1"
varnish v1 -cliok "param.set listen_address 127.0.0.1:65535"
lib/libvarnish/vss.c
View file @
48054086
...
...
@@ -135,6 +135,7 @@ VSS_resolve(const char *addr, const char *port, struct vss_addr ***vap)
struct
addrinfo
hints
,
*
res0
,
*
res
;
struct
vss_addr
**
va
;
int
i
,
ret
;
long
int
ptst
;
char
*
adp
,
*
hop
;
*
vap
=
NULL
;
...
...
@@ -148,8 +149,12 @@ VSS_resolve(const char *addr, const char *port, struct vss_addr ***vap)
if
(
adp
==
NULL
)
ret
=
getaddrinfo
(
addr
,
port
,
&
hints
,
&
res0
);
else
else
{
ptst
=
strtol
(
adp
,
NULL
,
10
);
if
(
ptst
<
0
||
ptst
>
65535
)
return
(
0
);
ret
=
getaddrinfo
(
hop
,
adp
,
&
hints
,
&
res0
);
}
free
(
hop
);
free
(
adp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment