From patchwork Sun Oct 22 15:11:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5651 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp5830969jah; Sun, 22 Oct 2017 08:11:43 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QTC5f3FQai70/fctzpCDS0suMc/OnJr4v2kMMpmNf+HYvYDnEUU+o8DiiXc0mUPFN0Fx5U X-Received: by 10.28.158.13 with SMTP id h13mr3081233wme.47.1508685103526; Sun, 22 Oct 2017 08:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508685103; cv=none; d=google.com; s=arc-20160816; b=Hg9RxUZWaASgGamcBww/950AKIWYa+mH3eCIG+3H8M13I9tCnKSer+2QXktV5pX0uc P/SwQ750D4vkdlciFdqttChACEnye3ls6efkZoY1/dULE1K/Ye+sPnjW8k7mQ50Hgcjr XtYTnBClQsBgEAYgTE60pqRtFN7ODTibbqoyRppub3cmIWDWTNc/l5bYmkfr6BylSiQI 93+4YjI7CorwVe9FBDf1MG7UO6AzOS7Yn7vouRcUGLhnOjhSku6EWKplLEv1OSp/i82g rwXegB6mTEIEWK3D5XYj/Dg+MmqX4niVq1xyd0pLe9SJuOGtNOgVxgCNcPlXHGQMVcRX 94UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=tSO3D8XVakD+OTrnKsNtfL3JsXfOLJjd4VEUm3/QDiw=; b=CQn3Nln6s15lPKC+ffcU6vXfeMlfI527fvgEhPDc2CbWSfbYXdT1UAZZ+Yglgn91x5 1UkbIPTfcchqeoEY8kS2U7rNbN0RlHE/YxnkOW1KrSyTB2pXQNrEyfVzkfduaOrevR0n ynZZp1KlOZUbz2vf166fZAZKdAqpjeF1ZXaePS8OqcWTjAgN9cH/Cyj2yzaH2CcwPk+S /KjJFh9WA9oaOwZdiNeUYqwTsZz8WFzJPUPV8/NhSqLCl/k91t6Evs4bP4rkP7B57lmz rl61wE2TMlMk7u5hSw1tN6fkxFd7Njtjb+MEMtY3hbO5bgO4WvilF2/NSUnGrw8eaFJX 1zGg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 1si4169119wrq.164.2017.10.22.08.11.43; Sun, 22 Oct 2017 08:11:43 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08C1768A1AC; Sun, 22 Oct 2017 18:11:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8459D68A177 for ; Sun, 22 Oct 2017 18:11:26 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1e6HuW-0007hw-Ei for ffmpeg-devel@ffmpeg.org; Sun, 22 Oct 2017 17:11:32 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id QfBN1w00r0S5wYM01fBPgR; Sun, 22 Oct 2017 17:11:23 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 22 Oct 2017 17:11:20 +0200 Message-Id: <20171022151121.12909-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH 1/2] ffserver: Fix off by 1 error in path 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- fftools/ffserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffserver.c b/fftools/ffserver.c index d4885dfa0e..51f31bc704 100644 --- a/fftools/ffserver.c +++ b/fftools/ffserver.c @@ -499,9 +499,9 @@ static void start_children(FFServerStream *feed) if (!slash) { pathname = av_mallocz(sizeof("ffmpeg")); } else { - pathname = av_mallocz(slash - my_program_name + sizeof("ffmpeg")); + pathname = av_mallocz(slash - my_program_name + 1 + sizeof("ffmpeg")); if (pathname != NULL) { - memcpy(pathname, my_program_name, slash - my_program_name); + memcpy(pathname, my_program_name, slash - my_program_name + 1); } } if (!pathname) {