Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Libraries
asn1c
Commits
1cf4225c
Commit
1cf4225c
authored
Mar 18, 2018
by
mouse07410
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add (some?) missing checks to PER encoding of unsigned integer (addressing
deficiencies of vlm/#260).
parent
8a29c8e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
skeletons/INTEGER.c
skeletons/INTEGER.c
+8
-0
No files found.
skeletons/INTEGER.c
View file @
1cf4225c
...
...
@@ -778,6 +778,14 @@ INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
ASN_DEBUG
(
"Encoding integer %ld (%lu) with range %d bits"
,
value
,
value
-
ct
->
lower_bound
,
ct
->
range_bits
);
if
(
specs
&&
specs
->
field_unsigned
)
{
if
(
((
unsigned
long
)
ct
->
lower_bound
>
(
unsigned
long
)(
ct
->
upper_bound
)
||
((
unsigned
long
)
value
<
(
unsigned
long
)
ct
->
lower_bound
))
||
((
unsigned
long
)
value
>
(
unsigned
long
)
ct
->
upper_bound
)
)
{
ASN_DEBUG
(
"Value %lu to-be-encoded is outside the bounds [%lu, %lu]!"
,
value
,
ct
->
lower_bound
,
ct
->
upper_bound
);
ASN__ENCODE_FAILED
;
}
v
=
(
unsigned
long
)
value
-
(
unsigned
long
)
ct
->
lower_bound
;
}
else
{
if
(
per_long_range_rebase
(
value
,
ct
->
lower_bound
,
ct
->
upper_bound
,
&
v
))
{
...
...
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