From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbeAZRW4 (ORCPT ); Fri, 26 Jan 2018 12:22:56 -0500 Received: from mail-qt0-f179.google.com ([209.85.216.179]:45510 "EHLO mail-qt0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbeAZRWz (ORCPT ); Fri, 26 Jan 2018 12:22:55 -0500 X-Google-Smtp-Source: AH8x2262tLv+3MsUKAyV9guapDS2hmWDoG3O/FYvFjk1X1eSs85iJToL1wWUPStuJJ3yT1laXKYYrtJk7pmxNrOYaHM= MIME-Version: 1.0 In-Reply-To: <20180119161103.15035-2-jolsa@kernel.org> References: <20180119161103.15035-1-jolsa@kernel.org> <20180119161103.15035-2-jolsa@kernel.org> From: Andy Shevchenko Date: Fri, 26 Jan 2018 19:22:53 +0200 Message-ID: Subject: Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsa wrote: > Current kallsyms__parse uses hex2u64, which gives > no indication of error. Using strtoul to checkup > on failed attempt to parse the number and stop the > rest of the kallsyms__parse processing early. > + start = strtoul(line, &endptr, 16); > + if (line == endptr) > + continue; > + > + len = endptr - line + 1; > > - len++; > if (len + 2 >= line_len) > continue; https://patchwork.kernel.org/patch/4087681/ -- With Best Regards, Andy Shevchenko