Skip to content

Commit

Permalink
12786 fix CTF pointer overrun
Browse files Browse the repository at this point in the history
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
nicomazz authored and John Levon committed Jun 3, 2020
1 parent 8fff788 commit d15d17d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usr/src/common/ctf/ctf_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ ctf_lookup_by_name(ctf_file_t *fp, const char *name)

for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) {
if (lp->ctl_prefix[0] == '\0' ||
strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0) {
((size_t)(q - p) >= lp->ctl_len && strncmp(p,
lp->ctl_prefix, (size_t)(q - p)) == 0)) {
for (p += lp->ctl_len; isspace(*p); p++)
continue; /* skip prefix and next ws */

Expand Down

0 comments on commit d15d17d

Please sign in to comment.