Skip to content

Commit

Permalink
newconfig: use correct destination size for strncpy
Browse files Browse the repository at this point in the history
  • Loading branch information
metalefty committed Aug 20, 2024
1 parent d194449 commit 21ab5d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xrdp/xrdp_newconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand All @@ -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 */
Expand Down

0 comments on commit 21ab5d9

Please sign in to comment.