]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1256: bzero is a non-standard function not available on all
authorserassio <>
Fri, 11 Mar 2005 04:49:19 +0000 (04:49 +0000)
committerserassio <>
Fri, 11 Mar 2005 04:49:19 +0000 (04:49 +0000)
platforms

Substitute bzero by memset

TODO
helpers/basic_auth/MSNT/rfcnb-util.c
helpers/basic_auth/MSNT/smbencrypt.c
helpers/basic_auth/MSNT/smblib-util.c
helpers/basic_auth/MSNT/smblib.c
helpers/ntlm_auth/SMB/smbval/rfcnb-util.c
helpers/ntlm_auth/SMB/smbval/smbencrypt.c
helpers/ntlm_auth/SMB/smbval/smblib-util.c
helpers/ntlm_auth/SMB/smbval/smblib.c
src/DiskIO/AIO/AIODiskIOStrategy.cc
src/comm.cc

diff --git a/TODO b/TODO
index d1bda4d0c662b61408e2e5acf07a94db59a5765f..632054eb344734da4c4d0ebd5dc09db519b50c57 100644 (file)
--- a/TODO
+++ b/TODO
@@ -158,7 +158,6 @@ DONE:
 (2) ** we don't properly handle the HTTP/1.1 'Connection' header (KA)
 (2) ** Code cleanup: (KA)
                - Make sure the lib/*.c files do not use printf/fprintf.
-               - Replace bzero with memset
                - Replace bcopy with xmemcpy
 (4) ** FTP PUT (KA)
 (1)    SSL doesn't work with Proxy Authentication
index 9753da86f47720cb3f92d227076b5daa9826e7c8..86ae2d01371714b11d61bb40124c6837089e433e 100644 (file)
@@ -410,7 +410,7 @@ RFCNB_IP_Connect(struct in_addr Dest_IP, int port)
        RFCNB_saved_errno = errno;
        return (RFCNBE_Bad);
     }
-    bzero((char *) &Socket, sizeof(Socket));
+    memset((char *) &Socket, 0, sizeof(Socket));
     memcpy((char *) &Socket.sin_addr, (char *) &Dest_IP, sizeof(Dest_IP));
 
     Socket.sin_port = htons(port);
index 9bd4bd333c85c408513c455ddbbe314c72447b25..0ab8a94123a14d16fb5ce2b94ed75a499163128d 100644 (file)
@@ -158,7 +158,7 @@ nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16)
     E_P16((uchar *) passwd, (uchar *) p16);
 
     /* clear out local copy of user's password (just being paranoid). */
-    bzero(passwd, sizeof(passwd));
+    memset(passwd, 0, sizeof(passwd));
 }
 
 /****************************************************************************
index 298b6b21d065a492c026899bddad6d07c978b846..4dd5967cbdc964b19674121398bfe3d416d4f229 100644 (file)
@@ -146,7 +146,7 @@ SMB_Negotiate(SMB_Handle_Type Con_Handle, const char *Prots[])
     }
     /* Now plug in the bits we need */
 
-    bzero(SMB_Hdr(pkt), SMB_negp_len);
+    memset(SMB_Hdr(pkt), 0, SMB_negp_len);
     SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);      /* Plunk in IDF */
     *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBnegprot;
     SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
@@ -397,7 +397,7 @@ SMB_TreeConnect(SMB_Handle_Type Con_Handle,
 
     /* Now plug in the values ... */
 
-    bzero(SMB_Hdr(pkt), SMB_tcon_len);
+    memset(SMB_Hdr(pkt), 0, SMB_tcon_len);
     SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);      /* Plunk in IDF */
     *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtcon;
     SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
index bba9399cda87b05a45bb6ec7e267bc96f712be22..be82e009e27d514d1676d840b17766de66568c15 100644 (file)
@@ -330,7 +330,7 @@ SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
            return (SMBlibE_BAD);       /* Should handle the error */
 
        }
-       bzero(SMB_Hdr(pkt), SMB_ssetpLM_len);
+       memset(SMB_Hdr(pkt), 0, SMB_ssetpLM_len);
        SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);   /* Plunk in IDF */
        *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX;
        SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
@@ -393,7 +393,7 @@ SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
            return (-1);        /* Should handle the error */
 
        }
-       bzero(SMB_Hdr(pkt), SMB_ssetpNTLM_len);
+       memset(SMB_Hdr(pkt), 0, SMB_ssetpNTLM_len);
        SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);   /* Plunk in IDF */
        *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX;
        SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
index a293dab9dd401292f8923f2765338c985e73a9ef..887775ed3ee0ec24e97b086b4b78032554649758 100644 (file)
@@ -385,7 +385,7 @@ RFCNB_IP_Connect(struct in_addr Dest_IP, int port)
        RFCNB_saved_errno = errno;
        return (RFCNBE_Bad);
     }
-    bzero((char *) &Socket, sizeof(Socket));
+    memset((char *) &Socket, 0, sizeof(Socket));
     memcpy((char *) &Socket.sin_addr, (char *) &Dest_IP, sizeof(Dest_IP));
 
     Socket.sin_port = htons(port);
index 0145b9893a6d978aeee4d0fc2808bab334478582..3aff3cbf1faf315fdf84a956f37ff52ac0695ea0 100644 (file)
@@ -149,7 +149,7 @@ nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16)
     E_P16((uchar *) passwd, (uchar *) p16);
 
     /* clear out local copy of user's password (just being paranoid). */
-    bzero(passwd, sizeof(passwd));
+    memset(passwd, 0, sizeof(passwd));
 }
 
 /****************************************************************************
index 5c5ea7f8c7474ee2c7431135f77d880c9655bc84..e1ae2b1c248358c48a116b73ff294600d89194e1 100644 (file)
@@ -270,7 +270,7 @@ SMB_Negotiate(SMB_Handle_Type Con_Handle, char *Prots[])
     }
     /* Now plug in the bits we need */
 
-    bzero(SMB_Hdr(pkt), SMB_negp_len);
+    memset(SMB_Hdr(pkt), 0, SMB_negp_len);
     SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);      /* Plunk in IDF */
     *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBnegprot;
     SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
@@ -521,7 +521,7 @@ SMB_TreeConnect(SMB_Handle_Type Con_Handle,
 
     /* Now plug in the values ... */
 
-    bzero(SMB_Hdr(pkt), SMB_tcon_len);
+    memset(SMB_Hdr(pkt), 0, SMB_tcon_len);
     SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);      /* Plunk in IDF */
     *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtcon;
     SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
@@ -638,7 +638,7 @@ SMB_TreeDisconnect(SMB_Tree_Handle Tree_Handle, BOOL discard)
     }
     /* Now plug in the values ... */
 
-    bzero(SMB_Hdr(pkt), SMB_tdis_len);
+    memset(SMB_Hdr(pkt), 0, SMB_tdis_len);
     SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);      /* Plunk in IDF */
     *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtdis;
     SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Tree_Handle->con->pid);
index 0e71e5db97d263e5e2cce1e7104588b09c8eb2ab..d22a01e5f01db18a88451ebcd54eeb0548fb9247 100644 (file)
@@ -375,7 +375,7 @@ SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
            fprintf(stderr, "SMB_Logon_server: Couldn't allocate packet\n");
            return (SMBlibE_BAD);       /* Should handle the error */
        }
-       bzero(SMB_Hdr(pkt), SMB_ssetpLM_len);
+       memset(SMB_Hdr(pkt), 0, SMB_ssetpLM_len);
        SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);   /* Plunk in IDF */
        *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX;
        SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
@@ -438,7 +438,7 @@ SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
            fprintf(stderr, "SMB_Logon_server: Couldn't allocate packet\n");
            return (-1);        /* Should handle the error */
        }
-       bzero(SMB_Hdr(pkt), SMB_ssetpNTLM_len);
+       memset(SMB_Hdr(pkt), 0, SMB_ssetpNTLM_len);
        SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF);   /* Plunk in IDF */
        *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX;
        SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle->pid);
index 8fd4c38f7dfdbea8319f6d45852f384c5e657e0f..c9d37ff1b926ee2abb71609f56cb31c489d94d16 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: AIODiskIOStrategy.cc,v 1.1 2004/12/20 16:30:38 robertc Exp $
+ * $Id: AIODiskIOStrategy.cc,v 1.2 2005/03/10 21:49:20 serassio Exp $
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -160,7 +160,7 @@ AIODiskIOStrategy::callback()
                 }
 
                 /* Free slot */
-                bzero(aqe, sizeof(async_queue_entry_t));
+                memset(aqe, 0, sizeof(async_queue_entry_t));
 
                 aqe->aq_e_state = AQ_ENTRY_FREE;
 
index 842d2069eaf92bb136c5459ac44c14c508c818ba..cc100a0c44fa11c221936c1585dd41c9520016f9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.400 2005/02/13 15:49:50 serassio Exp $
+ * $Id: comm.cc,v 1.401 2005/03/10 21:49:19 serassio Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -2679,6 +2679,6 @@ DeferredRead::markCancelled() {
 }
 
 ConnectionDetail::ConnectionDetail() {
-    bzero(&me, sizeof(me));
-    bzero(&peer, sizeof(peer));
+    memset(&me, 0, sizeof(me));
+    memset(&peer, 0, sizeof(peer));
 }