From 0a0f652fbdbf3814135e5809e59d5450d014ebe0 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 16 Mar 2006 22:35:54 +0000
Subject: [PATCH] Fixed use of uninitialized values reported by valgrind.

---
 src/sbbs3/getmail.c |  3 ++-
 src/sbbs3/main.cpp  | 15 +++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/sbbs3/getmail.c b/src/sbbs3/getmail.c
index 84bf079d6d..7579bc4625 100644
--- a/src/sbbs3/getmail.c
+++ b/src/sbbs3/getmail.c
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -50,6 +50,7 @@ int DLLCALL getmail(scfg_t* cfg, int usernumber, BOOL sent)
     idxrec_t idx;
 	smb_t	smb;
 
+	ZERO_VAR(smb);
 	sprintf(smb.file,"%smail",cfg->data_dir);
 	smb.retry_time=cfg->smb_retry_time;
 	sprintf(str,"%s.sid",smb.file);
diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index a0d46c7438..9eabe1bd4e 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -2372,6 +2372,7 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
 	nodefile_fp=NULL;
 	node_ext_fp=NULL;
 	current_msg=NULL;
+	mnestr=NULL;
 
 #ifdef JAVASCRIPT
 	js_runtime=NULL;	/* runtime */
@@ -2381,13 +2382,15 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
 	for(i=0;i<TOTAL_TEXT;i++)
 		text[i]=text_sav[i]=global_text[i];
 
-	memset(&main_csi,0,sizeof(main_csi));
-	memset(&thisnode,0,sizeof(thisnode));
-	memset(&useron,0,sizeof(useron));
-	memset(&inbuf,0,sizeof(inbuf));
-	memset(&outbuf,0,sizeof(outbuf));
-	memset(&smb,0,sizeof(smb));
+	ZERO_VAR(main_csi);
+	ZERO_VAR(thisnode);
+	ZERO_VAR(useron);
+	ZERO_VAR(inbuf);
+	ZERO_VAR(outbuf);
+	ZERO_VAR(smb);
+	ZERO_VAR(nodesync_user);
 
+	action=NODE_MAIN;
 	global_str_vars=0;
 	global_str_var=NULL;
 	global_str_var_name=NULL;
-- 
GitLab