Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
426
Issues
426
List
Boards
Labels
Service Desk
Milestones
Merge Requests
66
Merge Requests
66
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
a877be12
Commit
a877be12
authored
Aug 22, 2019
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#851,
!24
-p] Make sure that string is null terminated after strncpy.
parent
8e9b4b31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
src/lib/dhcpsrv/mysql_host_data_source.cc
src/lib/dhcpsrv/mysql_host_data_source.cc
+1
-0
src/lib/util/io/socketsession.cc
src/lib/util/io/socketsession.cc
+1
-0
No files found.
src/lib/dhcpsrv/mysql_host_data_source.cc
View file @
a877be12
...
...
@@ -119,6 +119,7 @@ public:
memset
(
user_context_
,
0
,
sizeof
(
user_context_
));
memset
(
dhcp4_server_hostname_
,
0
,
sizeof
(
dhcp4_server_hostname_
));
memset
(
dhcp4_boot_file_name_
,
0
,
sizeof
(
dhcp4_boot_file_name_
));
memset
(
auth_key_
,
0
,
sizeof
(
auth_key_
));
// Set the column names for use by this class. This only comprises
// names used by the MySqlHostExchange class. Derived classes will
...
...
src/lib/util/io/socketsession.cc
View file @
a877be12
...
...
@@ -102,6 +102,7 @@ SocketSessionForwarder::SocketSessionForwarder(const std::string& unix_file) :
// the copy should be safe due to the above check, but we'd be rather
// paranoid about making it 100% sure even if the check has a bug (with
// triggering the assertion in the worse case)
memset
(
&
impl
.
sock_un_
.
sun_path
,
0
,
sizeof
(
impl
.
sock_un_
.
sun_path
));
strncpy
(
impl
.
sock_un_
.
sun_path
,
unix_file
.
c_str
(),
sizeof
(
impl
.
sock_un_
.
sun_path
)
-
1
);
assert
(
impl
.
sock_un_
.
sun_path
[
sizeof
(
impl
.
sock_un_
.
sun_path
)
-
1
]
==
'\0'
);
...
...
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