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
89e5f15a
Unverified
Commit
89e5f15a
authored
May 31, 2018
by
Luca Boccassi
Committed by
GitHub
May 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3149 from sigiesec/analyze
Few more code style fixes
parents
6bfa91f1
67b602fe
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
29 deletions
+23
-29
.travis.yml
.travis.yml
+13
-13
ci_build.sh
builds/cmake/ci_build.sh
+1
-0
plain_server.cpp
src/plain_server.cpp
+7
-16
udp_engine.cpp
src/udp_engine.cpp
+2
-0
No files found.
.travis.yml
View file @
89e5f15a
...
@@ -28,6 +28,19 @@ env:
...
@@ -28,6 +28,19 @@ env:
matrix
:
matrix
:
include
:
include
:
-
if
:
type = cron OR (branch =~ analyze$ AND type = push)
env
:
BUILD_TYPE=cmake CLANG_TIDY=/usr/bin/clang-tidy-6.0 CC=clang-6.0 CXX=clang++-6.0
os
:
linux
compiler
:
clang
addons
:
apt
:
sources
:
-
ubuntu-toolchain-r-test
-
llvm-toolchain-trusty-6.0
packages
:
-
clang-6.0
-
clang-tools-6.0
-
clang-tidy-6.0
-
env
:
BUILD_TYPE=default CURVE=tweetnacl IPv6=ON
-
env
:
BUILD_TYPE=default CURVE=tweetnacl IPv6=ON
os
:
linux
os
:
linux
dist
:
precise
dist
:
precise
...
@@ -94,19 +107,6 @@ matrix:
...
@@ -94,19 +107,6 @@ matrix:
-
llvm-toolchain-trusty-5.0
-
llvm-toolchain-trusty-5.0
packages
:
packages
:
-
clang-5.0
-
clang-5.0
-
if
:
type = cron OR (branch =~ analyze$ AND type = push)
env
:
BUILD_TYPE=cmake CLANG_TIDY=/usr/bin/clang-tidy-6.0 CC=clang-6.0 CXX=clang++-6.0
os
:
linux
compiler
:
clang
addons
:
apt
:
sources
:
-
ubuntu-toolchain-r-test
-
llvm-toolchain-trusty-6.0
packages
:
-
clang-6.0
-
clang-tools-6.0
-
clang-tidy-6.0
-
env
:
BUILD_TYPE=default POLLER=poll
-
env
:
BUILD_TYPE=default POLLER=poll
os
:
linux
os
:
linux
-
env
:
BUILD_TYPE=default POLLER=select
-
env
:
BUILD_TYPE=default POLLER=select
...
...
builds/cmake/ci_build.sh
View file @
89e5f15a
...
@@ -51,6 +51,7 @@ CMAKE_PREFIXES=()
...
@@ -51,6 +51,7 @@ CMAKE_PREFIXES=()
MAKE_PREFIXES
=()
MAKE_PREFIXES
=()
PARALLEL_MAKE_OPT
=
"-j5"
PARALLEL_MAKE_OPT
=
"-j5"
if
[
-n
"
$CLANG_TIDY
"
]
;
then
if
[
-n
"
$CLANG_TIDY
"
]
;
then
CMAKE_OPTS+
=(
"-DCMAKE_BUILD_TYPE=Debug"
)
# do a debug build to avoid unused variable warnings with assertions, and to speed up build
CMAKE_OPTS+
=(
"-DCMAKE_CXX_CLANG_TIDY:STRING=
${
CLANG_TIDY
}
"
)
CMAKE_OPTS+
=(
"-DCMAKE_CXX_CLANG_TIDY:STRING=
${
CLANG_TIDY
}
"
)
if
[
-n
${
SONARCLOUD_BUILD_WRAPPER_PATH
}
]
;
then
if
[
-n
${
SONARCLOUD_BUILD_WRAPPER_PATH
}
]
;
then
MAKE_PREFIXES+
=(
"
${
SONARCLOUD_BUILD_WRAPPER_PATH
}
build-wrapper-linux-x86-64"
)
MAKE_PREFIXES+
=(
"
${
SONARCLOUD_BUILD_WRAPPER_PATH
}
build-wrapper-linux-x86-64"
)
...
...
src/plain_server.cpp
View file @
89e5f15a
...
@@ -120,7 +120,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -120,7 +120,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
size_t
bytes_left
=
msg_
->
size
();
size_t
bytes_left
=
msg_
->
size
();
if
(
bytes_left
<
hello_prefix_len
if
(
bytes_left
<
hello_prefix_len
||
memcmp
(
ptr
,
hello_prefix
,
hello_prefix_len
))
{
||
memcmp
(
ptr
,
hello_prefix
,
hello_prefix_len
)
!=
0
)
{
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
);
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
);
errno
=
EPROTO
;
errno
=
EPROTO
;
...
@@ -138,7 +138,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -138,7 +138,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
return
-
1
;
return
-
1
;
}
}
const
uint8_t
username_length
=
*
ptr
++
;
const
uint8_t
username_length
=
*
ptr
++
;
bytes_left
-=
1
;
bytes_left
-=
sizeof
(
username_length
)
;
if
(
bytes_left
<
username_length
)
{
if
(
bytes_left
<
username_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed username
// PLAIN I: invalid PLAIN client, sent malformed username
...
@@ -161,9 +161,10 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -161,9 +161,10 @@ 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
-=
sizeof
(
password_length
);
if
(
bytes_left
<
password_length
)
{
if
(
bytes_left
!=
password_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed password
// PLAIN I: invalid PLAIN client, sent malformed password or
// extraneous data
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
...
@@ -172,16 +173,6 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
...
@@ -172,16 +173,6 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
}
}
const
std
::
string
password
=
std
::
string
(
ptr
,
password_length
);
const
std
::
string
password
=
std
::
string
(
ptr
,
password_length
);
ptr
+=
password_length
;
bytes_left
-=
password_length
;
if
(
bytes_left
>
0
)
{
// PLAIN I: invalid PLAIN client, sent extraneous data
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
errno
=
EPROTO
;
return
-
1
;
}
// Use ZAP protocol (RFC 27) to authenticate the user.
// Use ZAP protocol (RFC 27) to authenticate the user.
rc
=
session
->
zap_connect
();
rc
=
session
->
zap_connect
();
...
@@ -214,7 +205,7 @@ int zmq::plain_server_t::process_initiate (msg_t *msg_)
...
@@ -214,7 +205,7 @@ int zmq::plain_server_t::process_initiate (msg_t *msg_)
const
size_t
bytes_left
=
msg_
->
size
();
const
size_t
bytes_left
=
msg_
->
size
();
if
(
bytes_left
<
initiate_prefix_len
if
(
bytes_left
<
initiate_prefix_len
||
memcmp
(
ptr
,
initiate_prefix
,
initiate_prefix_len
))
{
||
memcmp
(
ptr
,
initiate_prefix
,
initiate_prefix_len
)
!=
0
)
{
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
);
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
);
errno
=
EPROTO
;
errno
=
EPROTO
;
...
...
src/udp_engine.cpp
View file @
89e5f15a
...
@@ -361,6 +361,8 @@ void zmq::udp_engine_t::out_event ()
...
@@ -361,6 +361,8 @@ void zmq::udp_engine_t::out_event ()
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
msg_t
body_msg
;
msg_t
body_msg
;
rc
=
_session
->
pull_msg
(
&
body_msg
);
rc
=
_session
->
pull_msg
(
&
body_msg
);
// TODO rc is not checked here. We seem to assume rc == 0. An
// assertion should be added.
const
size_t
group_size
=
group_msg
.
size
();
const
size_t
group_size
=
group_msg
.
size
();
const
size_t
body_size
=
body_msg
.
size
();
const
size_t
body_size
=
body_msg
.
size
();
...
...
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