summaryrefslogtreecommitdiffstats
path: root/libavformat/tls_securetransport.c
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-10-04 14:37:52 -0500
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-04 23:14:19 +0200
commit854972b53dc7bf3ab59354d430d3b0e7580315f0 (patch)
tree80055b1d91e539bda03271e7b7c3f04e967968e4 /libavformat/tls_securetransport.c
parent46f3015f35258ac53d7103cbf6c4f7df589ecaf8 (diff)
downloadffmpeg-streaming-854972b53dc7bf3ab59354d430d3b0e7580315f0.zip
ffmpeg-streaming-854972b53dc7bf3ab59354d430d3b0e7580315f0.tar.gz
libavformat/tls_securetransport: fix argument evalulation order UB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/tls_securetransport.c')
-rw-r--r--libavformat/tls_securetransport.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/tls_securetransport.c b/libavformat/tls_securetransport.c
index 73662d7..6ad266a 100644
--- a/libavformat/tls_securetransport.c
+++ b/libavformat/tls_securetransport.c
@@ -350,8 +350,9 @@ static int map_ssl_error(OSStatus status, size_t processed)
static int tls_read(URLContext *h, uint8_t *buf, int size)
{
TLSContext *c = h->priv_data;
- size_t processed;
- int ret = map_ssl_error(SSLRead(c->ssl_context, buf, size, &processed), processed);
+ size_t processed = 0;
+ int ret = SSLRead(c->ssl_context, buf, size, &processed);
+ ret = map_ssl_error(ret, processed);
if (ret > 0)
return ret;
if (ret == 0)
@@ -362,8 +363,9 @@ static int tls_read(URLContext *h, uint8_t *buf, int size)
static int tls_write(URLContext *h, const uint8_t *buf, int size)
{
TLSContext *c = h->priv_data;
- size_t processed;
- int ret = map_ssl_error(SSLWrite(c->ssl_context, buf, size, &processed), processed);
+ size_t processed = 0;
+ int ret = SSLWrite(c->ssl_context, buf, size, &processed);
+ ret = map_ssl_error(ret, processed);
if (ret > 0)
return ret;
if (ret == 0)
OpenPOWER on IntegriCloud