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
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
635
Issues
635
List
Boards
Labels
Service Desk
Milestones
Merge Requests
109
Merge Requests
109
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
ISC Open Source Projects
BIND
Commits
e951a79d
Commit
e951a79d
authored
Jan 22, 2008
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2319. [bug] Silence Coverity warnings in
lib/dns/rdata/in_1/apl_42.c. [RT
#174
]
parent
a59640bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
4 deletions
+58
-4
CHANGES
CHANGES
+3
-0
lib/dns/rdata/in_1/apl_42.c
lib/dns/rdata/in_1/apl_42.c
+55
-4
No files found.
CHANGES
View file @
e951a79d
2319. [bug] Silence Coverity warnings in
lib/dns/rdata/in_1/apl_42.c. [RT #174]
2318. [port] ISC_PLATFORM_NEEDTIMESPEC missing from
lib/bind/config.h.in. [RT #17514]
...
...
lib/dns/rdata/in_1/apl_42.c
View file @
e951a79d
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: apl_42.c,v 1.1
2 2007/06/19 23:47:17 tbox
Exp $ */
/* $Id: apl_42.c,v 1.1
3 2008/01/22 23:17:31 marka
Exp $ */
/* RFC3123 */
...
...
@@ -306,37 +306,88 @@ freestruct_in_apl(ARGS_FREESTRUCT) {
isc_result_t
dns_rdata_apl_first
(
dns_rdata_in_apl_t
*
apl
)
{
isc_uint32_t
length
;
REQUIRE
(
apl
!=
NULL
);
REQUIRE
(
apl
->
common
.
rdtype
==
42
);
REQUIRE
(
apl
->
common
.
rdclass
==
1
);
REQUIRE
(
apl
->
apl
!=
NULL
||
apl
->
apl_len
==
0
);
/*
* If no APL return ISC_R_NOMORE.
*/
if
(
apl
->
apl
==
NULL
)
return
(
ISC_R_NOMORE
);
/*
* Sanity check data.
*/
INSIST
(
apl
->
apl_len
>
3U
);
length
=
apl
->
apl
[
apl
->
offset
+
3
]
&
0x7f
;
INSIST
(
length
<=
apl
->
apl_len
);
apl
->
offset
=
0
;
return
(
(
apl
->
apl_len
!=
0
)
?
ISC_R_SUCCESS
:
ISC_R_NOMORE
);
return
(
ISC_R_SUCCESS
);
}
isc_result_t
dns_rdata_apl_next
(
dns_rdata_in_apl_t
*
apl
)
{
isc_uint32_t
length
;
REQUIRE
(
apl
!=
NULL
);
REQUIRE
(
apl
->
common
.
rdtype
==
42
);
REQUIRE
(
apl
->
common
.
rdclass
==
1
);
REQUIRE
(
apl
->
apl
!=
NULL
||
apl
->
apl_len
==
0
);
if
(
apl
->
offset
+
3
<
apl
->
apl_len
)
/*
* No APL or have already reached the end return ISC_R_NOMORE.
*/
if
(
apl
->
apl
==
NULL
||
apl
->
offset
==
apl
->
apl_len
)
return
(
ISC_R_NOMORE
);
/*
* Sanity check data.
*/
INSIST
(
apl
->
offset
<
apl
->
apl_len
);
INSIST
(
apl
->
apl_len
>
3U
);
INSIST
(
apl
->
offset
<=
apl
->
apl_len
-
4U
);
length
=
apl
->
apl
[
apl
->
offset
+
3
]
&
0x7f
;
/*
* 16 to 32 bits promotion as 'length' is 32 bits so there is
* no overflow problems.
*/
INSIST
(
length
+
apl
->
offset
<=
apl
->
apl_len
);
apl
->
offset
+=
apl
->
apl
[
apl
->
offset
+
3
]
&
0x7f
;
return
((
apl
->
offset
>=
apl
->
apl_len
)
?
ISC_R_SUCCESS
:
ISC_R_NOMORE
);
}
isc_result_t
dns_rdata_apl_current
(
dns_rdata_in_apl_t
*
apl
,
dns_rdata_apl_ent_t
*
ent
)
{
isc_uint32_t
length
;
REQUIRE
(
apl
!=
NULL
);
REQUIRE
(
apl
->
common
.
rdtype
==
42
);
REQUIRE
(
apl
->
common
.
rdclass
==
1
);
REQUIRE
(
ent
!=
NULL
);
REQUIRE
(
apl
->
apl
!=
NULL
||
apl
->
apl_len
==
0
);
REQUIRE
(
apl
->
offset
<=
apl
->
apl_len
);
if
(
apl
->
offset
>
=
apl
->
apl_len
)
if
(
apl
->
offset
=
=
apl
->
apl_len
)
return
(
ISC_R_NOMORE
);
/*
* Sanity check data.
*/
INSIST
(
apl
->
apl_len
>
3U
);
INSIST
(
apl
->
offset
<=
apl
->
apl_len
-
4U
);
length
=
apl
->
apl
[
apl
->
offset
+
3
]
&
0x7f
;
/*
* 16 to 32 bits promotion as 'length' is 32 bits so there is
* no overflow problems.
*/
INSIST
(
length
+
apl
->
offset
<=
apl
->
apl_len
);
ent
->
family
=
(
apl
->
apl
[
apl
->
offset
]
<<
8
)
+
apl
->
apl
[
apl
->
offset
+
1
];
ent
->
prefix
=
apl
->
apl
[
apl
->
offset
+
2
];
ent
->
length
=
apl
->
apl
[
apl
->
offset
+
3
]
&
0x7f
;
...
...
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