smbd: Use strlcpy instead of StrnCpy
authorVolker Lendecke <vl@samba.org>
Mon, 31 Dec 2018 06:15:21 +0000 (07:15 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 8 Jan 2019 02:40:26 +0000 (03:40 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/lanman.c

index dcc7f91..9637194 100644 (file)
@@ -364,7 +364,7 @@ static int package(struct pack_desc *p, ...)
                        {
                                char *s = va_arg(args,char*);
                                if (p->buflen >= needed) {
-                                       StrnCpy(p->structbuf,s?s:"",needed-1);
+                                       strlcpy(p->structbuf,s?s:"",needed);
                                }
                        }
                        break;