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
fb442678
Commit
fb442678
authored
Apr 20, 2021
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Fix parsing page controls.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7394483c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
page.c
dlls/wldap32/page.c
+14
-14
No files found.
dlls/wldap32/page.c
View file @
fb442678
...
...
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
...
...
@@ -31,8 +32,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wldap32
);
#define LDAP_MAXINT (2^31)
static
struct
berval
null_cookieW
=
{
0
,
NULL
};
/***********************************************************************
...
...
@@ -48,7 +47,7 @@ ULONG CDECL ldap_create_page_controlA( LDAP *ld, ULONG pagesize, struct berval *
TRACE
(
"(%p, 0x%08x, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
critical
,
control
);
if
(
!
ld
||
!
control
||
pagesize
>
LDAP_MAXINT
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
control
||
pagesize
>
INT_MAX
)
return
LDAP_PARAM_ERROR
;
ret
=
ldap_create_page_controlW
(
ld
,
pagesize
,
cookie
,
critical
,
&
controlW
);
if
(
ret
==
LDAP_SUCCESS
)
...
...
@@ -131,7 +130,7 @@ ULONG CDECL ldap_create_page_controlW( LDAP *ld, ULONG pagesize, struct berval *
{
TRACE
(
"(%p, 0x%08x, %p, 0x%02x, %p)
\n
"
,
ld
,
pagesize
,
cookie
,
critical
,
control
);
if
(
!
ld
||
!
control
||
pagesize
>
LDAP_MAXINT
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
control
||
pagesize
>
INT_MAX
)
return
LDAP_PARAM_ERROR
;
return
create_page_control
(
pagesize
,
cookie
,
critical
,
control
);
}
...
...
@@ -230,18 +229,18 @@ ULONG CDECL ldap_parse_page_controlA( LDAP *ld, LDAPControlA **ctrls, ULONG *cou
/***********************************************************************
* ldap_parse_page_controlW (WLDAP32.@)
*/
ULONG
CDECL
ldap_parse_page_controlW
(
LDAP
*
ld
,
LDAPControlW
**
ctrls
,
ULONG
*
count
,
struct
berval
**
cookie
)
ULONG
CDECL
ldap_parse_page_controlW
(
LDAP
*
ld
,
LDAPControlW
**
ctrls
,
ULONG
*
ret_count
,
struct
berval
**
ret_
cookie
)
{
ULONG
ret
;
ULONG
ret
,
count
;
LDAPControlW
*
control
=
NULL
;
BerElement
*
ber
;
struct
berval
*
vec
[
2
]
;
struct
berval
*
cookie
=
NULL
;
int
tag
;
ULONG
i
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
ctrls
,
count
,
cookie
);
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
ld
,
ctrls
,
ret_count
,
ret_
cookie
);
if
(
!
ld
||
!
ctrls
||
!
count
||
!
cookie
)
return
LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
ctrls
||
!
ret_count
||
!
ret_
cookie
)
return
LDAP_PARAM_ERROR
;
for
(
i
=
0
;
ctrls
[
i
];
i
++
)
{
...
...
@@ -252,13 +251,14 @@ ULONG CDECL ldap_parse_page_controlW( LDAP *ld, LDAPControlW **ctrls, ULONG *cou
if
(
!
(
ber
=
ber_init
(
&
control
->
ldctl_value
)))
return
LDAP_NO_MEMORY
;
vec
[
0
]
=
*
cookie
;
vec
[
1
]
=
0
;
tag
=
ber_scanf
(
ber
,
(
char
*
)
"{iV}"
,
count
,
vec
);
if
(
tag
==
LBER_ERROR
)
ret
=
LDAP_DECODING_ERROR
;
tag
=
ber_scanf
(
ber
,
(
char
*
)
"{iO}"
,
&
count
,
&
cookie
);
if
(
tag
==
LBER_ERROR
)
ret
=
LDAP_DECODING_ERROR
;
else
{
*
ret_count
=
count
;
*
ret_cookie
=
cookie
;
ret
=
LDAP_SUCCESS
;
}
ber_free
(
ber
,
1
);
return
ret
;
...
...
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