mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-06-09 00:42:51 -04:00
sample-plugins: fix ASN1_STRING_to_UTF8 return value checks
As we did in 2d032c7f for the ASN1_STRING_to_UTF8() calls in the core code,
we should also free(buf) if the function returns 0.
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <1501238302-16714-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15161.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
This commit is contained in:
parent
cd5a74d0d7
commit
c43045ca05
2 changed files with 2 additions and 2 deletions
|
|
@ -143,7 +143,7 @@ session_user_set(struct session *sess, X509 *x509)
|
|||
continue;
|
||||
}
|
||||
unsigned char *buf = NULL;
|
||||
if (ASN1_STRING_to_UTF8(&buf, val) <= 0)
|
||||
if (ASN1_STRING_to_UTF8(&buf, val) < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ x509_print_info(X509 *x509crt)
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (ASN1_STRING_to_UTF8(&buf, val) <= 0)
|
||||
if (ASN1_STRING_to_UTF8(&buf, val) < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue