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
fde9d870
Commit
fde9d870
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Fix build_result_ber to construct a new ber and to set ld_errno appropriately.
parent
a40f9281
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap/result.c
+24
-8
24 additions, 8 deletions
libraries/libldap/result.c
with
24 additions
and
8 deletions
libraries/libldap/result.c
+
24
−
8
View file @
fde9d870
...
...
@@ -42,7 +42,7 @@ static int wait4msg LDAP_P(( LDAP *ld, int msgid, int all, struct timeval *timeo
LDAPMessage
**
result
));
static
int
try_read1msg
LDAP_P
((
LDAP
*
ld
,
int
msgid
,
int
all
,
Sockbuf
*
sb
,
LDAPConn
*
lc
,
LDAPMessage
**
result
));
static
unsigned
long
build_result_ber
LDAP_P
((
LDAP
*
ld
,
BerElement
*
ber
,
LDAPRequest
*
lr
));
static
unsigned
long
build_result_ber
LDAP_P
((
LDAP
*
ld
,
BerElement
*
*
bp
,
LDAPRequest
*
lr
));
static
void
merge_error_info
LDAP_P
((
LDAP
*
ld
,
LDAPRequest
*
parentr
,
LDAPRequest
*
lr
));
...
...
@@ -423,9 +423,8 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
if
(
!
simple_request
)
{
ber_free
(
ber
,
1
);
ber
=
NULL
;
if
(
build_result_ber
(
ld
,
ber
,
lr
)
if
(
build_result_ber
(
ld
,
&
ber
,
lr
)
==
LBER_ERROR
)
{
ld
->
ld_errno
=
LDAP_NO_MEMORY
;
rc
=
-
1
;
/* fatal error */
}
}
...
...
@@ -535,30 +534,47 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
static
unsigned
long
build_result_ber
(
LDAP
*
ld
,
BerElement
*
ber
,
LDAPRequest
*
lr
)
build_result_ber
(
LDAP
*
ld
,
BerElement
*
*
bp
,
LDAPRequest
*
lr
)
{
unsigned
long
len
;
unsigned
long
len
,
tag
;
long
along
;
BerElement
*
ber
;
ber
=
*
bp
=
ldap_alloc_ber_with_options
(
ld
);
if
(
ber
==
NULL
)
{
return
LBER_ERROR
;
}
ber_init_w_nullc
(
ber
,
0
);
ldap_set_ber_options
(
ld
,
ber
);
if
(
ber_printf
(
ber
,
"{it{ess}}"
,
lr
->
lr_msgid
,
(
unsigned
long
)
lr
->
lr_res_msgtype
,
lr
->
lr_res_errno
,
lr
->
lr_res_matched
?
lr
->
lr_res_matched
:
""
,
lr
->
lr_res_error
?
lr
->
lr_res_error
:
""
)
==
-
1
)
{
ld
->
ld_errno
=
LDAP_ENCODING_ERROR
;
return
(
LBER_ERROR
);
}
ber_reset
(
ber
,
1
);
if
(
ber_skip_tag
(
ber
,
&
len
)
==
LBER_ERROR
)
{
ld
->
ld_errno
=
LDAP_DECODING_ERROR
;
return
(
LBER_ERROR
);
}
if
(
ber_get_int
(
ber
,
&
along
)
==
LBER_ERROR
)
{
ld
->
ld_errno
=
LDAP_DECODING_ERROR
;
return
(
LBER_ERROR
);
}
tag
=
ber_peek_tag
(
ber
,
&
len
);
if
(
tag
==
LBER_ERROR
)
{
ld
->
ld_errno
=
LDAP_DECODING_ERROR
;
return
(
LBER_ERROR
);
}
return
(
ber_peek_tag
(
ber
,
&
len
))
;
return
tag
;
}
...
...
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