From patchwork Fri Aug 17 09:44:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Wegner?= X-Patchwork-Id: 10018 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp550550jad; Fri, 17 Aug 2018 02:50:31 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxXj45o2jPM59Ccs92WRMyCtV+TYV1b/kL5zyT9QcfWBfwDOCCcFPJwBr6vXbvdRTMRom4f X-Received: by 2002:a1c:af0c:: with SMTP id y12-v6mr17293840wme.87.1534499431243; Fri, 17 Aug 2018 02:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534499431; cv=none; d=google.com; s=arc-20160816; b=fIr36qD+nQ55kPr0oPLZt3Xw+0+854Teejr/yTTX7hObJAJ1APvwo//bKQbRQ7seN8 61ZpPNE6QTN8h414PyVKLnN+Oai774FZFO3IhHOINZEMcUZ/wk8R5UKUbcE4m4EJ37xK 72HG9AmW5pbzqqulx7RlcIzEJGI8RFaFcaLaachmiWtzo5z341IjovrjHT59uk5g4oy7 jwPTJW7umiqrY+h6mhIMHQtzRA0cL4tuPoW7cylrSSp7rdJSmBha9AuDtfLIYZXpLuo4 6sFl7KKRWJqJRt2QTAMYzEHq64YKeXTNw/5uu3vXLuJ35yTPkQOU8ZCPZz4XwbaSG9MN qBkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=QXCjyH3jH+Nw+nPVsPN2g4dFuFp1Yl8guCz5V0E2QFs=; b=OSxqX8MqWpCo1o4TYGCP6fVbNbG5oJpUngzp9PHVwLLeD++kpWmbkxHfzp2nGmZQqc 3yrSykA1enOnAM2yVN7fjt8tWM7IUyOPIS8R7IERaK2jE5DmGxsPT/gJ4NJcKpd0SVVw OIRfLHC3q1LZAqa0LOa9Ri2PQN7R3bGa7seMDdc25ifDIpzg1pZyAF6tPhP/eAOdsXOF igd+TIpj2awJ4zqM3ni6zgtWoTTZ1DnjizpFZ+FSEmT34YGJqIYPXzB8v/WoM/xH1JvX 4YYnanttMcgZ3X8MmfH1cuIlou0VqJx56h4RbJTD7112qBvyxscr75KCWCSbLY1BR27m S8uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=PLCQCMRB; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t6-v6si1272220wrn.195.2018.08.17.02.50.30; Fri, 17 Aug 2018 02:50:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=PLCQCMRB; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E2B4689F31; Fri, 17 Aug 2018 12:50:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F2D33689F0B for ; Fri, 17 Aug 2018 12:49:56 +0300 (EEST) Received: by mail-lf1-f65.google.com with SMTP id f18-v6so5473723lfc.2 for ; Fri, 17 Aug 2018 02:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=UI5blQkK+8EHy6OV/YvJ4i4Qx9maadhPwn3Ec2hjaW8=; b=PLCQCMRBdEmTyeTNGVfjhLTTMDDo/Mp7NZ4w47h6zTi4Lxlp7De3PktBlF49qXm8O+ BwHm2cdGchWqB/BhMiufqshRV2maSNOt7l+JbrEKr4aCe56xbCayXByKO5t54Chhjl9l +Sf9oWrLUZ37sKnZjiaXgi+5cyI6cFQIHYhXtF5bjg4qNm3uIj588If3GPMEnFO8w6Xm H50ZCN3vZ2t4CbwEejl8IJwXl0NIZlfG0kM2rKg1woByZzPm5r4iEgqj3M9bG7vG0eAT +9XFnq2B2xxA3ExRj7nWDxzTynWFjNPUmtOo1CP0yP8L/B0n1zDP2TlDbzOty4518kwU ctiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=UI5blQkK+8EHy6OV/YvJ4i4Qx9maadhPwn3Ec2hjaW8=; b=NY57PxDdE5M/k9xFzvY2FbJhYnKX/cGSKc5t9WveiHlfmcyecMsFxGMUrIPRBWYkO0 vGA3bVzuCBgbacSRfZCDWqKsK9aMC/LLXfzO2MiSPqK/hw75ePt1jnkmqoWunqHlEEAM qtRLuOJPUimReUSPLVloxniSmF09Q8Lg9mSazt/kUX+YIbJqX5zqbVQeXbv/bSM5SY0Q 9xHMe1GEAf0BYNpc4w8QWlu+LlRF4F22/L5k56Vsa86MLsxfGEIpO/sp0JvXCxKUhqLO tE6inpBZ8YrVsxYsYGnCFOwaseo856lancbW3Bpy+3A3QbVu0H9N+Fm6mlJ0yNfAoicn Yk0A== X-Gm-Message-State: AOUpUlGonByUK/KlzNYIKTaBkHnBf4ZPPmYfGQ1oS2JUUKY3NCazBC/W 4l6Z9d4ZWRSHKRTelMbinhVrsTtPlaTb1rgbV1dgOO+M X-Received: by 2002:a19:de50:: with SMTP id v77-v6mr6754187lfg.14.1534499052068; Fri, 17 Aug 2018 02:44:12 -0700 (PDT) MIME-Version: 1.0 References: <20180803182833.3925-1-pawel.wegner95@gmail.com> In-Reply-To: From: =?UTF-8?Q?Pawe=C5=82_Wegner?= Date: Fri, 17 Aug 2018 11:44:00 +0200 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] avformat/tls_schannel: Fix use of uninitialized variable X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Yes, this works as well. I attached fixed patch. On Fri, Aug 17, 2018 at 11:15 AM Carl Eugen Hoyos wrote: > 2018-08-03 20:28 GMT+02:00, Paweł Wegner : > > > One could copy the initialization to the top from the while loop: > > init_sec_buffer(&outbuf[0], SECBUFFER_TOKEN, NULL, 0); > > init_sec_buffer(&outbuf[1], SECBUFFER_ALERT, NULL, 0); > > init_sec_buffer(&outbuf[2], SECBUFFER_EMPTY, NULL, 0); > > init_sec_buffer_desc(&outbuf_desc, outbuf, 3); > > I was thinking about "SecBuffer outbuf = { 0 }; > Does that work? > > Carl Eugen > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > From 496254b96fe889f7a4aa89817c384ee55afc81d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wegner?= Date: Thu, 2 Aug 2018 21:08:12 +0200 Subject: [PATCH] avformat/tls_schannel: Fix use of uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: runtime error: passing uninitialized value to FreeContextBuffer causes a crash Signed-off-by: Paweł Wegner --- 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