lib:mscat: Use size_t for len value to fix build issue
authorAndreas Schneider <asn@samba.org>
Fri, 18 Jan 2019 14:28:54 +0000 (15:28 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 19 Jan 2019 11:24:18 +0000 (12:24 +0100)
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>
lib/mscat/mscat_ctl.c

index 972922c4f75cc69c02dcb13ad3f22469cbbd3122..20147a32c35e1c00ade95e86152655f6f5435312 100644 (file)
@@ -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) {