mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 10:42:45 +00:00
Long command names are not NUL terminated. Force truncation in format string.
This commit is contained in:
parent
f62b59b0d8
commit
5b65033c95
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26853
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: lastcomm.c,v 1.6 1997/02/22 19:55:33 peter Exp $
|
* $Id: lastcomm.c,v 1.7 1997/03/29 04:30:24 imp Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -175,7 +175,8 @@ main(argc, argv)
|
|||||||
if (*argv && !requested(argv, &ab))
|
if (*argv && !requested(argv, &ab))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
(void)printf("%-*s %-7s %-*s %-*s ",
|
(void)printf("%-*.*s %-7s %-*s %-*s ",
|
||||||
|
fldsiz(acct, ac_comm),
|
||||||
fldsiz(acct, ac_comm), ab.ac_comm,
|
fldsiz(acct, ac_comm), ab.ac_comm,
|
||||||
flagbits(ab.ac_flag),
|
flagbits(ab.ac_flag),
|
||||||
UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),
|
UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),
|
||||||
|
Loading…
Reference in New Issue
Block a user