diff options
| author | Eivind Eklund <eivind@FreeBSD.org> | 1997-02-09 14:20:30 +0000 |
|---|---|---|
| committer | Eivind Eklund <eivind@FreeBSD.org> | 1997-02-09 14:20:30 +0000 |
| commit | d3c68240319d2dad8bb174032e6b76b9192b8a61 (patch) | |
| tree | be396480c7e0fbf79d624e21cb86f1f0b6360fea /sbin | |
| parent | cd5baeac25094c4459c1efd0cb9899571e3786ca (diff) | |
Notes
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/restore/symtab.c | 5 |
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) |
