1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-20 16:22:38 -05:00

Fix CID114556: Copy into fixed size buffer.

This commit is contained in:
Renaud 2015-10-05 17:44:05 +08:00
parent 4feb70b484
commit e5e2ca0636

View File

@ -254,7 +254,9 @@ ask:
bp = bp->b_bufp ; /* onward */
}
strcpy( curbp->b_bname, bufn) ; /* copy buffer name to structure */
/* copy buffer name to structure */
strncpy( curbp->b_bname, bufn, sizeof( bname_t) - 1) ;
curbp->b_bname[ sizeof( bname_t) - 1] = '\0' ;
free( bufn) ;
curwp->w_flag |= WFMODE ; /* make mode line replot */