diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c index e0a75fa62ad6..392c253b8050 100644 --- a/sys/fs/autofs/autofs_vnops.c +++ b/sys/fs/autofs/autofs_vnops.c @@ -544,6 +544,8 @@ autofs_node_find(struct autofs_node *parent, const char *name, TAILQ_FOREACH(anp, &parent->an_children, an_next) { if (namelen >= 0) { + if (strlen(anp->an_name) != namelen) + continue; if (strncmp(anp->an_name, name, namelen) != 0) continue; } else {