crypto/srp/srp_vfy.c:156: error: INTEGER_OVERFLOW_L2
  ([0, 2147483647] + [0, 2147483647]):signed32.
Showing all 6 steps of the trace


crypto/srp/srp_vfy.c:127:5: <LHS trace>
125.   {
126.       EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();
127.       int outl = 0, outl2 = 0;
           ^
128.       unsigned char pad[2] = {0, 0};
129.       size_t leadz = 0;

crypto/srp/srp_vfy.c:127:5: Assignment
125.   {
126.       EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();
127.       int outl = 0, outl2 = 0;
           ^
128.       unsigned char pad[2] = {0, 0};
129.       size_t leadz = 0;

crypto/srp/srp_vfy.c:151:10: <RHS trace>
149.       }
150.   
151.       if (!EVP_EncodeUpdate(ctx, (unsigned char *)dst + outl, &outl2, src,
                ^
152.                             size)) {
153.           EVP_ENCODE_CTX_free(ctx);

crypto/srp/srp_vfy.c:151:10: Call
149.       }
150.   
151.       if (!EVP_EncodeUpdate(ctx, (unsigned char *)dst + outl, &outl2, src,
                ^
152.                             size)) {
153.           EVP_ENCODE_CTX_free(ctx);

crypto/evp/encode.c:168:5: Assignment
  166.       size_t total = 0;
  167.   
  168.       *outl = 0;
             ^
  169.       if (inl <= 0)
  170.           return 0;

crypto/srp/srp_vfy.c:156:5: Binary operation: ([0, 2147483647] + [0, 2147483647]):signed32
154.           return 0;
155.       }
156.       outl += outl2;
           ^
157.       EVP_EncodeFinal(ctx, (unsigned char *)dst + outl, &outl2);
158.       outl += outl2;

static int t_tob64(char *dst, const unsigned char *src, int size)
{
    EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();
    int outl = 0, outl2 = 0;
    unsigned char pad[2] = {0, 0};
    size_t leadz = 0;
    if (ctx == NULL)
        return 0;
    EVP_EncodeInit(ctx);
    evp_encode_ctx_set_flags(ctx, EVP_ENCODE_CTX_NO_NEWLINES
                                  | EVP_ENCODE_CTX_USE_SRP_ALPHABET);
    leadz = 3 - (size % 3);
    if (leadz != 3
            && !EVP_EncodeUpdate(ctx, (unsigned char *)dst, &outl, pad,
                                 leadz)) {
        EVP_ENCODE_CTX_free(ctx);
        return 0;
    }
    if (!EVP_EncodeUpdate(ctx, (unsigned char *)dst + outl, &outl2, src,
                          size)) {
        EVP_ENCODE_CTX_free(ctx);
        return 0;
    }
    outl += outl2;
    EVP_EncodeFinal(ctx, (unsigned char *)dst + outl, &outl2);
    outl += outl2;
    if (leadz != 3) {
        memmove(dst, dst + leadz, outl - leadz);
        dst[outl - leadz] = '\0';
    }
    EVP_ENCODE_CTX_free(ctx);
    return 1;
}
["static int t_tob64(char *dst, const unsigned char *src, int size)\n{\n    EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();\n    int outl = 0, outl2 = 0;\n    unsigned char pad[2] = {0, 0};\n    size_t leadz = 0;\n    if (ctx == NULL)\n        return 0;\n    EVP_EncodeInit(ctx);\n    evp_encode_ctx_set_flags(ctx, EVP_ENCODE_CTX_NO_NEWLINES\n                                  | EVP_ENCODE_CTX_USE_SRP_ALPHABET);\n    leadz = 3 - (size % 3);\n    if (leadz != 3\n            && !EVP_EncodeUpdate(ctx, (unsigned char *)dst, &outl, pad,\n                                 leadz)) {\n        EVP_ENCODE_CTX_free(ctx);\n        return 0;\n    }\n    if (!EVP_EncodeUpdate(ctx, (unsigned char *)dst + outl, &outl2, src,\n                          size)) {\n        EVP_ENCODE_CTX_free(ctx);\n        return 0;\n    }\n    outl += outl2;\n    EVP_EncodeFinal(ctx, (unsigned char *)dst + outl, &outl2);\n    outl += outl2;\n    if (leadz != 3) {\n        memmove(dst, dst + leadz, outl - leadz);\n        dst[outl - leadz] = '\\0';\n    }\n    EVP_ENCODE_CTX_free(ctx);\n    return 1;\n}", "int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,\n                      const unsigned char *in, int inl)\n{\n    int i, j;\n    size_t total = 0;\n    *outl = 0;\n    if (inl <= 0)\n        return 0;\n    OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));\n    if (ctx->length - ctx->num > inl) {\n        memcpy(&(ctx->enc_data[ctx->num]), in, inl);\n        ctx->num += inl;\n        return 1;\n    }\n    if (ctx->num != 0) {\n        i = ctx->length - ctx->num;\n        memcpy(&(ctx->enc_data[ctx->num]), in, i);\n        in += i;\n        inl -= i;\n        j = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->length);\n        ctx->num = 0;\n        out += j;\n        total = j;\n        if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) {\n            *(out++) = '\\n';\n            total++;\n        }\n        *out = '\\0';\n    }\n    while (inl >= ctx->length && total <= INT_MAX) {\n        j = evp_encodeblock_int(ctx, out, in, ctx->length);\n        in += ctx->length;\n        inl -= ctx->length;\n        out += j;\n        total += j;\n        if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) {\n            *(out++) = '\\n';\n            total++;\n        }\n        *out = '\\0';\n    }\n    if (total > INT_MAX) {\n        *outl = 0;\n        return 0;\n    }\n    if (inl != 0)\n        memcpy(&(ctx->enc_data[0]), in, inl);\n    ctx->num = inl;\n    *outl = total;\n    return 1;\n}"]