summaryrefslogtreecommitdiff
path: root/lib/mscat
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-01-18 15:28:54 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-19 12:24:18 +0100
commit56bbfd90c4188e5f1fe560eafaf30334f9afccbf (patch)
tree9835090b32832803f8a86e5bf33d5c7186ff48e5 /lib/mscat
parentf3c30b2f8cd39b9eaf5ff7ba0d3c96669e8ade37 (diff)
downloadsamba-56bbfd90c4188e5f1fe560eafaf30334f9afccbf.tar.gz
lib:mscat: Use size_t for len value to fix build issue
asn1_read_value_type() only uses it as an unsigned it, a negative value isn't assinged. Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'lib/mscat')
-rw-r--r--lib/mscat/mscat_ctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/mscat/mscat_ctl.c b/lib/mscat/mscat_ctl.c
index 972922c4f75..20147a32c35 100644
--- a/lib/mscat/mscat_ctl.c
+++ b/lib/mscat/mscat_ctl.c
@@ -94,13 +94,15 @@ static int mscat_asn1_read_value(TALLOC_CTX *mem_ctx,
{
DATA_BLOB tmp = data_blob_null;
unsigned int etype = ASN1_ETYPE_INVALID;
- int len = 0;
+ int tmp_len = 0;
+ size_t len;
int rc;
- rc = asn1_read_value_type(root, name, NULL, &len, &etype);
+ rc = asn1_read_value_type(root, name, NULL, &tmp_len, &etype);
if (rc != ASN1_SUCCESS) {
return rc;
}
+ len = tmp_len;
if (etype == ASN1_ETYPE_BIT_STRING) {
if (len + 7 < len) {
@@ -125,11 +127,12 @@ static int mscat_asn1_read_value(TALLOC_CTX *mem_ctx,
rc = asn1_read_value(root,
name,
tmp.data,
- &len);
+ &tmp_len);
if (rc != ASN1_SUCCESS) {
data_blob_free(&tmp);
return rc;
}
+ len = tmp_len;
if (etype == ASN1_ETYPE_BIT_STRING) {
if (len + 7 < len) {