From patchwork Fri Dec 27 03:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 182468 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp2499758ild; Thu, 26 Dec 2019 19:57:46 -0800 (PST) X-Google-Smtp-Source: APXvYqz8xC31mzMwcBidwkoFu+8qjtK6K68Isvt5q1ow6J8nEaZDeJ3+lfWLgDIOPTHqZJ2jv5DF X-Received: by 2002:a17:90a:cb8c:: with SMTP id a12mr24071025pju.71.1577419066922; Thu, 26 Dec 2019 19:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577419066; cv=none; d=google.com; s=arc-20160816; b=ggHfzj4JK55Lp0M+MRw/CSHbKddzx4PFdQJQkJUlGDZWwDs+F0p/oXmLKDyiqTgm2i /EGWYiMuLQCqoAynadDB+s431EimNIMeXHh5sYsX9Zrdhjy9/Bpi4unDo/9/TIOBZgfe HCJN75tnR/aCOlkyTMRf4HrACmS9lQvMgFncroDoGg01k/a82v2IsdktDD/VlT+rtbxc wgvBVuLtVRr9MUCH8cL8t5TGaBYjtWKNL8gzM1PrLcSTgtqf4ZekxhZNwGs4GrHq4vDc tiL3gqLJdKShRmevHmCQXRx+PvxrDR4XyukD25dyUlmWXjwz11TE8rN7mdPgpRE52COK ar2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=WwlHbfDGcfhRaT9Z1Ltb7H4hBJqIVLMJWFgYqhqQZeg=; b=zqXexfxVTD1KCXTeUZTSjhwwxp3T4ggqW6Uw5P+XyVTgGPqI25P6jb1BOPCAFUnGWH 3TWsMWJ4pH3WpH77aMRBvmHfmCL8Ny1lErsyX0vUzBo3RkFQRZ8KiUw1UdbczPBKr7DQ 6F7FUqvZBWy/Lx8cZfEhibLzE7/U2qakTWhqCfuK/2/JBlJvT5IYOTqYy2cVqaCmm74x FrIVn5KWf2B+/f8KE/re60RjBsKXKOcNxFeOOedK16pyU5e+chKp1rKb4N5kZ6v06ufb qkEDA0yhiwObdukQc2MnQQxTqimkFT9KSh5qg57mM1IesBPxifMWeYuLDXvKK/71aWZ8 oAsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GKk+ufLp; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id c38si29251260pgb.460.2019.12.26.19.57.46; Thu, 26 Dec 2019 19:57:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=GKk+ufLp; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 9CEBD7D58A; Fri, 27 Dec 2019 03:57:38 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mail.openembedded.org (Postfix) with ESMTP id 2C5F27D3B7 for ; Fri, 27 Dec 2019 03:56:48 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id bd4so11226090plb.8 for ; Thu, 26 Dec 2019 19:56:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P1kYvapk1YhUPCOCWdlQW4iaZ/QqaLE5pMZkRRycYMU=; b=GKk+ufLphkLBsvcw2qThUAdkW/QNco2Kw6bCrtQ39cbt6FfQKOQeHroQADI8WO+zfa RzfV1F+4ajqLFEny7n30cujBNQGdcWwwfaIN6hQ2Sq6KQJeUvJW9nwpRPdsPUn/poCAe e7AV1iRSSUVwxqJQshc7nZcyZFv9Y3arQhwWxRek6HMLPSuZa8kj5T64cvFWbcmV4wdJ PQ3ZYD3anOp+ca1y6ex+oJyIN13tSEn7/drvjgEpds5sucWQH4hyhn0Rg2hAcWX85nCB mEtT518V5iGNEsniYleqe03lHtawBuSqLqOvlwqsx6n95NftEb6vkwyRZkopWPTGYPv0 dJtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P1kYvapk1YhUPCOCWdlQW4iaZ/QqaLE5pMZkRRycYMU=; b=mkTp10WAY4QWKfDpdbSJi8CHr5IzGsESefV+VgLt2eGEniVIExTzClAUl32MhrisLD nD7muDiuJeL/vXapHSjzt/VvwRVGGDlwcMQlJNjR9cDaWz8qUYK1IDOl+EcOwx4xL9QP p+qICTnVhUJy+wzVJD31tleO6gwZrzTBYT5lQa5ScNyqZYtmYVIXjyxWCSNTTldP7Tz5 DFEFGHBsnLeLo6FfBEQAJu8LeJ1F5buiilr591bMmOwVh3XJMAbAdb53Qgk7FQOqlyCC K3SBusZ+wiWnK/wO6wuJfNC8CTgnfm0i+/qS8jz/1mA8JKBAYwc3pinJ2EqWuxRV4G88 A8WA== X-Gm-Message-State: APjAAAVo41g0sQO2GjI32qGmx6viQgjiD5uqIY2CerQxIyRcarDDJOwW xJ3PfS25Io2ez/S7iNtM14NDzyleJUM= X-Received: by 2002:a17:902:244:: with SMTP id 62mr9555608plc.117.1577419008739; Thu, 26 Dec 2019 19:56:48 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::2f83]) by smtp.gmail.com with ESMTPSA id r30sm36673613pfl.162.2019.12.26.19.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 19:56:48 -0800 (PST) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Thu, 26 Dec 2019 19:56:37 -0800 Message-Id: <20191227035639.303716-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191227035639.303716-1-raj.khem@gmail.com> References: <20191227035639.303716-1-raj.khem@gmail.com> MIME-Version: 1.0 Subject: [oe] [meta-multimedia][PATCH 3/5] tvheadend: Fix format-truncation warnings X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org Signed-off-by: Khem Raj Cc: Andreas Müller --- .../0001-allocate-space-for-buf-on-heap.patch | 46 +++++++++++++++++++ .../recipes-dvb/tvheadend/tvheadend_git.bb | 1 + 2 files changed, 47 insertions(+) create mode 100644 meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch diff --git a/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch b/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch new file mode 100644 index 0000000000..cbd76b6abf --- /dev/null +++ b/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-allocate-space-for-buf-on-heap.patch @@ -0,0 +1,46 @@ +From d4a405f87fc215c14e610a25b5a6b14060c1ef15 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 25 Dec 2019 13:53:52 -0800 +Subject: [PATCH] allocate space for buf on heap + +Avoids +| src/epggrab/module/xmltv.c:204:47: error: '%s' directive output may be truncated writing between 2 and 2147483645 bytes into a region of size 115 [-Werror=format-truncation=] +| 204 | snprintf(buf, sizeof(buf)-1, "ddprogid://%s/%s", mod->id, s); +| | ^~ + +Upstream-Status: Submitted [https://github.com/tvheadend/tvheadend/pull/1324] +Signed-off-by: Khem Raj +--- + src/epggrab/module/xmltv.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c +index 34ab05bdb..b1a956614 100644 +--- a/src/epggrab/module/xmltv.c ++++ b/src/epggrab/module/xmltv.c +@@ -197,11 +197,12 @@ static void parse_xmltv_dd_progid + (epggrab_module_t *mod, const char *s, char **uri, char **suri, + epg_episode_num_t *epnum) + { +- char buf[128]; + if (strlen(s) < 2) return; + ++ char* buf = (char *)malloc(strlen(s) + strlen(mod->id) + 13); ++ buf[strlen(s) + strlen(mod->id) + 12] = '\0'; + /* Raw URI */ +- snprintf(buf, sizeof(buf)-1, "ddprogid://%s/%s", mod->id, s); ++ snprintf(buf, strlen(s) + strlen(mod->id) + 12, "ddprogid://%s/%s", mod->id, s); + + /* SH - series without episode id so ignore */ + if (strncmp("SH", s, 2)) +@@ -219,6 +220,7 @@ static void parse_xmltv_dd_progid + if (buf[e+1]) sscanf(&buf[e+1], "%hu", &(epnum->e_num)); + } + } ++ free(buf); + } + + /** +-- +2.24.1 + diff --git a/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb b/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb index a818a961f3..20faef047e 100644 --- a/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb +++ b/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb @@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=9cae5acac2e9ee2fc3aec01ac88ce5db" SRC_URI = "git://github.com/tvheadend/tvheadend.git \ file://0001-adjust-for-64bit-time_t.patch \ + file://0001-allocate-space-for-buf-on-heap.patch \ " SRCREV = "fda89e85e0b6ae796d8a09e178d3937aa7869270"