Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
3a1e804a
Commit
3a1e804a
authored
Jul 04, 2012
by
Mukund Sivaraman
Browse files
[2053] Fix output of right-stripped label sequences
parent
d83d9fe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/labelsequence.cc
View file @
3a1e804a
...
...
@@ -128,6 +128,11 @@ LabelSequence::toText(bool omit_final_dot) const {
result
.
reserve
(
name_
.
getLength
());
while
(
np
!=
np_end
)
{
if
(
labels
==
0
)
{
count
=
0
;
break
;
}
labels
--
;
count
=
*
np
++
;
...
...
@@ -141,11 +146,6 @@ LabelSequence::toText(bool omit_final_dot) const {
break
;
}
if
(
labels
==
0
)
{
count
=
0
;
break
;
}
if
(
count
<=
Name
::
MAX_LABELLEN
)
{
assert
(
np_end
-
np
>=
count
);
...
...
src/lib/dns/tests/labelsequence_unittest.cc
View file @
3a1e804a
...
...
@@ -303,13 +303,13 @@ TEST_F(LabelSequenceTest, toText) {
EXPECT_EQ
(
"example.com."
,
ls2
.
toText
());
ls2
.
stripRight
(
1
);
EXPECT_EQ
(
"example"
,
ls2
.
toText
());
EXPECT_EQ
(
"example
.com
"
,
ls2
.
toText
());
ls2
.
stripRight
(
1
);
EXPECT_EQ
(
""
,
ls2
.
toText
());
EXPECT_EQ
(
"
example
"
,
ls2
.
toText
());
EXPECT_EQ
(
"foo.example.org.bar."
,
ls8
.
toText
());
ls8
.
stripRight
(
2
);
EXPECT_EQ
(
"foo.example"
,
ls8
.
toText
());
EXPECT_EQ
(
"foo.example
.org
"
,
ls8
.
toText
());
EXPECT_EQ
(
"."
,
ls7
.
toText
());
EXPECT_THROW
(
ls7
.
stripLeft
(
1
),
isc
::
OutOfRange
);
...
...
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