Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
0a66cc86
Commit
0a66cc86
authored
Jun 30, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix heap-use-after-free in filtering downstream
parent
4f2ad1bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
libcaf_core/caf/downstream_policy.hpp
libcaf_core/caf/downstream_policy.hpp
+1
-1
libcaf_core/caf/filtering_downstream.hpp
libcaf_core/caf/filtering_downstream.hpp
+8
-2
No files found.
libcaf_core/caf/downstream_policy.hpp
View file @
0a66cc86
...
...
@@ -149,7 +149,7 @@ public:
bool
is_redeployable
);
/// Removes a downstream path without aborting the stream.
bool
remove_path
(
strong_actor_ptr
&
ptr
);
virtual
bool
remove_path
(
strong_actor_ptr
&
ptr
);
/// Returns the state for `ptr.
downstream_path
*
find
(
const
strong_actor_ptr
&
ptr
)
const
;
...
...
libcaf_core/caf/filtering_downstream.hpp
View file @
0a66cc86
...
...
@@ -101,6 +101,11 @@ public:
}
}
bool
remove_path
(
strong_actor_ptr
&
ptr
)
override
{
erase_from_lanes
(
ptr
);
return
Base
::
remove_path
(
ptr
);
}
void
add_lane
(
filter
f
)
{
std
::
sort
(
f
);
lanes_
.
emplace
(
std
::
move
(
f
),
typename
super
::
buffer_type
{});
...
...
@@ -127,13 +132,14 @@ private:
void
erase_from_lanes
(
const
strong_actor_ptr
&
x
)
{
for
(
auto
i
=
lanes_
.
begin
();
i
!=
lanes_
.
end
();
++
i
)
if
(
erase_from_lane
(
i
->
second
,
x
))
{
if
(
i
->
second
.
empty
())
if
(
i
->
second
.
paths
.
empty
())
lanes_
.
erase
(
i
);
return
;
}
}
bool
erase_from_lane
(
lane
&
l
,
const
strong_actor_ptr
&
x
)
{
auto
predicate
=
[
&
](
const
typename
super
::
path
*
y
)
{
auto
predicate
=
[
&
](
const
downstream_
path
*
y
)
{
return
x
==
y
->
hdl
;
};
auto
e
=
l
.
paths
.
end
();
...
...
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