kgssapi(4): Fix string overrun in Kerberos principal construction

'buf.value' was previously treated as a nul-terminated string, but only
allocated with strlen() space.  Rectify this.

Reported by:	Coverity
CID:		1007639
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Conrad Meyer 2016-04-20 04:45:23 +00:00
parent 1a7dfcc5a3
commit e3081f7e3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298336

View File

@ -331,7 +331,7 @@ rpc_gss_get_principal_name(rpc_gss_principal_t *principal,
* Construct a gss_buffer containing the full name formatted
* as "name/node@domain" where node and domain are optional.
*/
namelen = strlen(name);
namelen = strlen(name) + 1;
if (node) {
namelen += strlen(node) + 1;
}