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
b23455db
Commit
b23455db
authored
Apr 21, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UB in scribe::consume
parent
9f269a78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
libcaf_io/caf/io/network/manager.hpp
libcaf_io/caf/io/network/manager.hpp
+0
-1
libcaf_io/src/scribe.cpp
libcaf_io/src/scribe.cpp
+3
-0
No files found.
libcaf_io/caf/io/network/manager.hpp
View file @
b23455db
...
@@ -75,7 +75,6 @@ protected:
...
@@ -75,7 +75,6 @@ protected:
/// Detaches this manager from `ptr`.
/// Detaches this manager from `ptr`.
virtual
void
detach_from
(
abstract_broker
*
ptr
)
=
0
;
virtual
void
detach_from
(
abstract_broker
*
ptr
)
=
0
;
private:
strong_actor_ptr
parent_
;
strong_actor_ptr
parent_
;
};
};
...
...
libcaf_io/src/scribe.cpp
View file @
b23455db
...
@@ -47,6 +47,9 @@ void scribe::consume(execution_unit* ctx, const void*, size_t num_bytes) {
...
@@ -47,6 +47,9 @@ void scribe::consume(execution_unit* ctx, const void*, size_t num_bytes) {
// further activities for the broker
// further activities for the broker
return
;
return
;
}
}
// keep a strong reference to our parent until we leave scope
// to avoid UB when becoming detached during invocation
auto
guard
=
parent_
;
auto
&
buf
=
rd_buf
();
auto
&
buf
=
rd_buf
();
CAF_ASSERT
(
buf
.
size
()
>=
num_bytes
);
CAF_ASSERT
(
buf
.
size
()
>=
num_bytes
);
// make sure size is correct, swap into message, and then call client
// make sure size is correct, swap into message, and then call client
...
...
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