From: Jani Nikula <jani.nikula@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [igt-dev] [PATCH i-g-t] tools/intel_reg: fix use-after-free bug in register spec read
Date: Wed, 21 Aug 2019 16:09:28 +0300 [thread overview]
Message-ID: <20190821130928.29640-1-jani.nikula@intel.com> (raw)
e points into the buffer pointer to by p.
Fixes: dfda0b6aecce ("intel_reg: introduce one intel_reg tool to rule them all")
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
tools/intel_reg_spec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/intel_reg_spec.c b/tools/intel_reg_spec.c
index 0df69b6884de..5ab56ec1a31f 100644
--- a/tools/intel_reg_spec.c
+++ b/tools/intel_reg_spec.c
@@ -233,9 +233,9 @@ static int parse_line(struct reg *reg, const char *line)
reg->name = p;
} else if (i == 2) {
reg->addr = strtoul(p, &e, 16);
- free(p);
if (*e)
ret = -1;
+ free(p);
} else if (i == 3) {
ret = parse_port_desc(reg, p);
free(p);
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2019-08-21 13:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 13:09 Jani Nikula [this message]
2019-08-21 13:40 ` [igt-dev] [PATCH i-g-t] tools/intel_reg: fix use-after-free bug in register spec read Ser, Simon
2019-08-22 7:33 ` Jani Nikula
2019-08-21 13:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-22 1:23 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190821130928.29640-1-jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox