diff --git a/usr.bin/modstat/modstat.c b/usr.bin/modstat/modstat.c index 956acf424bfc..7184223d4844 100644 --- a/usr.bin/modstat/modstat.c +++ b/usr.bin/modstat/modstat.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: modstat.c,v 1.2 1995/04/18 02:19:17 wpaul Exp $ + * $Id: modstat.c,v 1.3 1995/04/20 05:08:53 wpaul Exp $ */ #include @@ -72,8 +72,9 @@ dostat(devfd, modnum, modname) { struct lmc_stat sbuf; + sbuf.name[MAXLKMNAME - 1] = '\0'; /* In case strncpy limits the string. */ if (modname != NULL) - strcpy(sbuf.name, modname); + strncpy(sbuf.name, modname, MAXLKMNAME - 1); sbuf.id = modnum;