crypto/dsa/dsa_lib.c:177: error: INTEGER_OVERFLOW_L2
  ([2, 2147483646] + [0, 2147483644]):signed32 by call to `ASN1_object_size`.
Showing all 14 steps of the trace


crypto/dsa/dsa_lib.c:175:9: Call
173.       buf[0] = 0xff;
174.   
175.       i = i2d_ASN1_INTEGER(&bs, NULL);
               ^
176.       i += i;                     /* r and s */
177.       ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);

crypto/asn1/tasn_typ.c:29:1: Call
  27.   
  28.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  29. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  30.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
  31.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)

crypto/asn1/tasn_enc.c:44:12: Call
    42.   int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
    43.   {
    44.       return asn1_item_flags_i2d(val, out, it, 0);
                     ^
    45.   }
    46.   

crypto/asn1/tasn_enc.c:65:13: Assignment
      63.           buf = OPENSSL_malloc(len);
      64.           if (buf == NULL)
      65.               return -1;
                        ^
      66.           p = buf;
      67.           ASN1_item_ex_i2d(&val, &p, it, -1, flags);

crypto/asn1/tasn_enc.c:44:5: Assignment
    42.   int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
    43.   {
    44.       return asn1_item_flags_i2d(val, out, it, 0);
              ^
    45.   }
    46.   

crypto/asn1/tasn_typ.c:29:1: Assignment
  27.   
  28.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  29. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  30.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
  31.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)

crypto/dsa/dsa_lib.c:175:5: Assignment
173.       buf[0] = 0xff;
174.   
175.       i = i2d_ASN1_INTEGER(&bs, NULL);
           ^
176.       i += i;                     /* r and s */
177.       ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);

crypto/dsa/dsa_lib.c:176:5: Assignment
174.   
175.       i = i2d_ASN1_INTEGER(&bs, NULL);
176.       i += i;                     /* r and s */
           ^
177.       ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);
178.       return (ret);

crypto/dsa/dsa_lib.c:177:11: Call
175.       i = i2d_ASN1_INTEGER(&bs, NULL);
176.       i += i;                     /* r and s */
177.       ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);
                 ^
178.       return (ret);
179.   }

crypto/asn1/asn1_lib.c:207:1: <LHS trace>
205.   }
206.   
207. > int ASN1_object_size(int constructed, int length, int tag)
208.   {
209.       int ret = 1;

crypto/asn1/asn1_lib.c:207:1: Parameter `length`
  205.   }
  206.   
  207. > int ASN1_object_size(int constructed, int length, int tag)
  208.   {
  209.       int ret = 1;

crypto/asn1/asn1_lib.c:207:1: <RHS trace>
205.   }
206.   
207. > int ASN1_object_size(int constructed, int length, int tag)
208.   {
209.       int ret = 1;

crypto/asn1/asn1_lib.c:207:1: Parameter `length`
  205.   }
  206.   
  207. > int ASN1_object_size(int constructed, int length, int tag)
  208.   {
  209.       int ret = 1;

crypto/asn1/asn1_lib.c:232:5: Binary operation: ([2, 2147483646] + [0, 2147483644]):signed32 by call to `ASN1_object_size` 
  230.       if (ret >= INT_MAX - length)
  231.           return -1;
  232.       return ret + length;
             ^
  233.   }
  234.   

int ASN1_object_size(int constructed, int length, int tag)
{
    int ret = 1;
    if (length < 0)
        return -1;
    if (tag >= 31) {
        while (tag > 0) {
            tag >>= 7;
            ret++;
        }
    }
    if (constructed == 2) {
        ret += 3;
    } else {
        ret++;
        if (length > 127) {
            int tmplen = length;
            while (tmplen > 0) {
                tmplen >>= 8;
                ret++;
            }
        }
    }
    if (ret >= INT_MAX - length)
        return -1;
    return ret + length;
}
['int DSA_size(const DSA *r)\n{\n    int ret, i;\n    ASN1_INTEGER bs;\n    unsigned char buf[4];\n    i = BN_num_bits(r->q);\n    bs.length = (i + 7) / 8;\n    bs.data = buf;\n    bs.type = V_ASN1_INTEGER;\n    buf[0] = 0xff;\n    i = i2d_ASN1_INTEGER(&bs, NULL);\n    i += i;\n    ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);\n    return (ret);\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)', 'int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)\n{\n    return asn1_item_flags_i2d(val, out, it, 0);\n}', 'static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out,\n                               const ASN1_ITEM *it, int flags)\n{\n    if (out && !*out) {\n        unsigned char *p, *buf;\n        int len;\n        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);\n        if (len <= 0)\n            return len;\n        buf = OPENSSL_malloc(len);\n        if (buf == NULL)\n            return -1;\n        p = buf;\n        ASN1_item_ex_i2d(&val, &p, it, -1, flags);\n        *out = buf;\n        return len;\n    }\n    return ASN1_item_ex_i2d(&val, out, it, -1, flags);\n}', 'int ASN1_object_size(int constructed, int length, int tag)\n{\n    int ret = 1;\n    if (length < 0)\n        return -1;\n    if (tag >= 31) {\n        while (tag > 0) {\n            tag >>= 7;\n            ret++;\n        }\n    }\n    if (constructed == 2) {\n        ret += 3;\n    } else {\n        ret++;\n        if (length > 127) {\n            int tmplen = length;\n            while (tmplen > 0) {\n                tmplen >>= 8;\n                ret++;\n            }\n        }\n    }\n    if (ret >= INT_MAX - length)\n        return -1;\n    return ret + length;\n}']