Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
cedf0ab4
Commit
cedf0ab4
authored
Apr 11, 2006
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Improve error handling in create_page_control().
parent
f0a95868
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
page.c
dlls/wldap32/page.c
+15
-4
No files found.
dlls/wldap32/page.c
View file @
cedf0ab4
...
@@ -39,6 +39,10 @@
...
@@ -39,6 +39,10 @@
#include "winldap_private.h"
#include "winldap_private.h"
#include "wldap32.h"
#include "wldap32.h"
#ifndef LDAP_MAXINT
#define LDAP_MAXINT 2147483647
#endif
WINE_DEFAULT_DEBUG_CHANNEL
(
wldap32
);
WINE_DEFAULT_DEBUG_CHANNEL
(
wldap32
);
/***********************************************************************
/***********************************************************************
...
@@ -56,7 +60,8 @@ ULONG ldap_create_page_controlA( WLDAP32_LDAP *ld, ULONG pagesize,
...
@@ -56,7 +60,8 @@ ULONG ldap_create_page_controlA( WLDAP32_LDAP *ld, ULONG pagesize,
TRACE
(
"(%p, 0x%08lx, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
TRACE
(
"(%p, 0x%08lx, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
critical
,
control
);
critical
,
control
);
if
(
!
ld
||
!
control
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
control
||
pagesize
>
LDAP_MAXINT
)
return
WLDAP32_LDAP_PARAM_ERROR
;
ret
=
ldap_create_page_controlW
(
ld
,
pagesize
,
cookie
,
critical
,
&
controlW
);
ret
=
ldap_create_page_controlW
(
ld
,
pagesize
,
cookie
,
critical
,
&
controlW
);
if
(
ret
==
LDAP_SUCCESS
)
if
(
ret
==
LDAP_SUCCESS
)
...
@@ -77,6 +82,7 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
...
@@ -77,6 +82,7 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
{
{
LDAPControlW
*
ctrl
;
LDAPControlW
*
ctrl
;
BerElement
*
ber
;
BerElement
*
ber
;
ber_tag_t
tag
;
struct
berval
*
berval
,
null_cookie
=
{
0
,
NULL
};
struct
berval
*
berval
,
null_cookie
=
{
0
,
NULL
};
INT
ret
,
len
;
INT
ret
,
len
;
char
*
val
;
char
*
val
;
...
@@ -85,13 +91,16 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
...
@@ -85,13 +91,16 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
if
(
!
ber
)
return
WLDAP32_LDAP_NO_MEMORY
;
if
(
!
ber
)
return
WLDAP32_LDAP_NO_MEMORY
;
if
(
cookie
)
if
(
cookie
)
ber_printf
(
ber
,
"{iO}"
,
pagesize
,
cookie
);
tag
=
ber_printf
(
ber
,
"{iO}"
,
(
ber_int_t
)
pagesize
,
cookie
);
else
else
ber_printf
(
ber
,
"{iO}"
,
pagesize
,
&
null_cookie
);
tag
=
ber_printf
(
ber
,
"{iO}"
,
(
ber_int_t
)
pagesize
,
&
null_cookie
);
ret
=
ber_flatten
(
ber
,
&
berval
);
ret
=
ber_flatten
(
ber
,
&
berval
);
ber_free
(
ber
,
1
);
ber_free
(
ber
,
1
);
if
(
tag
==
LBER_ERROR
)
return
WLDAP32_LDAP_ENCODING_ERROR
;
if
(
ret
==
-
1
)
if
(
ret
==
-
1
)
return
WLDAP32_LDAP_NO_MEMORY
;
return
WLDAP32_LDAP_NO_MEMORY
;
...
@@ -146,7 +155,9 @@ ULONG ldap_create_page_controlW( WLDAP32_LDAP *ld, ULONG pagesize,
...
@@ -146,7 +155,9 @@ ULONG ldap_create_page_controlW( WLDAP32_LDAP *ld, ULONG pagesize,
TRACE
(
"(%p, 0x%08lx, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
TRACE
(
"(%p, 0x%08lx, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
critical
,
control
);
critical
,
control
);
if
(
!
ld
||
!
control
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
control
||
pagesize
>
LDAP_MAXINT
)
return
WLDAP32_LDAP_PARAM_ERROR
;
return
create_page_control
(
pagesize
,
cookie
,
critical
,
control
);
return
create_page_control
(
pagesize
,
cookie
,
critical
,
control
);
#endif
#endif
...
...
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