Commit cdd10398 authored by Namjae Jeon's avatar Namjae Jeon
Browse files

cifsd: add goto fail in asn1_oid_decode()



Add goto fail in asn1_oid_decode() to clean-up exception handling code.

Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent be29a370
Loading
Loading
Loading
Loading
+11 −15
Original line number Diff line number Diff line
@@ -74,11 +74,8 @@ static bool asn1_oid_decode(const unsigned char *value, size_t vlen,

	optr = *oid;

	if (!asn1_subid_decode(&iptr, end, &subid)) {
		kfree(*oid);
		*oid = NULL;
		return false;
	}
	if (!asn1_subid_decode(&iptr, end, &subid))
		goto fail;

	if (subid < 40) {
		optr[0] = 0;
@@ -95,20 +92,19 @@ static bool asn1_oid_decode(const unsigned char *value, size_t vlen,
	optr += 2;

	while (iptr < end) {
		if (++(*oidlen) > vlen) {
			kfree(*oid);
			*oid = NULL;
			return false;
		if (++(*oidlen) > vlen)
			goto fail;

		if (!asn1_subid_decode(&iptr, end, optr++))
			goto fail;
	}
	return true;

		if (!asn1_subid_decode(&iptr, end, optr++)) {
fail:
	kfree(*oid);
	*oid = NULL;
	return false;
}
	}
	return true;
}

static bool
oid_eq(unsigned long *oid1, unsigned int oid1len,