Re: [PATCH] gssd:fix the possible buffer overflow in get_full_hostname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 5/6/25 10:17 AM, 597607025@xxxxxx wrote:
From: zhangyaqi <zhangyaqi@xxxxxxxxxx>

Signed-off-by: zhangyaqi <zhangyaqi@xxxxxxxxxx>
Committed... (tag: nfs-utils-2-8-4-rc1)

steved.
---
  utils/gssd/krb5_util.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 560e8be1..09625fb9 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -619,6 +619,7 @@ get_full_hostname(const char *inhost, char *outhost, int outhostlen)
  		goto out;
  	}
  	strncpy(outhost, addrs->ai_canonname, outhostlen);
+	outhost[outhostlen - 1] = '\0';
  	nfs_freeaddrinfo(addrs);
  	for (c = outhost; *c != '\0'; c++)
  	    *c = tolower(*c);





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux