crypto/srp/srp_vfy.c:162: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [1, 5]):unsigned64.
Showing all 9 steps of the trace


crypto/srp/srp_vfy.c:157:5: <LHS trace>
155.       }
156.       outl += outl2;
157.       EVP_EncodeFinal(ctx, (unsigned char *)dst + outl, &outl2);
           ^
158.       outl += outl2;
159.   

crypto/srp/srp_vfy.c:157:5: Call
155.       }
156.       outl += outl2;
157.       EVP_EncodeFinal(ctx, (unsigned char *)dst + outl, &outl2);
           ^
158.       outl += outl2;
159.   

crypto/evp/encode.c:219:5: Assignment
  217.   void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
  218.   {
  219.       unsigned int ret = 0;
             ^
  220.   
  221.       if (ctx->num != 0) {

crypto/evp/encode.c:228:5: Assignment
  226.           ctx->num = 0;
  227.       }
  228.       *outl = ret;
             ^
  229.   }
  230.   

crypto/srp/srp_vfy.c:158:5: Assignment
156.       outl += outl2;
157.       EVP_EncodeFinal(ctx, (unsigned char *)dst + outl, &outl2);
158.       outl += outl2;
           ^
159.   
160.       /* Strip the encoded padding at the front */

crypto/srp/srp_vfy.c:124:1: <RHS trace>
122.    * Returns 1 on success or 0 on error.
123.    */
124. > static int t_tob64(char *dst, const unsigned char *src, int size)
125.   {
126.       EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();

crypto/srp/srp_vfy.c:124:1: Parameter `size`
122.    * Returns 1 on success or 0 on error.
123.    */
124. > static int t_tob64(char *dst, const unsigned char *src, int size)
125.   {
126.       EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();

crypto/srp/srp_vfy.c:143:5: Assignment
141.        * padding
142.        */
143.       leadz = 3 - (size % 3);
           ^
144.       if (leadz != 3
145.               && !EVP_EncodeUpdate(ctx, (unsigned char *)dst, &outl, pad,

crypto/srp/srp_vfy.c:162:9: Binary operation: ([0, +oo] - [1, 5]):unsigned64
160.       /* Strip the encoded padding at the front */
161.       if (leadz != 3) {
162.           memmove(dst, dst + leadz, outl - leadz);
               ^
163.           dst[outl - leadz] = '\0';
164.       }

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}", "void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)\n{\n    unsigned int ret = 0;\n    if (ctx->num != 0) {\n        ret = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->num);\n        if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)\n            out[ret++] = '\\n';\n        out[ret] = '\\0';\n        ctx->num = 0;\n    }\n    *outl = ret;\n}"]