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-03-20 16:27:40 +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-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
2019-03-15 11:25:48 -07:00
2019-03-07 18:32:00 -08: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-08 21:17:07 +01:00
2019-03-13 12:04:35 -07:00
2019-03-26 11:24:47 -07:00
2019-03-07 18:31:59 -08:00
2019-03-07 12:20:11 -08:00
2019-03-07 10:11:41 -08:00
2019-03-07 18:32:01 -08:00
2019-03-18 07:07:30 +01:00
2019-03-10 12:47:57 -07:00
2019-03-07 18:32:00 -08:00
2019-03-10 10:17:23 -07:00
2019-03-12 18:59:17 -07:00
2019-04-06 07:01:55 -10:00
2019-03-12 10:04:02 -07:00
2019-03-12 10:04:00 -07:00
2019-03-29 10:01:37 -07:00
2019-03-09 19:52:47 -08:00
2019-03-21 11:52:37 +01:00
2019-03-08 10:09:53 -08:00
2019-03-28 10:58:28 +01:00
2019-03-07 18:31:59 -08:00
2019-03-12 14:08:19 -07:00
2019-03-16 13:05:32 -07:00
2019-03-07 18:31:59 -08:00
2019-03-29 10:01:37 -07:00
2019-03-12 14:08:19 -07:00
2019-03-07 18:32:03 -08: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
2019-03-27 22:49:06 -07:00
2019-04-05 16:02:31 -10:00
2019-03-12 10:04:01 -07:00
2019-03-10 13:16:37 -07:00
2019-03-09 09:56:17 -08:00
2019-03-15 15:29:47 -07: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
2019-03-10 12:29:52 -07:00
2019-03-07 18:31:59 -08:00
2019-03-08 10:09:53 -08:00
2019-03-12 09:43:00 +01:00
2019-03-07 11:23:17 +01:00
2019-03-12 10:04:03 -07:00
2019-03-09 09:22:42 -08:00
2019-04-04 09:17:15 -04:00
2019-03-07 18:32:03 -08:00
2019-03-13 09:46:10 -04:00
2019-03-22 11:01:02 -06:00
2019-03-07 12:20:11 -08:00
2019-03-12 14:08:19 -07:00
2019-03-11 08:54:01 -07:00
2019-03-29 10:01:37 -07:00
2019-03-15 15:29:47 -07: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-03-16 13:47:14 -07: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
2019-03-07 08:46:07 -08:00