summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/buffer/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/openssl/openssl/crypto/buffer/buffer.c')
-rw-r--r--deps/openssl/openssl/crypto/buffer/buffer.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/deps/openssl/openssl/crypto/buffer/buffer.c b/deps/openssl/openssl/crypto/buffer/buffer.c
index f3f8a1b55c..72258abb9e 100644
--- a/deps/openssl/openssl/crypto/buffer/buffer.c
+++ b/deps/openssl/openssl/crypto/buffer/buffer.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -25,7 +25,7 @@ BUF_MEM *BUF_MEM_new_ex(unsigned long flags)
ret = BUF_MEM_new();
if (ret != NULL)
ret->flags = flags;
- return (ret);
+ return ret;
}
BUF_MEM *BUF_MEM_new(void)
@@ -35,16 +35,15 @@ BUF_MEM *BUF_MEM_new(void)
ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE);
- return (NULL);
+ return NULL;
}
- return (ret);
+ return ret;
}
void BUF_MEM_free(BUF_MEM *a)
{
if (a == NULL)
return;
-
if (a->data != NULL) {
if (a->flags & BUF_MEM_FLAG_SECURE)
OPENSSL_secure_clear_free(a->data, a->max);
@@ -68,7 +67,7 @@ static char *sec_alloc_realloc(BUF_MEM *str, size_t len)
str->data = NULL;
}
}
- return (ret);
+ return ret;
}
size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
@@ -78,13 +77,13 @@ size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
if (str->length >= len) {
str->length = len;
- return (len);
+ return len;
}
if (str->max >= len) {
if (str->data != NULL)
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
- return (len);
+ return len;
}
/* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
if (len > LIMIT_BEFORE_EXPANSION) {
@@ -105,7 +104,7 @@ size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
}
- return (len);
+ return len;
}
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
@@ -117,12 +116,12 @@ size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
if (str->data != NULL)
memset(&str->data[len], 0, str->length - len);
str->length = len;
- return (len);
+ return len;
}
if (str->max >= len) {
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
- return (len);
+ return len;
}
/* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
if (len > LIMIT_BEFORE_EXPANSION) {
@@ -143,7 +142,7 @@ size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
}
- return (len);
+ return len;
}
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t size)