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
ffa3d85c
Commit
ffa3d85c
authored
Feb 25, 2013
by
JINMEI Tatuya
Browse files
[2389] revised exception msg in case of unexpected nul character.
also added commments about the intent.
parent
ec7c5400
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/rdata/in_1/a_1.cc
View file @
ffa3d85c
...
...
@@ -42,8 +42,12 @@ using namespace isc::util;
namespace
{
void
convertToIPv4Addr
(
const
char
*
src
,
size_t
src_len
,
uint32_t
*
dst
)
{
// This check specifically rejects invalid input that begins with valid
// address text followed by a nul character (and possibly followed by
// further garbage). It cannot be detected by inet_pton().
if
(
src_len
!=
strlen
(
src
))
{
isc_throw
(
InvalidRdataText
,
"Bad IN/A RDATA text: extra character: '"
isc_throw
(
InvalidRdataText
,
"Bad IN/A RDATA text: unexpected nul in string: '"
<<
src
<<
"'"
);
}
const
int
result
=
inet_pton
(
AF_INET
,
src
,
dst
);
...
...
src/lib/dns/rdata/in_1/aaaa_28.cc
View file @
ffa3d85c
...
...
@@ -40,9 +40,11 @@ using namespace isc::util;
namespace
{
void
convertToIPv6Addr
(
const
char
*
src
,
size_t
src_len
,
void
*
dst
)
{
// See a_1.cc for this check.
if
(
src_len
!=
strlen
(
src
))
{
isc_throw
(
InvalidRdataText
,
"Bad IN/AAAA RDATA text: "
"extra character: '"
<<
src
<<
"'"
);
isc_throw
(
InvalidRdataText
,
"Bad IN/AAAA RDATA text: unexpected nul in string: '"
<<
src
<<
"'"
);
}
const
int
result
=
inet_pton
(
AF_INET6
,
src
,
dst
);
if
(
result
==
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