lib/krb5: unparse_name_fixed error if invalid name buffer or length
commit8324a2af1dcd09dd574a2e155bd10458fcbdf8e2
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 20 Jan 2022 14:27:59 +0000 (20 09:27 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 20 Jan 2022 14:27:59 +0000 (20 09:27 -0500)
treeea12cbb7b03ac246e97d123bc0dbf0bb1a3d0d47
parent8836e6a39d6c6e3e77d780ac6c9789e65a7f8649
lib/krb5: unparse_name_fixed error if invalid name buffer or length

If the output 'name' buffer is NULL or length is zero, there is
no place to unparse the principal name to.  Fail with EINVAL and
if possible set an error message on the krb5_context.

This avoids potential NULL pointer dereferences.

Change-Id: Ie38d284f1867be883a2f2e31103ea50cd130a0fe
lib/krb5/principal.c