Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
38ac838e
Commit
38ac838e
authored
Nov 23, 2020
by
Howard Chu
Committed by
Quanah Gibson-Mount
Dec 02, 2020
Browse files
ITS
#9404
fix serialNumberAndIssuerCheck
Tighten validity checks
parent
b58115ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/schema_init.c
View file @
38ac838e
...
...
@@ -3193,7 +3193,7 @@ serialNumberAndIssuerCheck(
if
(
in
->
bv_len
<
3
)
return
LDAP_INVALID_SYNTAX
;
if
(
in
->
bv_val
[
0
]
!=
'{'
&&
in
->
bv_val
[
in
->
bv_len
-
1
]
!=
'}'
)
{
if
(
in
->
bv_val
[
0
]
!=
'{'
||
in
->
bv_val
[
in
->
bv_len
-
1
]
!=
'}'
)
{
/* Parse old format */
is
->
bv_val
=
ber_bvchr
(
in
,
'$'
);
if
(
BER_BVISNULL
(
is
)
)
return
LDAP_INVALID_SYNTAX
;
...
...
@@ -3224,7 +3224,7 @@ serialNumberAndIssuerCheck(
HAVE_ALL
=
(
HAVE_ISSUER
|
HAVE_SN
)
}
have
=
HAVE_NONE
;
int
numdquotes
=
0
;
int
numdquotes
=
0
,
gotquote
;
struct
berval
x
=
*
in
;
struct
berval
ni
;
x
.
bv_val
++
;
...
...
@@ -3266,11 +3266,12 @@ serialNumberAndIssuerCheck(
is
->
bv_val
=
x
.
bv_val
;
is
->
bv_len
=
0
;
for
(
;
is
->
bv_len
<
x
.
bv_len
;
)
{
for
(
gotquote
=
0
;
is
->
bv_len
<
x
.
bv_len
;
)
{
if
(
is
->
bv_val
[
is
->
bv_len
]
!=
'"'
)
{
is
->
bv_len
++
;
continue
;
}
gotquote
=
1
;
if
(
is
->
bv_val
[
is
->
bv_len
+
1
]
==
'"'
)
{
/* double dquote */
numdquotes
++
;
...
...
@@ -3279,6 +3280,8 @@ serialNumberAndIssuerCheck(
}
break
;
}
if
(
!
gotquote
)
return
LDAP_INVALID_SYNTAX
;
x
.
bv_val
+=
is
->
bv_len
+
1
;
x
.
bv_len
-=
is
->
bv_len
+
1
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment