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
c346f903
Commit
c346f903
authored
Oct 09, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
easier fix for sanitization (by @velichkov)
parent
ebeb4015
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
24 deletions
+16
-24
skeletons/INTEGER.c
skeletons/INTEGER.c
+11
-15
skeletons/NativeEnumerated_oer.c
skeletons/NativeEnumerated_oer.c
+5
-9
No files found.
skeletons/INTEGER.c
View file @
c346f903
...
...
@@ -791,18 +791,14 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
#endif
/* ASN_DISABLE_PER_SUPPORT */
/*
* This function is only to get rid of Undefined Behavior Sanitizer warning.
*/
static
intmax_t
CC_ATTR_NO_SANITIZE
(
"shift-base"
)
asn__safe_integer_convert_helper
(
const
uint8_t
*
b
,
const
uint8_t
*
end
)
{
intmax_t
value
;
static
intmax_t
asn__integer_convert
(
const
uint8_t
*
b
,
const
uint8_t
*
end
)
{
uintmax_t
value
;
/* Perform the sign initialization */
/* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
if
((
*
b
>>
7
))
{
value
=
-
1
;
value
=
(
uintmax_t
)(
-
1
)
;
}
else
{
value
=
0
;
}
...
...
@@ -862,7 +858,7 @@ asn_INTEGER2imax(const INTEGER_t *iptr, intmax_t *lptr) {
return
0
;
}
*
lptr
=
asn__
safe_integer_convert_helper
(
b
,
end
);
*
lptr
=
asn__
integer_convert
(
b
,
end
);
return
0
;
}
...
...
skeletons/NativeEnumerated_oer.c
View file @
c346f903
...
...
@@ -9,18 +9,14 @@
#include <NativeEnumerated.h>
#include <errno.h>
/*
* This function is only to get rid of Undefined Behavior Sanitizer warning.
*/
static
intmax_t
CC_ATTR_NO_SANITIZE
(
"shift-base"
)
asn__safe_nativeenumerated_convert_helper
(
const
uint8_t
*
b
,
const
uint8_t
*
end
)
{
intmax_t
value
;
static
intmax_t
asn__nativeenumerated_convert
(
const
uint8_t
*
b
,
const
uint8_t
*
end
)
{
uintmax_t
value
;
/* Perform the sign initialization */
/* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
if
((
*
b
>>
7
))
{
value
=
-
1
;
value
=
(
uintmax_t
)(
-
1
)
;
}
else
{
value
=
0
;
}
...
...
@@ -77,7 +73,7 @@ NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
b
++
;
bend
=
b
+
length
;
value
=
asn__
safe_nativeenumerated_convert_helper
(
b
,
bend
);
value
=
asn__
nativeenumerated_convert
(
b
,
bend
);
if
(
value
<
0
)
{
const
asn_INTEGER_specifics_t
*
specs
=
(
const
asn_INTEGER_specifics_t
*
)
td
->
specifics
;
...
...
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