summaryrefslogtreecommitdiff
path: root/usr/src/common/ctf/ctf_lookup.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-06-03 11:38:44 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-06-03 11:38:44 +0000
commit1c5ac86169ba0e28b070d8b7f6c787be64bce7e4 (patch)
tree984f229706437e50b866d25cd3aced33f9358a5f /usr/src/common/ctf/ctf_lookup.c
parented13e9ae4cee8abfe808486d0e0d7ee69b8fc256 (diff)
parentd15d17d4231f87f1571fa6d585377206f360f667 (diff)
downloadillumos-joyent-1c5ac86169ba0e28b070d8b7f6c787be64bce7e4.tar.gz
[illumos-gate merge]
commit d15d17d4231f87f1571fa6d585377206f360f667 12786 fix CTF pointer overrun commit 8fff788790878e3c95666decd46960ecc74c1c69 12721 would like svcadm disable -c commit 87be0d9605ee884229638b6fd168fa7165e109a3 12813 pptadm and libppt are x86 only commit 069e6b7e31ba5dcbc5441b98af272714d9a5455c 12708 Packages could be linted 12717 Stop ignoring pkgdepend errors commit 605d010da59abaf92279a7caed83515cbb3218dc 7510 enable highres clock usage for non-privileged users Conflicts: usr/src/man/man3c/timer_settime.3c
Diffstat (limited to 'usr/src/common/ctf/ctf_lookup.c')
-rw-r--r--usr/src/common/ctf/ctf_lookup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr/src/common/ctf/ctf_lookup.c b/usr/src/common/ctf/ctf_lookup.c
index 05aa54d6cb..b45b7ad793 100644
--- a/usr/src/common/ctf/ctf_lookup.c
+++ b/usr/src/common/ctf/ctf_lookup.c
@@ -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 */