Tobin C. Harding
458a3bf82d
lib/string: Add strscpy_pad() function
...
We have a function to copy strings safely and we have a function to copy
strings and zero the tail of the destination (if source string is
shorter than destination buffer) but we do not have a function to do
both at once. This means developers must write this themselves if they
desire this functionality. This is a chore, and also leaves us open to
off by one errors unnecessarily.
Add a function that calls strscpy() then memset()s the tail to zero if
the source string is shorter than the destination buffer.
Acked-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Tobin C. Harding <tobin@kernel.org >
Signed-off-by: Shuah Khan <shuah@kernel.org >
2019-04-08 16:44:21 -06:00
..
2019-02-06 09:36:36 -08:00
2019-03-20 16:27:40 +01:00
2019-02-15 16:47:55 +02:00
2019-02-15 17:17:57 +01:00
2019-03-21 12:30:54 +01:00
2019-03-08 10:02:58 -08:00
2019-03-29 12:24:41 -07:00
2019-02-07 11:11:05 +05:30
2019-03-22 16:48:47 +01:00
2019-03-29 10:01:37 -07:00
2019-03-10 14:08:19 -04:00
2019-03-16 13:05:32 -07:00
2018-06-15 18:10:01 -03:00
2019-02-08 06:42:53 -07:00
2019-03-15 11:25:48 -07:00
2016-10-11 15:06:31 -07:00
2019-03-05 21:07:21 -08:00
2018-10-31 08:54:12 -07:00
2019-04-05 16:02:30 -10:00
2019-03-18 10:44:48 -06:00
2019-03-20 14:19:36 -06:00
2019-03-20 14:02:07 -06:00
2019-03-13 12:04:35 -07:00
2019-03-13 12:04:35 -07:00
2019-03-26 11:24:47 -07:00
2017-11-17 16:10:01 -08:00
2017-11-02 11:10:55 +01:00
2019-02-06 10:35:02 -08:00
2017-11-02 11:10:55 +01:00
2019-03-05 21:07:20 -08:00
2019-02-19 13:20:35 +01:00
2017-11-02 11:10:55 +01:00
2018-12-11 11:40:13 +09:00
2019-03-18 07:07:30 +01:00
2019-03-10 12:47:57 -07:00
2018-03-16 19:58:27 +01:00
2017-11-15 11:56:19 -08:00
2012-10-13 10:46:48 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-24 17:33:59 -08:00
2018-12-01 23:13:14 +09:00
2017-11-02 11:10:55 +01:00
2019-03-12 18:59:17 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-28 16:24:22 +02:00
2019-02-28 03:28:53 -05:00
2019-04-06 07:01:55 -10:00
2019-03-12 10:04:02 -07:00
2016-05-28 15:48:31 -04:00
2017-11-02 11:10:55 +01:00
2019-01-29 12:09:11 +01:00
2019-03-12 10:04:00 -07:00
2019-03-29 10:01:37 -07:00
2012-10-13 10:46:48 +01:00
2019-02-04 08:53:56 +01:00
2018-11-07 13:42:32 -07:00
2014-09-23 23:13:13 -07:00
2018-09-18 16:15:33 -05:00
2019-03-21 11:52:37 +01:00
2019-03-28 10:58:28 +01:00
2017-11-02 11:10:55 +01:00
2019-03-12 14:08:19 -07:00
2017-11-02 11:10:55 +01:00
2019-03-16 13:05:32 -07:00
2019-03-29 10:01:37 -07:00
2018-04-12 09:41:19 -07:00
2015-11-25 09:22:02 -07:00
2019-03-12 14:08:19 -07:00
2019-03-12 10:04:02 -07:00
2019-04-05 16:02:31 -10:00
2019-03-11 17:08:14 -07:00
2018-05-14 13:14:23 -06:00
2018-12-28 12:11:51 -08:00
2019-03-27 22:49:06 -07:00
2019-04-05 16:02:31 -10:00
2019-03-12 10:04:01 -07:00
2018-04-05 21:36:27 -07:00
2019-03-10 13:16:37 -07:00
2019-03-09 09:56:17 -08:00
2017-11-15 13:46:33 -08:00
2018-03-24 11:25:35 -05:00
2019-03-15 15:29:47 -07:00
2019-02-08 15:02:49 -08:00
2019-03-29 10:01:37 -07:00
2019-03-15 11:21:25 -07:00
2019-03-25 14:49:00 -07:00
2017-11-02 11:10:55 +01:00
2017-11-09 10:23:28 +01:00
2019-03-10 12:29:52 -07:00
2019-03-12 09:43:00 +01:00
2019-03-12 10:04:03 -07:00
2018-06-28 10:40:47 -07:00
2017-11-02 11:10:55 +01:00
2018-11-09 19:43:51 -08:00
2019-02-17 15:53:01 -08:00
2019-04-04 09:17:15 -04:00
2019-03-13 09:46:10 -04:00
2017-05-03 15:52:09 -07:00
2019-03-22 11:01:02 -06:00
2017-11-02 11:10:55 +01:00
2019-03-12 14:08:19 -07:00
2018-11-27 19:44:21 +01:00
2018-05-17 12:46:54 -04:00
2019-03-11 08:54:01 -07:00
2018-12-20 23:47:09 +01:00
2019-03-29 10:01:37 -07:00
2019-03-15 15:29:47 -07:00
2019-02-09 08:47:52 -08:00
2018-06-14 12:21:18 +09:00
2019-04-08 16:44:21 -06:00
2019-03-14 14:36:20 -07:00
2019-03-10 12:47:57 -07:00
2019-02-11 07:36:13 -05:00
2018-02-05 21:34:50 +01:00
2017-11-02 11:10:55 +01:00
2019-03-16 13:47:14 -07:00
2018-02-06 18:32:47 -08:00
2017-11-02 11:10:55 +01:00
2019-03-07 18:31:59 -08:00
2019-03-23 10:25:12 -07:00
2019-03-28 01:55:18 +09:00
2018-12-28 12:11:51 -08:00
2017-11-02 11:10:55 +01:00
2019-03-06 14:52:48 -08:00