aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zcp_get.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2019-07-16 14:14:12 -0700
committerGitHub <[email protected]>2019-07-16 14:14:12 -0700
commit3b03ff22761da0f5fad9a781025facfc6e555522 (patch)
tree5146456a348da099635049bf735e00f734087214 /module/zfs/zcp_get.c
parentd45d7f08fa56f94fc9577a6578cb411071a42e8d (diff)
Fix get_special_prop() build failure
The cast of the size_t returned by strlcpy() to a uint64_t by the VERIFY3U can result in a build failure when CONFIG_FORTIFY_SOURCE is set. This is due to the additional hardening. Since the token is expected to always fit in strval the VERIFY3U has been removed. If somehow it doesn't, it will still be safely truncated. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Don Brady <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #8999 Closes #9020
Diffstat (limited to 'module/zfs/zcp_get.c')
-rw-r--r--module/zfs/zcp_get.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/module/zfs/zcp_get.c b/module/zfs/zcp_get.c
index ed98f0d10..0a5f0b824 100644
--- a/module/zfs/zcp_get.c
+++ b/module/zfs/zcp_get.c
@@ -423,13 +423,11 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, const char *dsname,
case ZFS_PROP_RECEIVE_RESUME_TOKEN: {
char *token = get_receive_resume_stats_impl(ds);
- VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN),
- <, ZAP_MAXVALUELEN);
+ (void) strlcpy(strval, token, ZAP_MAXVALUELEN);
if (strcmp(strval, "") == 0) {
char *childval = get_child_receive_stats(ds);
- VERIFY3U(strlcpy(strval, childval, ZAP_MAXVALUELEN),
- <, ZAP_MAXVALUELEN);
+ (void) strlcpy(strval, childval, ZAP_MAXVALUELEN);
if (strcmp(strval, "") == 0)
error = ENOENT;