Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
fdf162a1
Commit
fdf162a1
authored
Nov 16, 2012
by
Lourens Naudé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LIBZMQ-450] Copy the stream engine endpoint - string reference caused memory corruption
parent
bef9a41b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
stream_engine.cpp
src/stream_engine.cpp
+4
-2
stream_engine.hpp
src/stream_engine.hpp
+1
-1
No files found.
src/stream_engine.cpp
View file @
fdf162a1
...
...
@@ -63,7 +63,6 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_, cons
greeting_bytes_read
(
0
),
session
(
NULL
),
options
(
options_
),
endpoint
(
endpoint_
),
plugged
(
false
),
socket
(
NULL
)
{
...
...
@@ -96,6 +95,8 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_, cons
int
rc
=
setsockopt
(
s
,
SOL_SOCKET
,
SO_NOSIGPIPE
,
&
set
,
sizeof
(
int
));
errno_assert
(
rc
==
0
);
#endif
endpoint
=
new
char
[
endpoint_
.
length
()
+
1
];
strcpy
(
endpoint
,
endpoint_
.
c_str
());
}
zmq
::
stream_engine_t
::~
stream_engine_t
()
...
...
@@ -117,6 +118,7 @@ zmq::stream_engine_t::~stream_engine_t ()
delete
encoder
;
if
(
decoder
!=
NULL
)
delete
decoder
;
delete
[]
endpoint
;
}
void
zmq
::
stream_engine_t
::
plug
(
io_thread_t
*
io_thread_
,
...
...
@@ -484,7 +486,7 @@ int zmq::stream_engine_t::push_msg (msg_t *msg_)
void
zmq
::
stream_engine_t
::
error
()
{
zmq_assert
(
session
);
socket
->
event_disconnected
(
endpoint
.
c_str
()
,
s
);
socket
->
event_disconnected
(
endpoint
,
s
);
session
->
detach
();
unplug
();
delete
this
;
...
...
src/stream_engine.hpp
View file @
fdf162a1
...
...
@@ -132,7 +132,7 @@ namespace zmq
options_t
options
;
// String representation of endpoint
std
::
string
endpoint
;
char
*
endpoint
;
bool
plugged
;
...
...
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