Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Christopher Ng
OpenLDAP
Commits
961f0ba1
Commit
961f0ba1
authored
18 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Fix strval2strlen end-of-string check. Otherwise passing in a string
without string[len] == '\0' causes assert in ldap_dn2bv_x.
parent
d3dc069a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap/getdn.c
+4
-3
4 additions, 3 deletions
libraries/libldap/getdn.c
with
4 additions
and
3 deletions
libraries/libldap/getdn.c
+
4
−
3
View file @
961f0ba1
...
...
@@ -2016,7 +2016,7 @@ static int
strval2strlen
(
struct
berval
*
val
,
unsigned
flags
,
ber_len_t
*
len
)
{
ber_len_t
l
,
cl
=
1
;
char
*
p
;
char
*
p
,
*
end
;
int
escaped_byte_len
=
LDAP_DN_IS_PRETTY
(
flags
)
?
1
:
3
;
#ifdef PRETTY_ESCAPE
int
escaped_ascii_len
=
LDAP_DN_IS_PRETTY
(
flags
)
?
2
:
3
;
...
...
@@ -2030,7 +2030,8 @@ strval2strlen( struct berval *val, unsigned flags, ber_len_t *len )
return
(
0
);
}
for
(
l
=
0
,
p
=
val
->
bv_val
;
p
<
val
->
bv_val
+
val
->
bv_len
;
p
+=
cl
)
{
end
=
val
->
bv_val
+
val
->
bv_len
-
1
;
for
(
l
=
0
,
p
=
val
->
bv_val
;
p
<=
end
;
p
+=
cl
)
{
/*
* escape '%x00'
...
...
@@ -2059,7 +2060,7 @@ strval2strlen( struct berval *val, unsigned flags, ber_len_t *len )
}
else
if
(
LDAP_DN_NEEDESCAPE
(
p
[
0
]
)
||
LDAP_DN_SHOULDESCAPE
(
p
[
0
]
)
||
(
p
==
val
->
bv_val
&&
LDAP_DN_NEEDESCAPE_LEAD
(
p
[
0
]
)
)
||
(
!
p
[
1
]
&&
LDAP_DN_NEEDESCAPE_TRAIL
(
p
[
0
]
)
)
)
{
||
(
p
==
end
&&
LDAP_DN_NEEDESCAPE_TRAIL
(
p
[
0
]
)
)
)
{
#ifdef PRETTY_ESCAPE
#if 0
if ( LDAP_DN_WILLESCAPE_HEX( flags, p[ 0 ] ) ) {
...
...
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