Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp568088pxk; Thu, 17 Sep 2020 10:08:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVFtZZoHi/KKRJnhkLJhYLdLCOkDBykqhJDRTZaT5QnZYpkUOvskc82ILnLu8p1hD+QZl3 X-Received: by 2002:aa7:d4d2:: with SMTP id t18mr33474878edr.55.1600362531482; Thu, 17 Sep 2020 10:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600362531; cv=none; d=google.com; s=arc-20160816; b=P51bJNouXdFVeT/c6V4qbpU+Q6OTsvjsW+NavdKvYO5AaXPyVbs6UrLfQvFIiC1+cu IH+wo6ev/mt8yzPZZUeIqEUO3eFu7VZBdkrRVwADLdSQ5jnzuAE7dMYQsBMxtzChH4s0 3UaAduKIMHNuVgQFmrjbE9CUxL1ibtDJUwXJhdU8AsUmPGpGnxzyk3LmFusJ07ngJnEg 0uB8CA/LvczY9fKK8oUyz6R7Ww6qsrU94xxn8Yf79ELpMZBo2pCMkTs3siuw54oXrylU hUjEXF2xe/xIy0JAMer2ZqewO5TLrVmaZ0CdkeZ5ihY0Ivjl38r8UjeSYxC9VK5WQWQp lU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VMLVYDWBjclWEI28bzU/NR4Kp0EA+W5FtgNf/T9DsOg=; b=dj2qPj0EHn6i2pDaVPSsAgas2nSNuc5m+5hTgCa55bENxSYTYkaDOrPLiWh/6eU42x 5K20nICr+EmKgGwn1rkEi6BQluVK+fJm5Y5aAo7eKly6uouSKE0D1AwnVm+hmy2iJ/IA MHuUdI8wzVOdTIivuszalJT+E+I0+lDhcVQX1EieyK6a0im7dBTbA2K743XHGHhhX8a6 P50Z3lWqnFoE1CoK7w5R30pJtJlPmBx4trb6eFFCLSd1BEsjbcwMt0M93cjUHblgfkAv rO7cQJ9rjG5rh1erXEUhXsAKDHUtrdiAg3goBxK4A1zulBbu115PPg7JFLhd+hDX40+P hQBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GObppxl7; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si196133edl.230.2020.09.17.10.08.06; Thu, 17 Sep 2020 10:08:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GObppxl7; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726900AbgIQRF4 (ORCPT + 99 others); Thu, 17 Sep 2020 13:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbgIQRFw (ORCPT ); Thu, 17 Sep 2020 13:05:52 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E29CFC06174A for ; Thu, 17 Sep 2020 10:05:51 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id z26so3245715oih.12 for ; Thu, 17 Sep 2020 10:05:51 -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 :cc; bh=VMLVYDWBjclWEI28bzU/NR4Kp0EA+W5FtgNf/T9DsOg=; b=GObppxl7EHVcxkMQH/tGWkHFLMBMj976QXJ7ndlydzrYsFK133i1KUNdtxoHrIPEWu azoZtDTfb/r9tN2JbVLFXrWOOBhJ2RXa1Ud9vmm8GE1D/JShQmGpP9mVvdiXCJrCBJIt SeJtay1TLvInMktHm2ZxMqrPyV64GJBJcsFf83hDkfjKwdGcYUVC6lh7HpwMRaWCGE/T A4Pq+TCZVVM54/4iB/gaYrOIHRjEKoEz3hyc9HkTdDcRZY8IEmNMQY2jJVWL6/D/QbvC 7djGCpSJgglEbRtspeSk8HrcyKZ4XHsdcGotvaFPCqag6/XtxomnWyfwQ675XJcW/2x3 b9vQ== 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:cc; bh=VMLVYDWBjclWEI28bzU/NR4Kp0EA+W5FtgNf/T9DsOg=; b=a3WvzHpDniDyBQgaqwXSNF9kN6UYbqcbSojLH0HkN/r94ls0xXHV2xB/3qTYrQQwuW hQ7BQNfFwAIQxaEox/xaKwTM/jsWsFiNHvMraaZwqAKMw7NhGt20liA7GP524ZQMisiy UFWBkegj+Hgn6M64WM7eEiEsjGmxNrKcv/vynl9kb1ZtHibHYZaNQ7Pm3+CCT0NPY2+1 h50gF2S8yJQUKdaizb+qUDwMrQgNVAQ8HB8fMlZQma05FnGFOjwaP9mSE9jxRh435RC5 hyI30tHMhboAJZdn6kDhtbCta1FtqxZtql1nlvF/m/iy4FMmmPxlr+GNKtONuxtco15A PQLQ== X-Gm-Message-State: AOAM5308WpoIaqpKicDpSaY1Svql+36b5YF2p5+D7jv71eIWM5S0QFQr oSLPQHD63o89JwTRMY4Si532+TF6/DcvEbSEKqw= X-Received: by 2002:aca:1b01:: with SMTP id b1mr7170307oib.137.1600362350939; Thu, 17 Sep 2020 10:05:50 -0700 (PDT) MIME-Version: 1.0 References: <20200916223453.22537-1-sonnysasaka@chromium.org> In-Reply-To: <20200916223453.22537-1-sonnysasaka@chromium.org> From: Luiz Augusto von Dentz Date: Thu, 17 Sep 2020 10:05:39 -0700 Message-ID: Subject: Re: [PATCH BlueZ v2] sixaxis: Fix crash caused by return of udev_device_get_property_value To: Sonny Sasaka Cc: "linux-bluetooth@vger.kernel.org" , Miao-chen Chou , Yoni Shavit , Alain Michaud Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sonny, On Wed, Sep 16, 2020 at 3:37 PM Sonny Sasaka wrote: > > From: Miao-chen Chou > > This adds a NULL check before calling sscanf(). > > Reviewed-by: Yoni Shavit > Reviewed-by: Alain Michaud > > --- > plugins/sixaxis.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c > index 939fed759..996f85dd6 100644 > --- a/plugins/sixaxis.c > +++ b/plugins/sixaxis.c > @@ -411,7 +411,7 @@ get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus, > > hid_id = udev_device_get_property_value(hid_parent, "HID_ID"); > > - if (sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3) > + if (!hid_id || sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3) > return NULL; > > cp = get_pairing(vid, pid); > -- > 2.26.2 Applied, thanks. -- Luiz Augusto von Dentz