Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
23
Issues
23
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
80d87b52
Commit
80d87b52
authored
Sep 08, 2014
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dname: add maximal label length constant
parent
d72eb6bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
src/libknot/consts.h
src/libknot/consts.h
+3
-2
src/libknot/dname.c
src/libknot/dname.c
+2
-2
No files found.
src/libknot/consts.h
View file @
80d87b52
...
...
@@ -34,8 +34,9 @@
/*!
* \brief Basic limits for domain names (RFC 1035).
*/
#define KNOT_DNAME_MAXLEN 255
/*!< 1-byte maximum. */
#define KNOT_DNAME_MAXLABELS 127
/*!< 1-char labels. */
#define KNOT_DNAME_MAXLEN 255
/*!< 1-byte maximum. */
#define KNOT_DNAME_MAXLABELS 127
/*!< 1-char labels. */
#define KNOT_DNAME_MAXLABELLEN 63
/*!< 2^6 - 1 */
/*!
* \brief Address family numbers.
...
...
src/libknot/dname.c
View file @
80d87b52
...
...
@@ -73,8 +73,8 @@ int knot_dname_wire_check(const uint8_t *name, const uint8_t *endp,
is_compressed
=
true
;
}
}
else
{
/* Check label length
(maximum 63 bytes allowed)
. */
if
(
*
name
>
63
)
/* Check label length. */
if
(
*
name
>
KNOT_DNAME_MAXLABELLEN
)
return
KNOT_EMALF
;
/* Check if there's enough space. */
int
lblen
=
*
name
+
1
;
...
...
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