From 6a2a926d5f060b11730161eadca1de0cdf1b1c44 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 4 Nov 2019 22:52:02 +0000 Subject: [PATCH] libpmc: jevents: handle empty descriptoin PR: 241258 Reported by: sigsys @ gmail.com Obtained from: github.com/andikleen/pmu-tools commit bb3c77ed61 MFC after: 3 days --- lib/libpmc/pmu-events/jevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c index e5e81d208857..1526f75cf714 100644 --- a/lib/libpmc/pmu-events/jevents.c +++ b/lib/libpmc/pmu-events/jevents.c @@ -122,7 +122,7 @@ static void fixdesc(char *s) --e; while (e >= s && isspace(*e)) --e; - if (*e == '.') + if (e >= s && *e == '.') *e = 0; }