diff mbox

[FFmpeg-devel] avformat/tls_schannel: Fix use of uninitialized variable

Message ID 20180817100451.9294-1-pawel.wegner95@gmail.com
State Accepted
Commit 85c00643b763bc62f3a15c19df44c3f1312bfe81
Headers show

Commit Message

Paweł Wegner Aug. 17, 2018, 10:04 a.m. UTC
Yes, it will work.

Fixes: runtime error: passing uninitialized value to FreeContextBuffer
causes a crash

Signed-off-by: Paweł Wegner <pawel.wegner95@gmail.com>
---
 libavformat/tls_schannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hendrik Leppkes Aug. 17, 2018, 12:36 p.m. UTC | #1
On Fri, Aug 17, 2018 at 12:05 PM Paweł Wegner <pawel.wegner95@gmail.com> wrote:
>
> Yes, it will work.
>
> Fixes: runtime error: passing uninitialized value to FreeContextBuffer
> causes a crash
>
> Signed-off-by: Paweł Wegner <pawel.wegner95@gmail.com>
> ---
>  libavformat/tls_schannel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
> index f41b007773..4f0badcb8d 100644
> --- a/libavformat/tls_schannel.c
> +++ b/libavformat/tls_schannel.c
> @@ -148,7 +148,7 @@ static int tls_client_handshake_loop(URLContext *h, int initial)
>      TLSContext *c = h->priv_data;
>      TLSShared *s = &c->tls_shared;
>      SECURITY_STATUS sspi_ret;
> -    SecBuffer outbuf[3];
> +    SecBuffer outbuf[3] = { 0 };
>      SecBufferDesc outbuf_desc;
>      SecBuffer inbuf[2];
>      SecBufferDesc inbuf_desc;
> --
> 2.17.1
>

LGTM.

- Hendrik
Carl Eugen Hoyos Aug. 17, 2018, 12:51 p.m. UTC | #2
2018-08-17 14:36 GMT+02:00, Hendrik Leppkes <h.leppkes@gmail.com>:
> On Fri, Aug 17, 2018 at 12:05 PM Paweł Wegner <pawel.wegner95@gmail.com>
> wrote:
>>
>> Yes, it will work.
>>
>> Fixes: runtime error: passing uninitialized value to FreeContextBuffer
>> causes a crash
>>
>> Signed-off-by: Paweł Wegner <pawel.wegner95@gmail.com>
>> ---
>>  libavformat/tls_schannel.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
>> index f41b007773..4f0badcb8d 100644
>> --- a/libavformat/tls_schannel.c
>> +++ b/libavformat/tls_schannel.c
>> @@ -148,7 +148,7 @@ static int tls_client_handshake_loop(URLContext *h,
>> int initial)
>>      TLSContext *c = h->priv_data;
>>      TLSShared *s = &c->tls_shared;
>>      SECURITY_STATUS sspi_ret;
>> -    SecBuffer outbuf[3];
>> +    SecBuffer outbuf[3] = { 0 };
>>      SecBufferDesc outbuf_desc;
>>      SecBuffer inbuf[2];
>>      SecBufferDesc inbuf_desc;
>> --
>> 2.17.1
>>
>
> LGTM.

Then please commit.

Carl Eugen
Thilo Borgmann Aug. 18, 2018, 2:40 p.m. UTC | #3
Am 17.08.18 um 14:51 schrieb Carl Eugen Hoyos:
> 2018-08-17 14:36 GMT+02:00, Hendrik Leppkes <h.leppkes@gmail.com>:
>> On Fri, Aug 17, 2018 at 12:05 PM Paweł Wegner <pawel.wegner95@gmail.com>
>> wrote:
>>>
>>> Yes, it will work.
>>>
>>> Fixes: runtime error: passing uninitialized value to FreeContextBuffer
>>> causes a crash
>>>
>>> Signed-off-by: Paweł Wegner <pawel.wegner95@gmail.com>
>>> ---
>>>  libavformat/tls_schannel.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
>>> index f41b007773..4f0badcb8d 100644
>>> --- a/libavformat/tls_schannel.c
>>> +++ b/libavformat/tls_schannel.c
>>> @@ -148,7 +148,7 @@ static int tls_client_handshake_loop(URLContext *h,
>>> int initial)
>>>      TLSContext *c = h->priv_data;
>>>      TLSShared *s = &c->tls_shared;
>>>      SECURITY_STATUS sspi_ret;
>>> -    SecBuffer outbuf[3];
>>> +    SecBuffer outbuf[3] = { 0 };
>>>      SecBufferDesc outbuf_desc;
>>>      SecBuffer inbuf[2];
>>>      SecBufferDesc inbuf_desc;
>>> --
>>> 2.17.1
>>>
>>
>> LGTM.
> 
> Then please commit.

Pushed.

-Thilo
diff mbox

Patch

diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index f41b007773..4f0badcb8d 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -148,7 +148,7 @@  static int tls_client_handshake_loop(URLContext *h, int initial)
     TLSContext *c = h->priv_data;
     TLSShared *s = &c->tls_shared;
     SECURITY_STATUS sspi_ret;
-    SecBuffer outbuf[3];
+    SecBuffer outbuf[3] = { 0 };
     SecBufferDesc outbuf_desc;
     SecBuffer inbuf[2];
     SecBufferDesc inbuf_desc;