diff options
Diffstat (limited to 'usr/src/common/ctf/ctf_lookup.c')
-rw-r--r-- | usr/src/common/ctf/ctf_lookup.c | 3 |
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 */ |