Lines Matching refs:len
56 static char *sec_alloc_realloc(BUF_MEM *str, size_t len) in sec_alloc_realloc() argument
60 ret = OPENSSL_secure_malloc(len); in sec_alloc_realloc()
71 size_t BUF_MEM_grow(BUF_MEM *str, size_t len) in BUF_MEM_grow() argument
76 if (str->length >= len) { in BUF_MEM_grow()
77 str->length = len; in BUF_MEM_grow()
78 return len; in BUF_MEM_grow()
80 if (str->max >= len) { in BUF_MEM_grow()
82 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow()
83 str->length = len; in BUF_MEM_grow()
84 return len; in BUF_MEM_grow()
87 if (len > LIMIT_BEFORE_EXPANSION) { in BUF_MEM_grow()
91 n = (len + 3) / 3 * 4; in BUF_MEM_grow()
97 len = 0; in BUF_MEM_grow()
101 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow()
102 str->length = len; in BUF_MEM_grow()
104 return len; in BUF_MEM_grow()
107 size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len) in BUF_MEM_grow_clean() argument
112 if (str->length >= len) { in BUF_MEM_grow_clean()
114 memset(&str->data[len], 0, str->length - len); in BUF_MEM_grow_clean()
115 str->length = len; in BUF_MEM_grow_clean()
116 return len; in BUF_MEM_grow_clean()
118 if (str->max >= len) { in BUF_MEM_grow_clean()
119 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow_clean()
120 str->length = len; in BUF_MEM_grow_clean()
121 return len; in BUF_MEM_grow_clean()
124 if (len > LIMIT_BEFORE_EXPANSION) { in BUF_MEM_grow_clean()
128 n = (len + 3) / 3 * 4; in BUF_MEM_grow_clean()
134 len = 0; in BUF_MEM_grow_clean()
138 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow_clean()
139 str->length = len; in BUF_MEM_grow_clean()
141 return len; in BUF_MEM_grow_clean()