diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2015-06-20 16:46:33 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2015-06-28 18:21:06 +0200 |
commit | 7f098cb4360a2677aab741ffc661964c501dd51e (patch) | |
tree | d7c59316e732c6a0368d1b6d0837fcb6cbb711aa /crypto | |
parent | 03a1c85062b44d9d9aa0ab5808c4f93b3516071c (diff) |
Check dgram_sctp_write() return value.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bio/bss_dgram.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 089a952096..dabfea35c0 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -1219,9 +1219,13 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) * it can be sent now. */ if (data->saved_message.length > 0) { - dgram_sctp_write(data->saved_message.bio, + i = dgram_sctp_write(data->saved_message.bio, data->saved_message.data, data->saved_message.length); + if (i < 0) { + ret = i; + break; + } OPENSSL_free(data->saved_message.data); data->saved_message.data = NULL; data->saved_message.length = 0; @@ -1366,6 +1370,14 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) return (ret); } +/* + * dgram_sctp_write - send message on SCTP socket + * @b: BIO to write to + * @in: data to send + * @inl: amount of bytes in @in to send + * + * Returns -1 on error or the sent amount of bytes on success + */ static int dgram_sctp_write(BIO *b, const char *in, int inl) { int ret; |