Return early if ASN1 string is invalid

This commit is contained in:
Kim Alvefur 2014-06-08 12:41:20 +02:00
parent 1ade1542d7
commit c276e9ff60

View File

@ -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),