Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 May 2016 16:07:16 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        freebsd-arch@FreeBSD.org
Subject:   is ut_user[] in struct utmpx NUL terminated?
Message-ID:  <201605152307.u4FN7Gtg069070@gw.catspoiler.org>

next in thread | raw e-mail | index | archive | help
There is a lot of code that expects ut_user[] to be NUL terminated.
There is also a lot of code that sets ut_user[] using strncmp(), which
will not guarantee NUL termination of this field if the name is
sufficiently long.

This doesn't matter as long as user names are kept short enough, but
there doesn't seem to be any limit enforced by the passwd file format or
getpwent().




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605152307.u4FN7Gtg069070>