From d78ad1fc906d1e03b8232e4c9aab831899c26b31 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 27 Dec 2013 11:38:10 -0500 Subject: Add zero termination when the buffer is a string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This shouldn't be needed but apaprently there are a number of applications like mod_auth_kerb that just blindly assume the out buffer returned by gss_diplay_name() is a zero terminated string even though there is no guarantee it is in the API. To avoid annoying misbehavior we forcibly zero terminate strings copied and returned by the interposer. Fixes: https://fedorahosted.org/gss-proxy/ticket/101 Signed-off-by: Simo Sorce Reviewed-by: Günther Deschner --- proxy/src/client/gpm_import_and_canon_name.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'proxy/src/client/gpm_import_and_canon_name.c') diff --git a/proxy/src/client/gpm_import_and_canon_name.c b/proxy/src/client/gpm_import_and_canon_name.c index 68dc6ce..8e1204b 100644 --- a/proxy/src/client/gpm_import_and_canon_name.c +++ b/proxy/src/client/gpm_import_and_canon_name.c @@ -71,7 +71,8 @@ OM_uint32 gpm_display_name(OM_uint32 *minor_status, output_name->name_type.octet_string_val = NULL; } - ret = gp_copy_gssx_to_buffer(&in_name->display_name, output_name_buffer); + ret = gp_copy_gssx_to_string_buffer(&in_name->display_name, + output_name_buffer); if (ret) { ret_min = ret; ret_maj = GSS_S_FAILURE; -- cgit