Buffer overflow patch.

This commit is contained in:
Eivind Eklund 1997-02-09 14:09:47 +00:00
parent e799281533
commit b94f03b208
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22482

View File

@ -150,8 +150,11 @@ lookupname(name)
cp = name;
for (ep = lookupino(ROOTINO); ep != NULL; ep = ep->e_entries) {
for (np = buf; *cp != '/' && *cp != '\0'; )
for (np = buf; *cp != '/' && *cp != '\0' &&
np < &buf[sizeof(buf)]; )
*np++ = *cp++;
if (np == &buf[sizeof(buf)])
break;
*np = '\0';
for ( ; ep != NULL; ep = ep->e_sibling)
if (strcmp(ep->e_name, buf) == 0)