Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chaosframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
chaos-lnf-control
chaosframework
Commits
492a0dc6
Commit
492a0dc6
authored
8 years ago
by
Claudio Bisegni
Browse files
Options
Downloads
Patches
Plain Diff
fix the event server invalid write
parent
3e8abe9d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChaosMetadataServiceClientTest/main.cpp
+1
-1
1 addition, 1 deletion
ChaosMetadataServiceClientTest/main.cpp
chaos/common/event/EventServer.cpp
+5
-5
5 additions, 5 deletions
chaos/common/event/EventServer.cpp
with
6 additions
and
6 deletions
ChaosMetadataServiceClientTest/main.cpp
+
1
−
1
View file @
492a0dc6
...
...
@@ -48,7 +48,7 @@ public chaos::metadata_service_client::event::alert::AlertLogEventHandler {
public:
void
handleLogEvent
(
const
std
::
string
&
source
,
const
std
::
string
&
domain
)
{
MSCT_INFO
<<
source
<<
"-"
<<
domain
;
MSCT_INFO
<<
"EVENT---->"
<<
source
<<
"-"
<<
domain
;
}
};
...
...
This diff is collapsed.
Click to expand it.
chaos/common/event/EventServer.cpp
+
5
−
5
View file @
492a0dc6
...
...
@@ -45,13 +45,13 @@ void EventServer::dispatchEventToHandler(const unsigned char * const serializedE
if
(
*
((
uint16_t
*
)
serializedEvent
)
!=
0x4345
)
throw
CException
(
2
,
"Bad event signature"
,
"EventServer::dispatchEventToHandler"
);
if
(
length
>
EVT_DATA_MAX_BYTE_LENGTH
)
throw
CException
(
1
,
"Event memory size exceed the max allowed"
,
"EventServer::dispatchEventToHandler"
);
//check the type
//check the type
auto_ptr
<
EventTypeAndPriority
>
eventTypeAndHeaderPtr
(
new
EventTypeAndPriority
());
//get header swapped checking endian conversion
*
((
uint
16
_t
*
)
eventTypeAndHeaderPtr
.
get
())
=
byte_swap
<
little_endian
,
host_endian
,
uint
16
_t
>
(
*
((
uint
16
_t
*
)(
serializedEvent
+
EVT_HEADER_BYTE_LENGTH
)));
//get header swapped checking endian conversion
*
((
uint
8
_t
*
)
eventTypeAndHeaderPtr
.
get
())
=
byte_swap
<
little_endian
,
host_endian
,
uint
8
_t
>
(
*
((
uint
8
_t
*
)(
serializedEvent
+
EVT_HEADER_BYTE_LENGTH
)));
//dispatcher the event in the root handler on one of the fourth method
//dispatcher the event in the root handler on one of the fourth method
switch
(
eventTypeAndHeaderPtr
->
type
)
{
case
EventTypeAlert
:
{
alert
::
AlertEventDescriptor
*
result
=
new
alert
::
AlertEventDescriptor
();
...
...
@@ -74,4 +74,4 @@ void EventServer::dispatchEventToHandler(const unsigned char * const serializedE
DECODE_CHAOS_EXCEPTION
(
ex
);
}
}
\ No newline at end of file
}
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