summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-06-01 15:10:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-06-01 15:10:54 +0000
commita918d16c5c56917eca54272018ae30883ed218ec (patch)
tree3a688d819f3e93430abd417a17aebfb2cd718209 /lib
parent7b75e731cdc2a1f01a3cf19e037bd2be99ff017a (diff)
Commit this before the head-scratching leads to premature baldness:
memset(a->data, 0, (unsigned int)a->max); but the decl is: size_t max; size_t could be larger than int, especially in some of the systems OpenSSL purports to support. How do _intentionally truncating_ casts like enter into a codebase? Lack of understanding of C, at a minimum. Generally the objects are small, but this code is _intentionally unready_ for large objects. ok miod
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/buffer/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libcrypto/buffer/buffer.c b/lib/libcrypto/buffer/buffer.c
index 486d6fef141..71784693be3 100644
--- a/lib/libcrypto/buffer/buffer.c
+++ b/lib/libcrypto/buffer/buffer.c
@@ -88,7 +88,7 @@ BUF_MEM_free(BUF_MEM *a)
return;
if (a->data != NULL) {
- memset(a->data, 0, (unsigned int)a->max);
+ memset(a->data, 0, a->max);
free(a->data);
}
free(a);