From patchwork Fri Mar 18 12:58:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Sheldrake X-Patchwork-Id: 8618881 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 80461C0553 for ; Fri, 18 Mar 2016 12:58:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE85920361 for ; Fri, 18 Mar 2016 12:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D68FF20351 for ; Fri, 18 Mar 2016 12:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756449AbcCRM6y (ORCPT ); Fri, 18 Mar 2016 08:58:54 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35911 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbcCRM6y (ORCPT ); Fri, 18 Mar 2016 08:58:54 -0400 Received: by mail-wm0-f42.google.com with SMTP id l124so30174295wmf.1 for ; Fri, 18 Mar 2016 05:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:user-agent:mime-version; bh=kWu/YMBlZ4gkTHlBE8fy50w+E/fA6rpgfeADheAOrbs=; b=eCWOE9fQp35PIy+1SzLQSfdSDMdJSVuQboXw/pB+/M4SB0SSte87lESpIpLsYQidlo k9ijUnU02OARuYIc2lRB7ImDkT7HVz2Z5qhqtC9G1rK7/glgztCyTEosRgKlS9pE+Hw6 DmEgQlEWkOGqYrLBQEG1fj1IwKJy5mDEl0pWMvRS4qzjXGzQg/T4F82ufkBaSSuCOnWK PqmYzNfq3VdNsfJ3DuH1RcLyC5NKS9AfRgcFiqlArWJ7tPWEhaf/uBryLI/GYd8PlbJs KHD7kijm6ZOCQg3ORmlPhRclQ8TZKV56TaV0yd4zfui5WVVrEwgLYTxK7CTrSDtsFwFv blSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version; bh=kWu/YMBlZ4gkTHlBE8fy50w+E/fA6rpgfeADheAOrbs=; b=iaJYNpYzRhOJeO7C5CyFr1QTyKuOzusxQKUv759zLGtgFUfhQ0jveZ5xtIp5r1r9Vg gfGXX4rmkBwv/XPNSBX3qwCwCz3G6L3yBh32VtzAwYe0SZnrWXMveaDmTd4VaNxFcucB 0NxjWyMulxOD6vqDUcN8+th0gXekkE13qUUBphV0k7+FVuiAUlR8bWjud730jSoGg4nN mzXRRyU8pOgwlANUdLSByFduB0jgfYTTja6e5UZqL7CPeBfJrogOeMUs02CsWuryZTlG MhwIPf1AkiPI8BDMpZv/lTTeNIf6peZA3udWNFsuCDX4I0PSmc8ynr6E6Htu7RYMOzha uf3g== X-Gm-Message-State: AD7BkJK58FtVR92TIiaCleWYPGbWexHxz1XdViZk6cNAFK8MmEkvZaUdY8YPdNsCp6oNeg== X-Received: by 10.194.189.71 with SMTP id gg7mr16160109wjc.127.1458305932845; Fri, 18 Mar 2016 05:58:52 -0700 (PDT) Received: from fractal.localdomain (255.163.90.146.dyn.plus.net. [146.90.163.255]) by smtp.gmail.com with ESMTPSA id ys9sm12130079wjc.35.2016.03.18.05.58.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Mar 2016 05:58:52 -0700 (PDT) Date: Fri, 18 Mar 2016 12:58:36 +0000 (GMT) From: Edward Sheldrake To: linux-media@vger.kernel.org Subject: [PATCH] libdvbv5: Fix dvb-format-convert segfault Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes dvb-format-convert crashing when encountering an unrecognised polarization value. Signed-off-by: Edward Sheldrake --- lib/libdvbv5/dvb-file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c index 3fda65f..fc2bebc 100644 --- a/lib/libdvbv5/dvb-file.c +++ b/lib/libdvbv5/dvb-file.c @@ -648,8 +648,8 @@ static int fill_entry(struct dvb_entry *entry, char *key, char *value) else if (!strcasecmp(key, "AUDIO_PID")) is_audio = 1; else if (!strcasecmp(key, "POLARIZATION")) { - for (j = 0; ARRAY_SIZE(dvb_sat_pol_name); j++) - if (!strcasecmp(value, dvb_sat_pol_name[j])) + for (j = 0; j < ARRAY_SIZE(dvb_sat_pol_name); j++) + if (dvb_sat_pol_name[j] && !strcasecmp(value, dvb_sat_pol_name[j])) break; if (j == ARRAY_SIZE(dvb_sat_pol_name)) return -2;