Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e375bfe1
Commit
e375bfe1
authored
Sep 16, 2012
by
Lorenz Meier
Browse files
Fixed buffer overflow with auth key
parent
8a33280e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/MAVLinkProtocol.cc
View file @
e375bfe1
...
...
@@ -539,8 +539,8 @@ void MAVLinkProtocol::sendHeartbeat()
{
mavlink_message_t
msg
;
mavlink_auth_key_t
auth
;
if
(
m_authKey
.
length
()
!=
MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN
)
m_authKey
.
resize
(
MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN
);
str
cpy
(
auth
.
key
,
m_authKey
.
toStdString
().
c_str
());
memset
(
auth
,
0
,
sizeof
(
auth
)
);
mem
cpy
(
auth
.
key
,
m_authKey
.
toStdString
().
c_str
()
,
qMin
(
m_authKey
.
length
(),
MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN
)
);
mavlink_msg_auth_key_encode
(
getSystemId
(),
getComponentId
(),
&
msg
,
&
auth
);
sendMessage
(
msg
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment