summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorEivind Eklund <eivind@FreeBSD.org>1997-02-09 14:20:30 +0000
committerEivind Eklund <eivind@FreeBSD.org>1997-02-09 14:20:30 +0000
commitd3c68240319d2dad8bb174032e6b76b9192b8a61 (patch)
treebe396480c7e0fbf79d624e21cb86f1f0b6360fea /sbin
parentcd5baeac25094c4459c1efd0cb9899571e3786ca (diff)
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/restore/symtab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c
index 9488a7f1369b..dc779a35e0a4 100644
--- a/sbin/restore/symtab.c
+++ b/sbin/restore/symtab.c
@@ -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)