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
91e0d689
Commit
91e0d689
authored
Aug 28, 2017
by
bjovke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: Inconsistent size_t/int usage. Solution: types corrected.
parent
9c8844fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
mechanism_base.cpp
src/mechanism_base.cpp
+1
-1
mechanism_base.hpp
src/mechanism_base.hpp
+1
-1
plain_server.cpp
src/plain_server.cpp
+3
-3
No files found.
src/mechanism_base.cpp
View file @
91e0d689
...
@@ -53,7 +53,7 @@ int zmq::mechanism_base_t::check_basic_command_structure (msg_t *msg_)
...
@@ -53,7 +53,7 @@ int zmq::mechanism_base_t::check_basic_command_structure (msg_t *msg_)
}
}
void
zmq
::
mechanism_base_t
::
handle_error_reason
(
const
char
*
error_reason
,
void
zmq
::
mechanism_base_t
::
handle_error_reason
(
const
char
*
error_reason
,
in
t
error_reason_len
)
size_
t
error_reason_len
)
{
{
if
(
error_reason_len
==
3
&&
error_reason
[
1
]
==
'0'
if
(
error_reason_len
==
3
&&
error_reason
[
1
]
==
'0'
&&
error_reason
[
2
]
==
'0'
&&
error_reason
[
0
]
>=
'3'
&&
error_reason
[
2
]
==
'0'
&&
error_reason
[
0
]
>=
'3'
...
...
src/mechanism_base.hpp
View file @
91e0d689
...
@@ -44,7 +44,7 @@ class mechanism_base_t : public mechanism_t
...
@@ -44,7 +44,7 @@ class mechanism_base_t : public mechanism_t
int
check_basic_command_structure
(
msg_t
*
msg_
);
int
check_basic_command_structure
(
msg_t
*
msg_
);
void
handle_error_reason
(
const
char
*
error_reason
,
in
t
error_reason_len
);
void
handle_error_reason
(
const
char
*
error_reason
,
size_
t
error_reason_len
);
};
};
}
}
...
...
src/plain_server.cpp
View file @
91e0d689
...
@@ -112,7 +112,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -112,7 +112,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
return
-
1
;
return
-
1
;
const
unsigned
char
*
ptr
=
static_cast
<
unsigned
char
*>
(
msg_
->
data
());
const
unsigned
char
*
ptr
=
static_cast
<
unsigned
char
*>
(
msg_
->
data
());
in
t
bytes_left
=
msg_
->
size
();
size_
t
bytes_left
=
msg_
->
size
();
if
(
bytes_left
<
6
||
memcmp
(
ptr
,
"
\x05
HELLO"
,
6
))
{
if
(
bytes_left
<
6
||
memcmp
(
ptr
,
"
\x05
HELLO"
,
6
))
{
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_socket
()
->
event_handshake_failed_protocol
(
...
@@ -133,7 +133,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -133,7 +133,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
const
uint8_t
username_length
=
*
ptr
++
;
const
uint8_t
username_length
=
*
ptr
++
;
bytes_left
-=
1
;
bytes_left
-=
1
;
if
(
bytes_left
<
(
int
)
username_length
)
{
if
(
bytes_left
<
username_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed username
// PLAIN I: invalid PLAIN client, sent malformed username
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
...
@@ -153,7 +153,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -153,7 +153,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
const
uint8_t
password_length
=
*
ptr
++
;
const
uint8_t
password_length
=
*
ptr
++
;
bytes_left
-=
1
;
bytes_left
-=
1
;
if
(
bytes_left
<
(
int
)
password_length
)
{
if
(
bytes_left
<
password_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed password
// PLAIN I: invalid PLAIN client, sent malformed password
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
...
...
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