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
b7c58996
Commit
b7c58996
authored
Oct 06, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure XER decoding happens in the long domain (instead of imax_t)
parent
6bdd8c0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
skeletons/INTEGER.c
skeletons/INTEGER.c
+15
-3
No files found.
skeletons/INTEGER.c
View file @
b7c58996
...
...
@@ -501,10 +501,20 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
/* FALL THROUGH */
case
ST_DIGITS_TRAILSPACE
:
/* The last symbol encountered was a digit. */
switch
(
asn_strto
l
_lim
(
dec_value_start
,
&
dec_value_end
,
&
dec_value
))
{
switch
(
asn_strto
imax
_lim
(
dec_value_start
,
&
dec_value_end
,
&
dec_value
))
{
case
ASN_STRTOX_OK
:
break
;
if
(
dec_value
>=
LONG_MIN
&&
dec_value
<=
LONG_MAX
)
{
break
;
}
else
{
/*
* We model INTEGER on long for XER,
* to avoid rewriting all the tests at once.
*/
ASN_DEBUG
(
"INTEGER exceeds long range"
);
/* Fall through */
}
case
ASN_STRTOX_ERROR_RANGE
:
ASN_DEBUG
(
"INTEGER decode %s hit range limit"
,
td
->
name
);
return
XPBD_DECODER_LIMIT
;
case
ASN_STRTOX_ERROR_INVAL
:
case
ASN_STRTOX_EXPECT_MORE
:
...
...
@@ -533,8 +543,10 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
* Convert the result of parsing of enumeration or a straight
* decimal value into a BER representation.
*/
if
(
asn_long2INTEGER
(
st
,
dec_value
))
if
(
asn_imax2INTEGER
(
st
,
dec_value
))
{
ASN_DEBUG
(
"INTEGER decode %s conversion failed"
,
td
->
name
);
return
XPBD_SYSTEM_FAILURE
;
}
return
XPBD_BODY_CONSUMED
;
}
...
...
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