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
ff4cf9d2
Commit
ff4cf9d2
authored
Nov 28, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proper reacting on nested indefinite length containers
parent
60364885
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
asn1c/check-xxber.sh
asn1c/check-xxber.sh
+3
-1
asn1c/unber.c
asn1c/unber.c
+5
-3
No files found.
asn1c/check-xxber.sh
View file @
ff4cf9d2
...
@@ -19,6 +19,8 @@ cat<<EOM > $ORIG
...
@@ -19,6 +19,8 @@ cat<<EOM > $ORIG
<P O="24" T="[UNIVERSAL 2]" TL="2" V="4" A="INTEGER">1¦ G</P>
<P O="24" T="[UNIVERSAL 2]" TL="2" V="4" A="INTEGER">1¦ G</P>
</C O="30" T="[UNIVERSAL 16]" A="SEQUENCE" L="8">
</C O="30" T="[UNIVERSAL 16]" A="SEQUENCE" L="8">
</C O="30" T="[UNIVERSAL 16]" A="SEQUENCE" L="24">
</C O="30" T="[UNIVERSAL 16]" A="SEQUENCE" L="24">
<I O="30" T="[UNIVERSAL 16]" TL="2" V="Indefinite" A="SEQUENCE">
</I O="32" T="[UNIVERSAL 0]" TL="2" L="4">
EOM
EOM
./enber
$ORIG
| ./unber
-p
-i
0 -
>
$TEST
2>&1
./enber
$ORIG
| ./unber
-p
-i
0 -
>
$TEST
2>&1
...
@@ -31,7 +33,7 @@ if [ "$diffExitCode" = "0" ]; then
...
@@ -31,7 +33,7 @@ if [ "$diffExitCode" = "0" ]; then
fi
fi
# Append necessary terminator
# Append necessary terminator
echo
'</I O="3
0" T="[UNIVERSAL 0]" TL="2" L="32
">'
>>
$ORIG
echo
'</I O="3
4" T="[UNIVERSAL 0]" TL="2" L="36
">'
>>
$ORIG
# Try trancoding again
# Try trancoding again
./enber
$ORIG
| ./unber
-p
-i
0 -
>
$TEST
2>&1
./enber
$ORIG
| ./unber
-p
-i
0 -
>
$TEST
2>&1
...
...
asn1c/unber.c
View file @
ff4cf9d2
...
@@ -322,9 +322,10 @@ process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level,
...
@@ -322,9 +322,10 @@ process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level,
effective_size
+=
t_len
+
l_len
;
effective_size
+=
t_len
+
l_len
;
local_esize
+=
t_len
+
l_len
;
local_esize
+=
t_len
+
l_len
;
if
(
expect_eoc
&&
tagbuf
[
0
]
==
'\0'
&&
tagbuf
[
1
]
==
'\0'
)
{
if
(
expect_eoc
&&
!
tagbuf
[
0
]
&&
!
tagbuf
[
1
]
)
{
/* End of content octets */
/* End of content octets */
print_TL
(
1
,
*
offset
-
2
,
level
-
1
,
1
,
2
,
0
,
-
1
,
effective_size
);
print_TL
(
1
,
*
offset
-
2
,
level
-
1
,
1
,
2
,
0
,
-
1
,
effective_size
);
return
PD_FINISHED
;
return
PD_FINISHED
;
}
}
...
@@ -350,7 +351,8 @@ process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level,
...
@@ -350,7 +351,8 @@ process_deeper(const char *fname, FILE *fp, asn1c_integer_t *offset, int level,
local_esize
+=
dec
;
local_esize
+=
dec
;
if
(
tlv_len
==
-
1
)
{
if
(
tlv_len
==
-
1
)
{
tblen
=
0
;
tblen
=
0
;
if
(
pdc
==
PD_FINISHED
&&
limit
<
0
)
if
(
pdc
==
PD_FINISHED
&&
limit
<
0
&&
!
expect_eoc
)
return
pdc
;
return
pdc
;
continue
;
continue
;
}
}
...
...
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