Mike Borozdin has uploaded this change for review.
Fix buffer overflow risk in gss_credcache
In find_keytab_entry, replace strcpy with bounds-checked strlcpy when
building myhostad, capping the copy size to sizeof(myhostad) - 1 so there
is always room to safely append '$' and the NUL terminator.
Additionally, explicitly NUL-terminate myhostname after gsh_gethostname()
in case gethostname() truncated the output, and cast to (unsigned char)
for toupper() to avoid undefined behavior.
Change-Id: I67ca60649de32957cb5f6c5b9d13c32d2b852c0d
Signed-off-by: Mike Borozdin <nolongemails@gmail.com>
---
M src/RPCAL/gss_credcache.c
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/36/1247036/1
To view, visit change 1247036. To unsubscribe, or for help writing mail filters, visit settings.