Lines Matching refs:str
58 static char *sec_alloc_realloc(BUF_MEM *str, size_t len)
63 if (str->data != NULL) {
65 memcpy(ret, str->data, str->length);
66 OPENSSL_secure_clear_free(str->data, str->length);
67 str->data = NULL;
73 size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
78 if (str->length >= len) {
79 str->length = len;
82 if (str->max >= len) {
83 if (str->data != NULL)
84 memset(&str->data[str->length], 0, len - str->length);
85 str->length = len;
94 if ((str->flags & BUF_MEM_FLAG_SECURE))
95 ret = sec_alloc_realloc(str, n);
97 ret = OPENSSL_realloc(str->data, n);
102 str->data = ret;
103 str->max = n;
104 memset(&str->data[str->length], 0, len - str->length);
105 str->length = len;
110 size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
115 if (str->length >= len) {
116 if (str->data != NULL)
117 memset(&str->data[len], 0, str->length - len);
118 str->length = len;
121 if (str->max >= len) {
122 memset(&str->data[str->length], 0, len - str->length);
123 str->length = len;
132 if ((str->flags & BUF_MEM_FLAG_SECURE))
133 ret = sec_alloc_realloc(str, n);
135 ret = OPENSSL_clear_realloc(str->data, str->max, n);
140 str->data = ret;
141 str->max = n;
142 memset(&str->data[str->length], 0, len - str->length);
143 str->length = len;