diff options
Diffstat (limited to 'freebsd/crypto/openssl/crypto/bio')
-rw-r--r-- | freebsd/crypto/openssl/crypto/bio/bss_log.c | 4 | ||||
-rw-r--r-- | freebsd/crypto/openssl/crypto/bio/bss_mem.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/freebsd/crypto/openssl/crypto/bio/bss_log.c b/freebsd/crypto/openssl/crypto/bio/bss_log.c index a73302e1..d7cb573c 100644 --- a/freebsd/crypto/openssl/crypto/bio/bss_log.c +++ b/freebsd/crypto/openssl/crypto/bio/bss_log.c @@ -2,7 +2,7 @@ /* crypto/bio/bss_log.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -244,7 +244,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl) if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) { return (0); } - strncpy(buf, in, inl); + memcpy(buf, in, inl); buf[inl] = '\0'; i = 0; diff --git a/freebsd/crypto/openssl/crypto/bio/bss_mem.c b/freebsd/crypto/openssl/crypto/bio/bss_mem.c index 4326e117..03404a5b 100644 --- a/freebsd/crypto/openssl/crypto/bio/bss_mem.c +++ b/freebsd/crypto/openssl/crypto/bio/bss_mem.c @@ -190,6 +190,8 @@ static int mem_write(BIO *b, const char *in, int inl) } BIO_clear_retry_flags(b); + if (inl == 0) + return 0; blen = bm->length; if (BUF_MEM_grow_clean(bm, blen + inl) != (blen + inl)) goto end; |