Commit 54298141 authored by Jonas Maebe's avatar Jonas Maebe Committed by Kurt Roeckx
Browse files

do_othername: check for NULL after allocating objtmp



Signed-off-by: default avatarKurt Roeckx <kurt@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent f6983d0d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -579,6 +579,8 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx)
		return 0;
	objlen = p - value;
	objtmp = OPENSSL_malloc(objlen + 1);
	if (objtmp == NULL)
		return 0;
	strncpy(objtmp, value, objlen);
	objtmp[objlen] = 0;
	gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0);