From 1ade1542d712c95af41b4e9d93f8a115a9b52c7b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 8 Jun 2014 12:38:52 +0200 Subject: [PATCH] Push nil if unable to encode ASN1 string as UTF-8 --- src/x509.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x509.c b/src/x509.c index fd893db..e89b602 100644 --- a/src/x509.c +++ b/src/x509.c @@ -101,6 +101,8 @@ static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode) lua_pushlstring(L, (char*)data, len); OPENSSL_free(data); } + else + lua_pushnil(L); } }