apps/apps.c:310: error: BUFFER_OVERRUN_L2
  Offset added: [0, 2147483646] Size: 280 by call to `UI_create_method`.
Showing all 13 steps of the trace


apps/apps.c:310:17: Call
308.   int setup_ui_method(void)
309.   {
310.       ui_method = UI_create_method("OpenSSL application user interface");
                       ^
311.       UI_method_set_opener(ui_method, ui_open);
312.       UI_method_set_reader(ui_method, ui_read);

crypto/ui/ui_lib.c:580:1: Parameter `*name`
  578.   }
  579.   
  580. > UI_METHOD *UI_create_method(char *name)
  581.   {
  582.       UI_METHOD *ui_method = OPENSSL_zalloc(sizeof(*ui_method));

crypto/ui/ui_lib.c:585:27: Call
  583.   
  584.       if (ui_method)
  585.           ui_method->name = BUF_strdup(name);
                                   ^
  586.       return ui_method;
  587.   }

crypto/buffer/buf_str.c:73:1: Parameter `*str`
    71.   }
    72.   
    73. > char *BUF_strdup(const char *str)
    74.   {
    75.       if (str == NULL)

crypto/buffer/buf_str.c:77:12: Call
    75.       if (str == NULL)
    76.           return NULL;
    77.       return BUF_strndup(str, strlen(str));
                     ^
    78.   }
    79.   

crypto/buffer/buf_str.c:87:11: <Offset trace>
85.           return NULL;
86.   
87.       siz = BUF_strnlen(str, siz);
                ^
88.   
89.       if (siz >= INT_MAX)

crypto/buffer/buf_str.c:87:11: Call
      85.           return NULL;
      86.   
      87.       siz = BUF_strnlen(str, siz);
                      ^
      88.   
      89.       if (siz >= INT_MAX)

crypto/buffer/buf_str.c:64:1: Parameter `*str`
        62.   #include <openssl/buffer.h>
        63.   
        64. > size_t BUF_strnlen(const char *str, size_t maxlen)
        65.   {
        66.       const char *p;

crypto/buffer/buf_str.c:70:5: Assignment
        68.       for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
        69.   
        70.       return p - str;
                  ^
        71.   }
        72.   

crypto/buffer/buf_str.c:87:5: Assignment
      85.           return NULL;
      86.   
      87.       siz = BUF_strnlen(str, siz);
                ^
      88.   
      89.       if (siz >= INT_MAX)

crypto/buffer/buf_str.c:80:1: <Length trace>
78.   }
79.   
80. > char *BUF_strndup(const char *str, size_t siz)
81.   {
82.       char *ret;

crypto/buffer/buf_str.c:80:1: Parameter `*str`
      78.   }
      79.   
      80. > char *BUF_strndup(const char *str, size_t siz)
      81.   {
      82.       char *ret;

crypto/buffer/buf_str.c:98:5: Array access: Offset added: [0, 2147483646] Size: 280 by call to `UI_create_method` 
      96.       }
      97.   
      98.       memcpy(ret, str, siz);
                 ^
      99.       ret[siz] = '\0';
      100.   

char *BUF_strndup(const char *str, size_t siz)
{
    char *ret;
    if (str == NULL)
        return NULL;
    siz = BUF_strnlen(str, siz);
    if (siz >= INT_MAX)
        return NULL;
    ret = OPENSSL_malloc(siz + 1);
    if (ret == NULL) {
        BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);
        return NULL;
    }
    memcpy(ret, str, siz);
    ret[siz] = '\0';
    return (ret);
}
['int setup_ui_method(void)\n{\n    ui_method = UI_create_method("OpenSSL application user interface");\n    UI_method_set_opener(ui_method, ui_open);\n    UI_method_set_reader(ui_method, ui_read);\n    UI_method_set_writer(ui_method, ui_write);\n    UI_method_set_closer(ui_method, ui_close);\n    return 0;\n}', 'UI_METHOD *UI_create_method(char *name)\n{\n    UI_METHOD *ui_method = OPENSSL_zalloc(sizeof(*ui_method));\n    if (ui_method)\n        ui_method->name = BUF_strdup(name);\n    return ui_method;\n}', 'char *BUF_strdup(const char *str)\n{\n    if (str == NULL)\n        return NULL;\n    return BUF_strndup(str, strlen(str));\n}', "char *BUF_strndup(const char *str, size_t siz)\n{\n    char *ret;\n    if (str == NULL)\n        return NULL;\n    siz = BUF_strnlen(str, siz);\n    if (siz >= INT_MAX)\n        return NULL;\n    ret = OPENSSL_malloc(siz + 1);\n    if (ret == NULL) {\n        BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    memcpy(ret, str, siz);\n    ret[siz] = '\\0';\n    return (ret);\n}", "size_t BUF_strnlen(const char *str, size_t maxlen)\n{\n    const char *p;\n    for (p = str; maxlen-- != 0 && *p != '\\0'; ++p) ;\n    return p - str;\n}"]