Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
124e90d9
Commit
124e90d9
authored
Mar 24, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Mar 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Handle null DN or null message in ldap_delete* and add tests.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54702
parent
4eff0667
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
delete.c
dlls/wldap32/delete.c
+4
-4
parse.c
dlls/wldap32/tests/parse.c
+28
-0
No files found.
dlls/wldap32/delete.c
View file @
124e90d9
...
...
@@ -72,7 +72,7 @@ ULONG CDECL ldap_delete_extA( LDAP *ld, char *dn, LDAPControlA **serverctrls, LD
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_a
(
dn
),
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnW
=
strAtoW
(
dn
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsW
=
controlarrayAtoW
(
serverctrls
)))
goto
exit
;
...
...
@@ -99,9 +99,9 @@ ULONG CDECL ldap_delete_extW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls, L
TRACE
(
"(%p, %s, %p, %p, %p)
\n
"
,
ld
,
debugstr_w
(
dn
),
serverctrls
,
clientctrls
,
message
);
if
(
!
ld
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
!
ld
||
!
message
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
!
(
dnU
=
dn
?
strWtoU
(
dn
)
:
strdup
(
""
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsU
=
controlarrayWtoU
(
serverctrls
)))
goto
exit
;
if
(
clientctrls
&&
!
(
clientctrlsU
=
controlarrayWtoU
(
clientctrls
)))
goto
exit
;
else
...
...
@@ -155,7 +155,7 @@ ULONG CDECL ldap_delete_ext_sW( LDAP *ld, WCHAR *dn, LDAPControlW **serverctrls,
if
(
!
ld
)
return
WLDAP32_LDAP_PARAM_ERROR
;
if
(
dn
&&
!
(
dnU
=
strWtoU
(
dn
)))
goto
exit
;
if
(
!
(
dnU
=
dn
?
strWtoU
(
dn
)
:
strdup
(
""
)))
goto
exit
;
if
(
serverctrls
&&
!
(
serverctrlsU
=
controlarrayWtoU
(
serverctrls
)))
goto
exit
;
if
(
clientctrls
&&
!
(
clientctrlsU
=
controlarrayWtoU
(
clientctrls
)))
goto
exit
;
else
...
...
dlls/wldap32/tests/parse.c
View file @
124e90d9
...
...
@@ -349,6 +349,33 @@ static void test_ldap_compare( LDAP *ld )
ok
(
ret
==
LDAP_UNDEFINED_TYPE
,
"ldap_compare_ext_sA should fail, got %#lx
\n
"
,
ret
);
}
static
void
test_ldap_delete
(
LDAP
*
ld
)
{
ULONG
ret
,
num
;
ret
=
ldap_deleteA
(
NULL
,
NULL
);
ok
(
ret
==
(
ULONG
)
-
1
,
"ldap_deleteA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_deleteA
(
NULL
,
(
char
*
)
""
);
ok
(
ret
==
(
ULONG
)
-
1
,
"ldap_deleteA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_sA
(
NULL
,
NULL
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_sA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_sA
(
NULL
,
(
char
*
)
""
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_sA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_extA
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_extA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_extA
(
NULL
,
(
char
*
)
""
,
NULL
,
NULL
,
&
num
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_extA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_extA
(
ld
,
(
char
*
)
""
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_extA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_ext_sA
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_ext_sA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_delete_ext_sA
(
NULL
,
(
char
*
)
""
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_PARAM_ERROR
,
"ldap_delete_ext_sA should fail, got %#lx
\n
"
,
ret
);
}
static
void
test_ldap_server_control
(
void
)
{
/* SEQUENCE { INTEGER :: 0x07 } */
...
...
@@ -478,6 +505,7 @@ START_TEST (parse)
test_ldap_add
(
ld
);
test_ldap_modify
(
ld
);
test_ldap_compare
(
ld
);
test_ldap_delete
(
ld
);
test_ldap_parse_sort_control
(
ld
);
test_ldap_search_extW
(
ld
);
test_ldap_get_optionW
(
ld
);
...
...
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