提交 cdd10398 编写于 作者: N Namjae Jeon

cifsd: add goto fail in asn1_oid_decode()

Add goto fail in asn1_oid_decode() to clean-up exception handling code.
Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 be29a370
...@@ -74,11 +74,8 @@ static bool asn1_oid_decode(const unsigned char *value, size_t vlen, ...@@ -74,11 +74,8 @@ static bool asn1_oid_decode(const unsigned char *value, size_t vlen,
optr = *oid; optr = *oid;
if (!asn1_subid_decode(&iptr, end, &subid)) { if (!asn1_subid_decode(&iptr, end, &subid))
kfree(*oid); goto fail;
*oid = NULL;
return false;
}
if (subid < 40) { if (subid < 40) {
optr[0] = 0; optr[0] = 0;
...@@ -95,19 +92,18 @@ static bool asn1_oid_decode(const unsigned char *value, size_t vlen, ...@@ -95,19 +92,18 @@ static bool asn1_oid_decode(const unsigned char *value, size_t vlen,
optr += 2; optr += 2;
while (iptr < end) { while (iptr < end) {
if (++(*oidlen) > vlen) { if (++(*oidlen) > vlen)
kfree(*oid); goto fail;
*oid = NULL;
return false;
}
if (!asn1_subid_decode(&iptr, end, optr++)) { if (!asn1_subid_decode(&iptr, end, optr++))
kfree(*oid); goto fail;
*oid = NULL;
return false;
}
} }
return true; return true;
fail:
kfree(*oid);
*oid = NULL;
return false;
} }
static bool static bool
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册