crypto/o_str.c:214: error: BUFFER_OVERRUN_L3
  Offset: [2, +oo] Size: [1, +oo].
Showing all 9 steps of the trace


crypto/o_str.c:194:1: <Length trace>
192.    * on EBCDIC machines)
193.    */
194. > char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
195.   {
196.       const static char hexdig[] = "0123456789ABCDEF";

crypto/o_str.c:194:1: Parameter `len`
192.    * on EBCDIC machines)
193.    */
194. > char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
195.   {
196.       const static char hexdig[] = "0123456789ABCDEF";

crypto/o_str.c:206:16: Call
204.       }
205.   
206.       if ((tmp = OPENSSL_malloc(len * 3)) == NULL) {
                      ^
207.           CRYPTOerr(CRYPTO_F_OPENSSL_BUF2HEXSTR, ERR_R_MALLOC_FAILURE);
208.           return NULL;

crypto/mem.c:79:9: Assignment
  77.   
  78.       if (num <= 0)
  79.           return NULL;
                ^
  80.   
  81.       allow_customize = 0;

crypto/o_str.c:206:10: Assignment
204.       }
205.   
206.       if ((tmp = OPENSSL_malloc(len * 3)) == NULL) {
                ^
207.           CRYPTOerr(CRYPTO_F_OPENSSL_BUF2HEXSTR, ERR_R_MALLOC_FAILURE);
208.           return NULL;

crypto/o_str.c:210:5: Assignment
208.           return NULL;
209.       }
210.       q = tmp;
           ^
211.       for (i = 0, p = buffer; i < len; i++, p++) {
212.           *q++ = hexdig[(*p >> 4) & 0xf];

crypto/o_str.c:212:10: Assignment
210.       q = tmp;
211.       for (i = 0, p = buffer; i < len; i++, p++) {
212.           *q++ = hexdig[(*p >> 4) & 0xf];
                ^
213.           *q++ = hexdig[*p & 0xf];
214.           *q++ = ':';

crypto/o_str.c:213:10: Assignment
211.       for (i = 0, p = buffer; i < len; i++, p++) {
212.           *q++ = hexdig[(*p >> 4) & 0xf];
213.           *q++ = hexdig[*p & 0xf];
                ^
214.           *q++ = ':';
215.       }

crypto/o_str.c:214:9: Array access: Offset: [2, +oo] Size: [1, +oo]
212.           *q++ = hexdig[(*p >> 4) & 0xf];
213.           *q++ = hexdig[*p & 0xf];
214.           *q++ = ':';
               ^
215.       }
216.       q[-1] = 0;

char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
{
    const static char hexdig[] = "0123456789ABCDEF";
    char *tmp, *q;
    const unsigned char *p;
    int i;
    if (len == 0)
    {
        return OPENSSL_zalloc(1);
    }
    if ((tmp = OPENSSL_malloc(len * 3)) == NULL) {
        CRYPTOerr(CRYPTO_F_OPENSSL_BUF2HEXSTR, ERR_R_MALLOC_FAILURE);
        return NULL;
    }
    q = tmp;
    for (i = 0, p = buffer; i < len; i++, p++) {
        *q++ = hexdig[(*p >> 4) & 0xf];
        *q++ = hexdig[*p & 0xf];
        *q++ = ':';
    }
    q[-1] = 0;
#ifdef CHARSET_EBCDIC
    ebcdic2ascii(tmp, tmp, q - tmp - 1);
#endif
    return tmp;
}
['char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)\n{\n    const static char hexdig[] = "0123456789ABCDEF";\n    char *tmp, *q;\n    const unsigned char *p;\n    int i;\n    if (len == 0)\n    {\n        return OPENSSL_zalloc(1);\n    }\n    if ((tmp = OPENSSL_malloc(len * 3)) == NULL) {\n        CRYPTOerr(CRYPTO_F_OPENSSL_BUF2HEXSTR, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    q = tmp;\n    for (i = 0, p = buffer; i < len; i++, p++) {\n        *q++ = hexdig[(*p >> 4) & 0xf];\n        *q++ = hexdig[*p & 0xf];\n        *q++ = \':\';\n    }\n    q[-1] = 0;\n#ifdef CHARSET_EBCDIC\n    ebcdic2ascii(tmp, tmp, q - tmp - 1);\n#endif\n    return tmp;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}']