From ab42d4ec864b096a85da5ee28fd6341b81d387b1 Mon Sep 17 00:00:00 2001 From: Bruno Silvestre Date: Wed, 28 Jan 2015 16:19:19 -0200 Subject: [PATCH] Stop if we don't have a string. --- src/x509.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/x509.c b/src/x509.c index fd893db..4c8ef65 100644 --- a/src/x509.c +++ b/src/x509.c @@ -88,8 +88,10 @@ static void push_asn1_string(lua_State* L, ASN1_STRING *string, int encode) { int len; unsigned char *data; - if (!string) + if (!string) { lua_pushnil(L); + return; + } switch (encode) { case LSEC_AI5_STRING: lua_pushlstring(L, (char*)ASN1_STRING_data(string),