is ut_user[] in struct utmpx NUL terminated?

Ed Schouten ed at nuxi.nl
Wed May 25 21:26:04 UTC 2016


Hi Don,

2016-05-25 23:14 GMT+02:00 Don Lewis <truckman at freebsd.org>:
> Going in the other direction, getutxent()
> calls futx_to_utx(), which uses the FTOU_STRING() macro, which in turn
> uses strncpy() to copy the data back out.

Keep in mind that strcpy() is called with a size that is at most one
less than sizeof(ut->ut_user). The final byte in the array is never
overwritten.

-- 
Ed Schouten <ed at nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717


More information about the freebsd-arch mailing list