]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - lib/smblib/smblib-util.c
Source Format Enforcement (#532)
[thirdparty/squid.git] / lib / smblib / smblib-util.c
index 99c54ae833ece6c2ef3f86284f2f9c25c158b6d7..1dd5ef8bd3e90a22908ed614dd1d87c078f4ed5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -401,7 +401,7 @@ int SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[])
 
         p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset + Con_Handle -> Encrypt_Key_Len);
 
-        strncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom) - 1);
+        xstrncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom));
 
         break;
 
@@ -424,7 +424,7 @@ int SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[])
 
         p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset + Con_Handle -> Encrypt_Key_Len);
 
-        strncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom) - 1);
+        xstrncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom));
 
         break;
 
@@ -538,8 +538,8 @@ SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type Con_Handle,
 
     tree -> next = tree -> prev = NULL;
     tree -> con = Con_Handle;
-    strncpy(tree -> path, path, sizeof(tree -> path));
-    strncpy(tree -> device_type, device, sizeof(tree -> device_type));
+    xstrncpy(tree -> path, path, sizeof(tree -> path));
+    xstrncpy(tree -> device_type, device, sizeof(tree -> device_type));
 
     /* Now plug in the values ... */