Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Barchiesi
OpenLDAP
Commits
29f9a66b
Commit
29f9a66b
authored
15 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
ITS#6353
parent
98ea063e
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES
+1
-0
1 addition, 0 deletions
CHANGES
include/lber.h
+1
-0
1 addition, 0 deletions
include/lber.h
libraries/liblber/decode.c
+22
-11
22 additions, 11 deletions
libraries/liblber/decode.c
with
24 additions
and
11 deletions
CHANGES
+
1
−
0
View file @
29f9a66b
OpenLDAP 2.4 Change Log
OpenLDAP 2.4.20 Engineering
Fixed liblber embedded NUL values in BerValues (ITS#6353)
Fixed liblber inverted LBER_USE_DER test (ITS#6348)
Fixed liblber to return failure on certain failures (ITS#6344)
Fixed libldap sasl buffer sizing (ITS#6327,ITS#6334)
...
...
This diff is collapsed.
Click to expand it.
include/lber.h
+
1
−
0
View file @
29f9a66b
...
...
@@ -278,6 +278,7 @@ ber_get_stringb LDAP_P((
#define LBER_BV_ALLOC 0x01
/* allocate/copy result, otherwise in-place */
#define LBER_BV_NOTERM 0x02
/* omit NUL-terminator if parsing in-place */
#define LBER_BV_STRING 0x04
/* fail if berval contains embedded \0 */
LBER_F
(
ber_tag_t
)
ber_get_stringbv
LDAP_P
((
...
...
This diff is collapsed.
Click to expand it.
libraries/liblber/decode.c
+
22
−
11
View file @
29f9a66b
...
...
@@ -345,7 +345,7 @@ enum bgbvc { ChArray, BvArray, BvVec, BvOff };
*/
typedef
struct
bgbvr
{
const
enum
bgbvc
choice
;
const
int
alloc
;
/* choice == BvOff ? 0 : LBER_ALLOC
*/
const
int
option
;
/* (ALLOC unless BvOff) | (STRING if ChArray)
*/
ber_len_t
siz
;
/* input array element size, output count */
ber_len_t
off
;
/* BvOff offset to the struct berval */
void
*
result
;
...
...
@@ -418,9 +418,9 @@ ber_get_stringbvl( BerElement *ber, bgbvr *b )
n
=
0
;
do
{
tag
=
ber_get_stringbv
(
ber
,
&
bv
,
b
->
alloc
);
tag
=
ber_get_stringbv
(
ber
,
&
bv
,
b
->
option
);
if
(
tag
==
LBER_DEFAULT
)
{
goto
nomem
;
goto
failed
;
}
/* store my result */
...
...
@@ -436,7 +436,7 @@ ber_get_stringbvl( BerElement *ber, bgbvr *b )
ber
->
ber_memctx
);
if
(
!
bvp
)
{
ber_memfree_x
(
bv
.
bv_val
,
ber
->
ber_memctx
);
goto
nomem
;
goto
failed
;
}
res
.
bv
[
n
]
=
bvp
;
*
bvp
=
bv
;
...
...
@@ -449,8 +449,8 @@ ber_get_stringbvl( BerElement *ber, bgbvr *b )
}
while
(
++
n
<
i
);
return
tag
;
nomem
:
if
(
b
->
choice
!=
BvOff
)
{
/* BvOff does not have
b->alloc
set */
failed
:
if
(
b
->
choice
!=
BvOff
)
{
/* BvOff does not have
LBER_BV_ALLOC
set */
while
(
--
n
>=
0
)
{
switch
(
b
->
choice
)
{
case
ChArray
:
...
...
@@ -480,9 +480,11 @@ ber_get_stringbv( BerElement *ber, struct berval *bv, int option )
char
*
data
;
tag
=
ber_skip_element
(
ber
,
bv
);
if
(
tag
==
LBER_DEFAULT
)
{
if
(
tag
==
LBER_DEFAULT
||
((
option
&
LBER_BV_STRING
)
&&
memchr
(
bv
->
bv_val
,
0
,
bv
->
bv_len
)))
{
bv
->
bv_val
=
NULL
;
return
tag
;
return
LBER_DEFAULT
;
}
data
=
bv
->
bv_val
;
...
...
@@ -516,6 +518,11 @@ ber_get_stringbv_null( BerElement *ber, struct berval *bv, int option )
return
tag
;
}
if
((
option
&
LBER_BV_STRING
)
&&
memchr
(
bv
->
bv_val
,
0
,
bv
->
bv_len
))
{
bv
->
bv_val
=
NULL
;
return
LBER_DEFAULT
;
}
data
=
bv
->
bv_val
;
if
(
option
&
LBER_BV_ALLOC
)
{
bv
->
bv_val
=
(
char
*
)
ber_memalloc_x
(
bv
->
bv_len
+
1
,
...
...
@@ -541,7 +548,7 @@ ber_get_stringa( BerElement *ber, char **buf )
assert
(
buf
!=
NULL
);
tag
=
ber_get_stringbv
(
ber
,
&
bv
,
LBER_BV_ALLOC
);
tag
=
ber_get_stringbv
(
ber
,
&
bv
,
LBER_BV_ALLOC
|
LBER_BV_STRING
);
*
buf
=
bv
.
bv_val
;
return
tag
;
...
...
@@ -555,7 +562,7 @@ ber_get_stringa_null( BerElement *ber, char **buf )
assert
(
buf
!=
NULL
);
tag
=
ber_get_stringbv_null
(
ber
,
&
bv
,
LBER_BV_ALLOC
);
tag
=
ber_get_stringbv_null
(
ber
,
&
bv
,
LBER_BV_ALLOC
|
LBER_BV_STRING
);
*
buf
=
bv
.
bv_val
;
return
tag
;
...
...
@@ -608,6 +615,10 @@ ber_get_bitstringa(
goto
fail
;
}
if
(
memchr
(
data
.
bv_val
,
0
,
data
.
bv_len
))
{
goto
fail
;
}
*
buf
=
(
char
*
)
ber_memalloc_x
(
data
.
bv_len
,
ber
->
ber_memctx
);
if
(
*
buf
==
NULL
)
{
return
LBER_DEFAULT
;
...
...
@@ -811,7 +822,7 @@ ber_scanf ( BerElement *ber,
case
'v'
:
/* sequence of strings */
{
bgbvr
cookie
=
{
ChArray
,
LBER_BV_ALLOC
,
sizeof
(
char
*
)
ChArray
,
LBER_BV_ALLOC
|
LBER_BV_STRING
,
sizeof
(
char
*
)
};
rc
=
ber_get_stringbvl
(
ber
,
&
cookie
);
*
(
va_arg
(
ap
,
char
***
))
=
cookie
.
result
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment