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
Knot DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
722338e9
Commit
722338e9
authored
May 06, 2016
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
knot: fix crash if sockaddr_hostname returns NULL (OpenWRT)
parent
6c981d00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/knot/conf/base.c
src/knot/conf/base.c
+5
-1
src/knot/modules/dnstap.c
src/knot/modules/dnstap.c
+1
-1
No files found.
src/knot/conf/base.c
View file @
722338e9
...
...
@@ -101,6 +101,10 @@ void conf_refresh_hostname(
free
(
conf
->
hostname
);
conf
->
hostname
=
sockaddr_hostname
();
if
(
conf
->
hostname
==
NULL
)
{
// Empty hostname fallback, NULL cannot be passed to strlen!
conf
->
hostname
=
strdup
(
""
);
}
}
static
void
init_cache
(
...
...
@@ -206,7 +210,7 @@ int conf_new(
// Cache the current hostname.
if
(
!
(
flags
&
CONF_FNOHOSTNAME
))
{
out
->
hostname
=
sockaddr_hostname
(
);
conf_refresh_hostname
(
out
);
}
// Initialize cached values.
...
...
src/knot/modules/dnstap.c
View file @
722338e9
...
...
@@ -241,7 +241,7 @@ int dnstap_load(struct query_plan *plan, struct query_module *self,
}
else
{
ctx
->
identity
=
sockaddr_hostname
();
}
ctx
->
identity_len
=
strlen
(
ctx
->
identity
)
;
ctx
->
identity_len
=
(
ctx
->
identity
!=
NULL
)
?
strlen
(
ctx
->
identity
)
:
0
;
// Set version.
val
=
conf_mod_get
(
self
->
config
,
MOD_VERSION
,
self
->
id
);
...
...
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