Iker Pedrosa
5d0d784197
Fix covscan BUFFER_SIZE
Error: BUFFER_SIZE (CWE-170): [#def6]
shadow-4.8.1/libmisc/failure.c:101: buffer_size_warning: Calling "strncpy" with a maximum size argument of 12 bytes on destination array "fl->fail_line" of size 12 bytes might leave the destination string unterminated.
99| }
100|
101|-> strncpy (fl->fail_line, tty, sizeof fl->fail_line);
102| (void) time (&fl->fail_time);
103|
Error: BUFFER_SIZE (CWE-170): [#def9]
shadow-4.8.1/libmisc/log.c:103: buffer_size_warning: Calling "strncpy" with a maximum size argument of 32 bytes on destination array "newlog.ll_line" of size 32 bytes might leave the destination string unterminated.
101| (void) time (&ll_time);
102| newlog.ll_time = ll_time;
103|-> strncpy (newlog.ll_line, line, sizeof newlog.ll_line);
104| #if HAVE_LL_HOST
105| strncpy (newlog.ll_host, host, sizeof newlog.ll_host);
Error: BUFFER_SIZE (CWE-170): [#def10]
shadow-4.8.1/libmisc/log.c:105: buffer_size_warning: Calling "strncpy" with a maximum size argument of 256 bytes on destination array "newlog.ll_host" of size 256 bytes might leave the destination string unterminated.
103| strncpy (newlog.ll_line, line, sizeof newlog.ll_line);
104| #if HAVE_LL_HOST
105|-> strncpy (newlog.ll_host, host, sizeof newlog.ll_host);
106| #endif
107| if ( (lseek (fd, offset, SEEK_SET) != offset)
Error: BUFFER_SIZE (CWE-170): [#def13]
shadow-4.8.1/libmisc/utmp.c:260: buffer_size_warning: Calling "strncpy" with a maximum size argument of 32 bytes on destination array "utent->ut_line" of size 32 bytes might leave the destination string unterminated.
258| #endif /* HAVE_STRUCT_UTMP_UT_TYPE */
259| utent->ut_pid = getpid ();
260|-> strncpy (utent->ut_line, line, sizeof (utent->ut_line));
261| #ifdef HAVE_STRUCT_UTMP_UT_ID
262| if (NULL != ut) {
Error: BUFFER_SIZE (CWE-170): [#def14]
shadow-4.8.1/libmisc/utmp.c:266: buffer_size_warning: Calling "strncpy" with a maximum size argument of 4 bytes on destination array "utent->ut_id" of size 4 bytes might leave the destination string unterminated.
264| } else {
265| /* XXX - assumes /dev/tty?? */
266|-> strncpy (utent->ut_id, line + 3, sizeof (utent->ut_id));
267| }
268| #endif /* HAVE_STRUCT_UTMP_UT_ID */
Error: BUFFER_SIZE (CWE-170): [#def15]
shadow-4.8.1/libmisc/utmp.c:273: buffer_size_warning: Calling "strncpy" with a maximum size argument of 32 bytes on destination array "utent->ut_user" of size 32 bytes might leave the destination string unterminated.
271| #endif /* HAVE_STRUCT_UTMP_UT_NAME */
272| #ifdef HAVE_STRUCT_UTMP_UT_USER
273|-> strncpy (utent->ut_user, name, sizeof (utent->ut_user));
274| #endif /* HAVE_STRUCT_UTMP_UT_USER */
275| if (NULL != hostname) {
Error: BUFFER_SIZE (CWE-170): [#def16]
shadow-4.8.1/libmisc/utmp.c:278: buffer_size_warning: Calling "strncpy" with a maximum size argument of 256 bytes on destination array "utent->ut_host" of size 256 bytes might leave the destination string unterminated.
276| struct addrinfo *info = NULL;
277| #ifdef HAVE_STRUCT_UTMP_UT_HOST
278|-> strncpy (utent->ut_host, hostname, sizeof (utent->ut_host));
279| #endif /* HAVE_STRUCT_UTMP_UT_HOST */
280| #ifdef HAVE_STRUCT_UTMP_UT_SYSLEN
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2021-06-16 09:50:53 +02:00
..
2007-10-07 14:36:51 +00:00
2021-05-15 12:38:55 -05:00
2009-04-23 17:33:21 +00:00
2021-05-15 12:38:55 -05:00
2011-09-18 21:02:43 +00:00
2020-01-12 07:31:26 -06:00
2019-10-04 18:40:41 -05:00
2008-05-25 23:31:10 +00:00
2011-08-14 14:00:14 +00:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2011-10-18 20:23:33 +00:00
2018-10-10 12:22:04 +02:00
2021-05-15 12:38:55 -05:00
2008-04-27 00:40:09 +00:00
2021-05-15 12:38:55 -05:00
2021-06-16 09:50:53 +02:00
2017-10-22 18:33:13 +00:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2010-08-22 19:13:53 +00:00
2017-10-22 19:17:02 +00:00
2011-08-14 13:16:26 +00:00
2009-03-08 20:26:56 +00:00
2021-05-15 12:38:55 -05:00
2010-08-22 19:13:53 +00:00
2021-05-15 12:38:55 -05:00
2021-04-16 21:02:37 -05:00
2011-06-16 21:25:36 +00:00
2021-05-15 12:38:55 -05:00
2010-08-21 15:32:53 +00:00
2021-06-16 09:50:53 +02:00
2011-09-18 20:41:38 +00:00
2009-04-27 20:09:18 +00:00
2021-04-11 17:42:04 -05:00
2010-08-21 15:32:53 +00:00
2009-04-26 17:10:49 +00:00
2021-02-01 22:11:10 +01:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2021-06-01 22:12:24 -05:00
2019-03-31 16:00:01 +01:00
2008-04-27 00:40:09 +00:00
2021-05-15 12:38:55 -05:00
2010-09-05 15:34:42 +00:00
2009-04-30 21:08:49 +00:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2010-08-22 13:04:54 +00:00
2021-05-15 12:38:55 -05:00
2010-08-22 19:13:53 +00:00
2017-10-22 18:33:13 +00:00
2013-08-04 15:56:32 +02:00
2010-08-22 13:04:54 +00:00
2010-08-22 19:13:53 +00:00
2010-08-22 13:04:54 +00:00
2008-06-15 21:59:41 +00:00
2021-05-15 12:38:55 -05:00
2021-06-16 09:50:53 +02:00
2013-07-28 18:41:11 +02:00
2009-06-11 21:33:00 +00:00
2009-06-11 21:33:00 +00:00
2009-06-11 21:33:00 +00:00
2009-06-11 21:33:00 +00:00
2009-06-11 21:33:00 +00:00
2021-05-15 12:38:55 -05:00
2021-05-15 12:38:55 -05:00
2009-04-23 11:14:56 +00:00