diff options
author | DJ Delorie <dj@redhat.com> | 2025-08-07 17:07:53 -0400 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2025-08-29 14:49:19 -0400 |
commit | 6dbaed693a2497e06292ad12b0c7dfea10e087b3 (patch) | |
tree | 76575a615c1c63907c0353126a251f4a6403def8 /sysdeps/i386/fpu/s_fmaxl.S | |
parent | 320cf1e1b59d656ce59478cd052f0e206f8f8bb3 (diff) | |
download | glibc-master.zip glibc-master.tar.gz glibc-master.tar.bz2 |
ut_line[] is not a string, it's a fixed-width character field,
and may not be NUL terminated. Thus, the use of strcmp is incorrect.
strncmp is more appropriate as it stops at the field size.
Note that differences beyond the field size do not count here,
as (1) this test doesn't do that, and (2) such differences are
traditionally ignored (i.e. logins that are silently truncated to
8 characters, etc)
While this is "only a test", we should still demonstrate the
correct way of doing things. Also, using strncmp avoids a
"not a string" warning from gcc if you use -O1 or lower,
where it can't deduce that overflow won't happen.
Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Diffstat (limited to 'sysdeps/i386/fpu/s_fmaxl.S')
0 files changed, 0 insertions, 0 deletions