diff --git a/xrdp/xrdp_newconfig.c b/xrdp/xrdp_newconfig.c index b95368889..7da3a32c5 100644 --- a/xrdp/xrdp_newconfig.c +++ b/xrdp/xrdp_newconfig.c @@ -88,7 +88,8 @@ nc_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, "adopting the default value \"" X264_DEFAULT_PRESET "\"", rdpbcgr_connection_type_names[connection_type]); g_strncpy(param[connection_type].preset, - X264_DEFAULT_PRESET, sizeof(X264_DEFAULT_PRESET) - 1); + X264_DEFAULT_PRESET, + sizeof(param[connection_type].preset) - 1); } /* tune */ @@ -107,7 +108,8 @@ nc_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, "adopting the default value \"" X264_DEFAULT_TUNE "\"", rdpbcgr_connection_type_names[connection_type]); g_strncpy(param[connection_type].tune, - X264_DEFAULT_TUNE, sizeof(X264_DEFAULT_TUNE)); + X264_DEFAULT_TUNE, + sizeof(param[connection_type].tune) - 1); } /* profile */ @@ -126,7 +128,8 @@ nc_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, "adopting the default value \"" X264_DEFAULT_PROFILE "\"", rdpbcgr_connection_type_names[connection_type]); g_strncpy(param[connection_type].profile, - X264_DEFAULT_PROFILE, sizeof(X264_DEFAULT_PROFILE)); + X264_DEFAULT_PROFILE, + sizeof(param[connection_type].profile) - 1); } /* vbv_max_bitrate */