apps/s_client.c:3068: error: INTEGER_OVERFLOW_L2
  ([0, -1+max(9223372036854775807, `rem`)] + 1):signed32.
Showing all 3 steps of the trace


apps/s_client.c:3068:19: <LHS trace>
3066.   
3067.       /* len should always be one, but just in case... */
3068.       for (ret = 0, inf = 0; inf < len; inf++) {
                          ^
3069.           ret <<= 8;
3070.           ret |= cur[inf];

apps/s_client.c:3068:19: Assignment
3066.   
3067.       /* len should always be one, but just in case... */
3068.       for (ret = 0, inf = 0; inf < len; inf++) {
                          ^
3069.           ret <<= 8;
3070.           ret |= cur[inf];

apps/s_client.c:3068:39: Binary operation: ([0, -1+max(9223372036854775807, rem)] + 1):signed32
3066.   
3067.       /* len should always be one, but just in case... */
3068.       for (ret = 0, inf = 0; inf < len; inf++) {
                                              ^
3069.           ret <<= 8;
3070.           ret |= cur[inf];

static int ldap_ExtendedResponse_parse(const char *buf, long rem)
{
    const unsigned char *cur, *end;
    long len;
    int tag, xclass, inf, ret = -1;
    cur = (const unsigned char *)buf;
    end = cur + rem;
    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
    if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE ||
        (rem = end - cur, len > rem)) {
        BIO_printf(bio_err, "Unexpected LDAP response\n");
        goto end;
    }
    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_INTEGER ||
        (rem = end - cur, len > rem)) {
        BIO_printf(bio_err, "No MessageID\n");
        goto end;
    }
    cur += len;
    rem = end - cur;
    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
    if (inf != V_ASN1_CONSTRUCTED || xclass != V_ASN1_APPLICATION ||
        tag != 24) {
        BIO_printf(bio_err, "Not ExtendedResponse\n");
        goto end;
    }
    rem = end - cur;
    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_ENUMERATED || len == 0 ||
        (rem = end - cur, len > rem)) {
        BIO_printf(bio_err, "Not LDAPResult\n");
        goto end;
    }
    for (ret = 0, inf = 0; inf < len; inf++) {
        ret <<= 8;
        ret |= cur[inf];
    }
 end:
    return ret;
}
['static int ldap_ExtendedResponse_parse(const char *buf, long rem)\n{\n    const unsigned char *cur, *end;\n    long len;\n    int tag, xclass, inf, ret = -1;\n    cur = (const unsigned char *)buf;\n    end = cur + rem;\n    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);\n    if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE ||\n        (rem = end - cur, len > rem)) {\n        BIO_printf(bio_err, "Unexpected LDAP response\\n");\n        goto end;\n    }\n    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);\n    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_INTEGER ||\n        (rem = end - cur, len > rem)) {\n        BIO_printf(bio_err, "No MessageID\\n");\n        goto end;\n    }\n    cur += len;\n    rem = end - cur;\n    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);\n    if (inf != V_ASN1_CONSTRUCTED || xclass != V_ASN1_APPLICATION ||\n        tag != 24) {\n        BIO_printf(bio_err, "Not ExtendedResponse\\n");\n        goto end;\n    }\n    rem = end - cur;\n    inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);\n    if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_ENUMERATED || len == 0 ||\n        (rem = end - cur, len > rem)) {\n        BIO_printf(bio_err, "Not LDAPResult\\n");\n        goto end;\n    }\n    for (ret = 0, inf = 0; inf < len; inf++) {\n        ret <<= 8;\n        ret |= cur[inf];\n    }\n end:\n    return ret;\n}']