Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
David Barchiesi
OpenLDAP
Commits
c944dc55
Commit
c944dc55
authored
Dec 13, 2020
by
Howard Chu
Browse files
ITS#9423 ldap_X509dn2bv: check for invalid BER after RDN count
parent
d9f20cc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/tls2.c
View file @
c944dc55
...
...
@@ -1505,6 +1505,12 @@ ldap_X509dn2bv( void *x509_name, struct berval *bv, LDAPDN_rewrite_func *func,
}
}
/* Rewind and prepare to extract */
ber_rewind
(
ber
);
tag
=
ber_first_element
(
ber
,
&
len
,
&
dn_end
);
if
(
tag
==
LBER_DEFAULT
)
return
LDAP_DECODING_ERROR
;
/* Allocate the DN/RDN/AVA stuff as a single block */
dnsize
=
sizeof
(
LDAPRDN
)
*
(
nrdns
+
1
);
dnsize
+=
sizeof
(
LDAPAVA
*
)
*
(
navas
+
nrdns
);
...
...
@@ -1516,16 +1522,12 @@ ldap_X509dn2bv( void *x509_name, struct berval *bv, LDAPDN_rewrite_func *func,
}
else
{
newDN
=
(
LDAPDN
)(
char
*
)
ptrs
;
}
newDN
[
nrdns
]
=
NULL
;
newRDN
=
(
LDAPRDN
)(
newDN
+
nrdns
+
1
);
newAVA
=
(
LDAPAVA
*
)(
newRDN
+
navas
+
nrdns
);
baseAVA
=
newAVA
;
/* Rewind and start extracting */
ber_rewind
(
ber
);
tag
=
ber_first_element
(
ber
,
&
len
,
&
dn_end
);
for
(
i
=
nrdns
-
1
;
i
>=
0
;
i
--
)
{
newDN
[
i
]
=
newRDN
;
...
...
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