Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
ce4add49
Commit
ce4add49
authored
12 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'public/bug6472' into maint-0.2.3
parents
991a8acb
223e7cfa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug6472
+4
-0
4 additions, 0 deletions
changes/bug6472
src/or/dns.c
+12
-4
12 additions, 4 deletions
src/or/dns.c
with
16 additions
and
4 deletions
changes/bug6472
0 → 100644
+
4
−
0
View file @
ce4add49
o Minor bugfixes:
- Avoid a pair of double-free and use-after-mark bugs that can
occur with certain timings in canceled and re-received DNS
requests. Fix for bug 6472; bugfix on 0.0.7rc1.
This diff is collapsed.
Click to expand it.
src/or/dns.c
+
12
−
4
View file @
ce4add49
...
...
@@ -450,16 +450,17 @@ purge_expired_resolves(time_t now)
if
(
resolve
->
pending_connections
)
{
log_debug
(
LD_EXIT
,
"Closing pending connections on timed-out DNS resolve!"
);
tor_fragile_assert
();
while
(
resolve
->
pending_connections
)
{
pend
=
resolve
->
pending_connections
;
resolve
->
pending_connections
=
pend
->
next
;
/* Connections should only be pending if they have no socket. */
tor_assert
(
!
SOCKET_OK
(
pend
->
conn
->
_base
.
s
));
pendconn
=
pend
->
conn
;
connection_edge_end
(
pendconn
,
END_STREAM_REASON_TIMEOUT
);
circuit_detach_stream
(
circuit_get_by_edge_conn
(
pendconn
),
pendconn
);
connection_free
(
TO_CONN
(
pendconn
));
if
(
!
pendconn
->
_base
.
marked_for_close
)
{
connection_edge_end
(
pendconn
,
END_STREAM_REASON_TIMEOUT
);
circuit_detach_stream
(
circuit_get_by_edge_conn
(
pendconn
),
pendconn
);
connection_free
(
TO_CONN
(
pendconn
));
}
tor_free
(
pend
);
}
}
...
...
@@ -1091,6 +1092,13 @@ dns_found_answer(const char *address, uint8_t is_reverse, uint32_t addr,
pendconn
=
pend
->
conn
;
/* don't pass complex things to the
connection_mark_for_close macro */
assert_connection_ok
(
TO_CONN
(
pendconn
),
time
(
NULL
));
if
(
pendconn
->
_base
.
marked_for_close
)
{
/* prevent double-remove. */
pendconn
->
_base
.
state
=
EXIT_CONN_STATE_RESOLVEFAILED
;
resolve
->
pending_connections
=
pend
->
next
;
tor_free
(
pend
);
continue
;
}
tor_addr_from_ipv4h
(
&
pendconn
->
_base
.
addr
,
addr
);
pendconn
->
address_ttl
=
ttl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment