From d8d2d5e75503ae2b6532a25e4c9bbcdf20cc60af Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 6 Mar 2003 08:24:39 +0000 Subject: [PATCH] more off-by-one safe_strcpy() --- source/smbd/negprot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/smbd/negprot.c b/source/smbd/negprot.c index c8f023514e6..db0694a8404 100644 --- a/source/smbd/negprot.c +++ b/source/smbd/negprot.c @@ -167,7 +167,7 @@ static int reply_lanman2(char *inbuf, char *outbuf) static int negprot_spnego(char *p) { DATA_BLOB blob; - uint8 guid[16]; + uint8 guid[17]; const char *OIDs_krb5[] = {OID_KERBEROS5, OID_KERBEROS5_OLD, OID_NTLMSSP, @@ -178,8 +178,8 @@ static int negprot_spnego(char *p) global_spnego_negotiated = True; - memset(guid, 0, 16); - safe_strcpy((char *)guid, global_myname(), 16); + ZERO_STRUCT(guid); + safe_strcpy((char *)guid, global_myname(), sizeof(guid)-1); strlower((char *)guid); #if 0