1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtmail: resolve coverity warnings related to uninitialised members in C++ classes

This commit is contained in:
Peter Howkins 2018-04-20 02:36:24 +01:00
parent 3464e80165
commit f905d25392
31 changed files with 199 additions and 2 deletions

View file

@ -149,6 +149,10 @@ Application::Application ( char *appClassName ) :
_numWindows = 0;
_shutdownEnabled = 1;
_applicationClass = strdup ( appClassName );
_appWorkspaceList = NULL;
_lastInteractiveEventTime = 0;
_originalEgid = 0;
_originalRgid = 0;
}
void Application::initialize ( int *argcp, char **argv )

View file

@ -69,7 +69,9 @@
#define PIXMAPSIZE 50
BusyPixmap::BusyPixmap ( Widget w ) :
PixmapCycler ( NUMPIXMAPS, PIXMAPSIZE, PIXMAPSIZE )
PixmapCycler ( NUMPIXMAPS, PIXMAPSIZE, PIXMAPSIZE ),
_gc(NULL),
_inverseGC(NULL)
{
_w = w;
}

View file

@ -82,6 +82,7 @@ Cmd::Cmd ( char *name, char *label, int active )
_activationList = NULL;
_deactivationList = NULL;
_hasUndo = TRUE;
_previouslyActive = 0;
if (label) {
_label = strdup(label);

View file

@ -82,6 +82,7 @@ CmdList::CmdList(char *name, char *label ) : Cmd(name, label, 1)
_contents = 0;
_numElements = 0;
_pane = NULL;
}
CmdList::~CmdList()

View file

@ -107,6 +107,10 @@ MainWindow::MainWindow( char *name, Boolean allowResize ) : UIComponent ( name )
_window_invert = NULL;
_icon = 0;
_allow_resize = allowResize;
_last_state = 0;
_flash_owin = 0;
_flash_iwin = 0;
memset(&_window_attributes, 0, sizeof(XWindowAttributes));
assert ( theApplication != NULL ); // Application object must exist
// before any MainWindow object

View file

@ -108,6 +108,8 @@ SelectFileCmd::SelectFileCmd (const char * name,
_cancel_clientData = NULL;
_fileBrowser = NULL;
_parentWidget = parent;
_hidden_button = NULL;
_directory = NULL;
}
SelectFileCmd::SelectFileCmd (const char * name,
@ -130,6 +132,8 @@ SelectFileCmd::SelectFileCmd (const char * name,
_cancel_clientData = cancel_clientData;
_fileBrowser = NULL;
_parentWidget = parent;
_hidden_button = NULL;
_directory = NULL;
}
SelectFileCmd::~SelectFileCmd()

View file

@ -162,6 +162,34 @@ AttachArea::AttachArea (
_attach_area_selection_state = AA_SEL_NONE;
_cache_single_attachment = NULL;
_no_selected_label = NULL;
_selected_label = NULL;
rowOfAttachmentsStatus = NULL;
_attachments_status = NULL;
_attachments_summary = NULL;
_mailbox = NULL;
_attachAreaWidth = 0;
_attachAreaHeight = 0;
_rc = NULL;
_sw = NULL;
_vsb = NULL;
_message = NULL;
_clipWindow = NULL;
_open = NULL;
_saveas = NULL;
_selectall = NULL;
_unselectall = NULL;
_menuBar = NULL;
_background = 0;
_foreground = 0;
_appBackground = 0;
_appForeground = 0;
_fileCmdList = NULL;
_editCmdList = NULL;
_size_selected_label = NULL;
_format_button = NULL;
}
void

View file

@ -183,6 +183,24 @@ Attachment::Attachment(
_label = XmStringCreateLocalized(strrchr(name, '/')+1);
_key = theRoamApp.session()->session()->newObjectKey();
myIcon = NULL;
_background = 0;
_foreground = 0;
_attachmentWidth = 0;
_attachmentHeight = 0;
_positionX = 0;
_positionY = 0;
_deleted = false;
_selected = false;
_row = 0;
_saveAsFilename = NULL;
_ce_name = NULL;
_ce_type = NULL;
_type = 0;
_binary = false;
_executable = false;
}
Attachment::~Attachment(

View file

@ -337,6 +337,7 @@ ComposeCmd::ComposeCmd(
RoamMenuWindow *window
) : ComposeFamily( name, label, active, window )
{
_parent = NULL;
}
// Put up a blank compose window.
@ -367,6 +368,7 @@ ForwardCmd::ForwardCmd(
) : ComposeFamily(name, label, active, window)
{
_forward = forward;
_parent = NULL;
}
// Forward or Include selected messages.
@ -439,6 +441,7 @@ ReplyCmd::ReplyCmd (
) : ComposeFamily ( name, label, active, window )
{
_include = include;
_parent = NULL;
}
// For each message selected, reply to sender.
@ -574,6 +577,7 @@ ReplyAllCmd::ReplyAllCmd(
) : ComposeFamily( name, label, active, window )
{
_include = include;
_parent = NULL;
}
// For each message selected, reply to everybody.

View file

@ -82,6 +82,7 @@ DmxMailbox::DmxMailbox (char *filename)
_mbox = NULL;
_messageCount = 0;
_fileName = strdup_n(filename);
_message = NULL;
}
DmxMailbox::~DmxMailbox (void)

View file

@ -217,6 +217,7 @@ DmxPrintOptions::DmxPrintOptions (
_propui_array = new DtVirtArray<PropUiItem *>(10);
_propui_array_iterator = 0;
_parent = parent;
_prop_source = NULL;
//
// Create form to hold the printing options

View file

@ -107,6 +107,7 @@ DtMailEditor::DtMailEditor(
_dragX = -1;
_dragY = -1;
_editable = FALSE;
_container = NULL;
}

View file

@ -88,6 +88,7 @@ DtMailGenDialog::DtMailGenDialog(char *name, Widget parent, int style)
_textField = (Widget) NULL;
_maxTextlen = 0;
_clearText = NULL;
_shroudText = 0;
_parentshell = parent;
while (_parentshell && !XtIsShell(_parentshell))

View file

@ -133,6 +133,7 @@ FindDialog::FindDialog(RoamMenuWindow *parent) : Dialog("find", parent)
_roamWindow = parent;
_num_text_fields = 4;
_num_buttons = 5;
_status_text = NULL;
//
// Allocate storage for labels, widgets, and data.

View file

@ -96,6 +96,9 @@ IndexedOptionMenu::IndexedOptionMenu (
Widget menu;
XmString xms;
_strings = NULL;
_data = NULL;
_nmenu_items = nmenu_items;
if (nmenu_items && strings != NULL)
{

View file

@ -130,6 +130,33 @@ MailRetrievalOptions::MailRetrievalOptions (
XmString xms;
char *propkey = new char[MAXPATHLEN];
_password_pui = NULL;
_inboxpath_label = NULL;
_inboxpath_tf = NULL;
_checkfornewmail_label = NULL;
_checkfornewmail_sb = NULL;
_system_tb = NULL;
_server_frame = NULL;
_server_tb = NULL;
_serverframe_form = NULL;
_serverprotocol_label = NULL;
_serverprotocol_iom = NULL;
_servername_label = NULL;
_servername_tf = NULL;
_username_label = NULL;
_username_tf = NULL;
_password_label = NULL;
_password_tf = NULL;
_rememberpassword_tb = NULL;
_removeafterdelivery_tb = NULL;
_retrieveold_tb = NULL;
_custom_frame = NULL;
_custom_tb = NULL;
_customframe_form = NULL;
_customcommand_label = NULL;
_customcommand_tf = NULL;
_propui_array = new DtVirtArray<PropUiItem *>(10);
_propui_array_iterator = 0;
_parent = parent;

View file

@ -33,7 +33,7 @@ extern "C" {
class MsgStruct {
public:
MsgStruct() {};
MsgStruct() : indexNumber(0), sessionNumber(0), message_handle(NULL), is_deleted(false) {};
~MsgStruct() {};
int indexNumber;

View file

@ -147,6 +147,21 @@ OptCmd::OptCmd ( char *name, char *label, int active, Widget parent) :
catstr = NULL;
CurrentPane = NULL;
mh_pane_list = NULL;
msg_view_pane_list = NULL;
compose_pane_list = NULL;
msg_filing_pane_list = NULL;
vacation_pane_list = NULL;
template_pane_list = NULL;
aliases_pane_list = NULL;
advanced_pane_list = NULL;
mailretrieval_pane_list = NULL;
vaca_sub = NULL;
vaca_msg = NULL;
generalDialog = NULL;
_PrintingOptions = NULL;
_MailRetrievalOptions = NULL;
}
void

View file

@ -55,6 +55,8 @@ PasswordDialogManager::PasswordDialogManager ( char *name ) :
{
// Empty
_pwd[0] = 0;
_user = NULL;
_password = NULL;
}
Widget PasswordDialogManager::createDialog ( Widget parent )

View file

@ -1516,6 +1516,33 @@ RoamApp::RoamApp(char *name) : Application (name), _activePrintDisplays(5)
{
DebugPrintf(2, "RoamApp::RoamApp(%p \"%s\")\n", name, name);
theRoamApp = *this;
_busy_count = 0;
_dialog = NULL;
_errorPrintDisplay = NULL;
_firstSaveYourselfArrived = false;
_options = NULL;
_optionsHandle = NULL;
_mailview = NULL;
_quitSilently = false;
_quitQuickly = false;
_vacation = NULL;
session_fp = NULL;
_shutdownWorkprocID = 0;
_appTimeoutId = 0;
_default_mailbox = NULL;
_glyph_font = NULL;
_glyph_name = NULL;
_mailfiles_folder = NULL;
_mail_session = NULL;
_mail_transport = NULL;
_print_script = NULL;
_system_font = NULL;
_system_fontlist = NULL;
_tt_fd = 0;
_user_font = NULL;
_user_fontlist = NULL;
_default_x_error_handler = NULL;
}
// Let the destructor of parent Application class handle the

View file

@ -318,6 +318,8 @@ OpenContainerCmd::OpenContainerCmd (
) : RoamInterruptibleCmd (name, label, active)
{
_menuWindow = window;
_open_create_flag = DTM_FALSE;
_open_lock_flag = DTM_FALSE;
}
// Parent's execute() ends up calling derived class's doit()
@ -423,6 +425,10 @@ ConvertContainerCmd::ConvertContainerCmd(
_num_converted = 0;
_num_to_be_converted = 0;
_dialog = NULL;
_criteria = NULL;
_conv_cb = NULL;
_src = NULL;
_dest = NULL;
}
void
@ -615,6 +621,7 @@ ChooseCmd::ChooseCmd(
) : NoUndoCmd( name, label, active )
{
_menuwindow = window;
_msgno = NULL;
}
void
@ -655,6 +662,7 @@ DeleteCmd::DeleteCmd(
) : Cmd ( name, label, active )
{
_menuwindow = window;
_msgno = NULL;
}
void
@ -892,6 +900,8 @@ UnifiedSelectMailboxCmd::UnifiedSelectMailboxCmd (
this,
parent)
{
_only_show_mailboxes = DTM_FALSE;
if (! _is_initialized)
{
FORCE_SEGV_DECL(DtMail::Session, m_session);
@ -1393,6 +1403,8 @@ UndeleteCmd::UndeleteCmd (
_menuwindow = window;
_undelFromList = NULL;
_fromList = viaDeleteList;
_clientData = NULL;
_num_deleted = 0;
}
UndeleteCmd::~UndeleteCmd()
@ -1496,6 +1508,9 @@ MoveCopyCmd::MoveCopyCmd( char *name,
_menuwindow = menu_window;
_copy_button = NULL;
_move_button = NULL;
_file_list = NULL;
_file_text = NULL;
_default_button = NULL;
}
MoveCopyCmd::~MoveCopyCmd()
@ -2240,6 +2255,7 @@ SaveAttachCmd::SaveAttachCmd ( char *name,
parent)
{
_parent = clientData;
_name = NULL;
}
SaveAttachCmd::SaveAttachCmd (
@ -2261,6 +2277,7 @@ SaveAttachCmd::SaveAttachCmd (
parent )
{
_parent = clientData;
_name = NULL;
}
SaveAttachCmd::SaveAttachCmd (
@ -2282,6 +2299,7 @@ SaveAttachCmd::SaveAttachCmd (
parent )
{
_parent = clientData;
_name = NULL;
}
void
@ -3240,6 +3258,7 @@ OtherAliasesCmd::OtherAliasesCmd(
int active)
: NoUndoCmd (name, label, active)
{
_header = NULL;
}
void

View file

@ -158,6 +158,7 @@ SendMsgDialog::HeaderList::HeaderList(const HeaderList & other)
{
label = NULL;
header = NULL;
value = NULL;
show = other.show;
form_widget = other.form_widget;
label_widget = other.label_widget;

View file

@ -236,6 +236,13 @@ UndelFromListDialog::UndelFromListDialog (
{
assert (theApplication != NULL);
_list = NULL;
_undelete_button = NULL;
_close_button = NULL;
_undel_list_button = NULL;
rowOfLabels = NULL;
rowOfButtons = NULL;
rowOfMessageStatus = NULL;
my_owner = NULL;
}
UndelFromListDialog::~UndelFromListDialog()

View file

@ -98,6 +98,16 @@ DialogShell ("DtMail_SecWin", parent, wc)
_attachmentPopupMenuList = NULL;
_textPopupMenuList = NULL;
_main = NULL;
_overview = NULL;
_tasks = NULL;
_reference = NULL;
_on_item = NULL;
_using_help = NULL;
_about_mailer = NULL;
_text = NULL;
_msgno = NULL;
assert( theApplication != NULL );
}

View file

@ -69,6 +69,10 @@ DmxMsg::DmxMsg (void)
isCurrent = B_FALSE;
hasAttachments = B_FALSE;
isNew = B_FALSE;
msgHandle = NULL;
msgHeader.header_values = NULL;
msgHeader.number_of_names = 0;
bodyParts = NULL;
return;
}

View file

@ -397,6 +397,7 @@ DtMailEnv::DtMailEnv()
_client = NULL;
_implClearFunc = NULL;
_fatal = DTM_FALSE;
_error_minor_code = DTME_NoError;
}
#ifdef hpV4

View file

@ -68,6 +68,8 @@ DtMail::MailBox::MailBox(DtMailEnv & error,
_callback = cb;
_cb_data = clientData;
_obj_mutex = MutexInit();
_mail_box_writable = DTM_FALSE;
_default_mode = 0;
}
DtMail::MailBox::~MailBox(void)

View file

@ -246,8 +246,11 @@ Condition::Condition(void)
#if defined(POSIX_THREADS)
_condition = malloc(sizeof(cond_t));
cond_init((cond_t *)_condition, USYNC_THREAD, NULL);
#else
_condition = NULL;
#endif
_state = 0;
}
Condition::~Condition(void)

View file

@ -53,6 +53,7 @@ RFCFormat::RFCFormat(DtMail::Session * session)
{
_session = session;
_is_write_bcc = DTM_FALSE;
_use_cr = DTM_FALSE;
}
RFCFormat::~RFCFormat(void)

View file

@ -71,6 +71,7 @@ RFCValue::RFCValue(const char * str, int size) : DtMailValue(NULL)
_value[size] = 0;
_decoded = NULL;
_session = NULL;
}
RFCValue::RFCValue(const char * str, int size, DtMail::Session *s) : DtMailValue(NULL)

View file

@ -129,6 +129,9 @@ RFCTransport::RFCTransport(DtMailEnv & error,
// Set up the handlers so that we are notified when a child
// process exits and do the right thing.
signalRegister();
_error_proc = NULL;
_smd = NULL;
}
RFCTransport::~RFCTransport(void)