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
f7982283
Commit
f7982283
authored
Mar 16, 2013
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: There must be no content in self-terminating <NULL/> tag.
parent
cad560ae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
18 deletions
+23
-18
skeletons/BOOLEAN.c
skeletons/BOOLEAN.c
+1
-4
skeletons/NULL.c
skeletons/NULL.c
+6
-3
skeletons/asn_codecs_prim.c
skeletons/asn_codecs_prim.c
+7
-2
skeletons/xer_decoder.c
skeletons/xer_decoder.c
+6
-5
skeletons/xer_decoder.h
skeletons/xer_decoder.h
+3
-4
No files found.
skeletons/BOOLEAN.c
View file @
f7982283
...
...
@@ -161,10 +161,7 @@ BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun
}
return
XPBD_BODY_CONSUMED
;
}
else
{
if
(
xer_is_whitespace
(
chunk_buf
,
chunk_size
))
return
XPBD_NOT_BODY_IGNORE
;
else
return
XPBD_BROKEN_ENCODING
;
return
XPBD_BROKEN_ENCODING
;
}
}
...
...
skeletons/NULL.c
View file @
f7982283
...
...
@@ -74,10 +74,13 @@ NULL__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_b
(
void
)
td
;
(
void
)
sptr
;
if
(
xer_is_whitespace
(
chunk_buf
,
chunk_size
))
return
XPBD_BODY_CONSUMED
;
else
/*
* There must be no content in self-terminating <NULL/> tag.
*/
if
(
chunk_size
)
return
XPBD_BROKEN_ENCODING
;
else
return
XPBD_BODY_CONSUMED
;
}
asn_dec_rval_t
...
...
skeletons/asn_codecs_prim.c
View file @
f7982283
...
...
@@ -186,9 +186,10 @@ static ssize_t
xer_decode__primitive_body
(
void
*
key
,
const
void
*
chunk_buf
,
size_t
chunk_size
,
int
have_more
)
{
struct
xdp_arg_s
*
arg
=
(
struct
xdp_arg_s
*
)
key
;
enum
xer_pbd_rval
bret
;
size_t
lead_wsp_size
;
if
(
arg
->
decoded_something
)
{
if
(
xer_
is_whitespace
(
chunk_buf
,
chunk_size
)
)
{
if
(
xer_
whitespace_span
(
chunk_buf
,
chunk_size
)
==
chunk_size
)
{
/*
* Example:
* "<INTEGER>123<!--/--> </INTEGER>"
...
...
@@ -215,6 +216,10 @@ xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size,
return
-
1
;
}
lead_wsp_size
=
xer_whitespace_span
(
chunk_buf
,
chunk_size
);
chunk_buf
+=
lead_wsp_size
;
chunk_size
-=
lead_wsp_size
;
bret
=
arg
->
prim_body_decoder
(
arg
->
type_descriptor
,
arg
->
struct_key
,
chunk_buf
,
chunk_size
);
switch
(
bret
)
{
...
...
@@ -227,7 +232,7 @@ xer_decode__primitive_body(void *key, const void *chunk_buf, size_t chunk_size,
arg
->
decoded_something
=
1
;
/* Fall through */
case
XPBD_NOT_BODY_IGNORE
:
/* Safe to proceed further */
return
chunk_size
;
return
lead_wsp_size
+
chunk_size
;
}
return
-
1
;
...
...
skeletons/xer_decoder.c
View file @
f7982283
...
...
@@ -316,8 +316,8 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
}
in
t
xer_
is_whitespace
(
const
void
*
chunk_buf
,
size_t
chunk_size
)
{
size_
t
xer_
whitespace_span
(
const
void
*
chunk_buf
,
size_t
chunk_size
)
{
const
char
*
p
=
(
const
char
*
)
chunk_buf
;
const
char
*
pend
=
p
+
chunk_size
;
...
...
@@ -330,12 +330,13 @@ xer_is_whitespace(const void *chunk_buf, size_t chunk_size) {
* SPACE (32)
*/
case
0x09
:
case
0x0a
:
case
0x0d
:
case
0x20
:
break
;
continue
;
default:
return
0
;
break
;
}
break
;
}
return
1
;
/* All whitespace */
return
(
p
-
(
const
char
*
)
chunk_buf
);
}
/*
...
...
skeletons/xer_decoder.h
View file @
f7982283
...
...
@@ -87,12 +87,11 @@ xer_check_tag_e xer_check_tag(const void *buf_ptr, int size,
const
char
*
need_tag
);
/*
*
Check whether this buffer consists of entirely
XER whitespace characters.
*
Get the number of bytes consisting entirely of
XER whitespace characters.
* RETURN VALUES:
* 1: Whitespace or empty string
* 0: Non-whitespace
* >=0: Number of whitespace characters in the string.
*/
int
xer_is_whitespace
(
const
void
*
chunk_buf
,
size_t
chunk_size
);
size_t
xer_whitespace_span
(
const
void
*
chunk_buf
,
size_t
chunk_size
);
/*
* Skip the series of anticipated extensions.
...
...
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