dtmail: resolve coverity warnings related to uninitialised members in C++ classes
authorPeter Howkins <flibble@users.sf.net>
Fri, 20 Apr 2018 01:36:24 +0000 (02:36 +0100)
committerPeter Howkins <flibble@users.sf.net>
Fri, 20 Apr 2018 01:36:24 +0000 (02:36 +0100)
31 files changed:
cde/programs/dtmail/MotifApp/Application.C
cde/programs/dtmail/MotifApp/BusyPixmap.C
cde/programs/dtmail/MotifApp/Cmd.C
cde/programs/dtmail/MotifApp/CmdList.C
cde/programs/dtmail/MotifApp/MainWindow.C
cde/programs/dtmail/MotifApp/SelectFileCmd.C
cde/programs/dtmail/dtmail/AttachArea.C
cde/programs/dtmail/dtmail/Attachment.C
cde/programs/dtmail/dtmail/ComposeCmds.C
cde/programs/dtmail/dtmail/DmxMailbox.C
cde/programs/dtmail/dtmail/DmxPrintOptions.C
cde/programs/dtmail/dtmail/DtMailEditor.C
cde/programs/dtmail/dtmail/DtMailGenDialog.C
cde/programs/dtmail/dtmail/FindDialog.C
cde/programs/dtmail/dtmail/IndexedOptionMenu.C
cde/programs/dtmail/dtmail/MailRetrievalOptions.C
cde/programs/dtmail/dtmail/MsgHndArray.hh
cde/programs/dtmail/dtmail/OptCmd.C
cde/programs/dtmail/dtmail/PasswordDialogManager.C
cde/programs/dtmail/dtmail/RoamApp.C
cde/programs/dtmail/dtmail/RoamCmds.C
cde/programs/dtmail/dtmail/SendMsgDialog.C
cde/programs/dtmail/dtmail/Undelete.C
cde/programs/dtmail/dtmail/ViewMsgDialog.C
cde/programs/dtmail/dtmailpr/message.C
cde/programs/dtmail/libDtMail/Common/DtMailError.C
cde/programs/dtmail/libDtMail/Common/DtMailMailBox.C
cde/programs/dtmail/libDtMail/Common/Threads.C
cde/programs/dtmail/libDtMail/RFC/RFCFormat.C
cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C
cde/programs/dtmail/libDtMail/RFC/RFCTransport.C

index c70651518640a26145470de0bd3d3f83a344fc37..46c04840441e22306f7a15850a52590140b24b99 100644 (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 )
index a1382da6c704aa6f0edcc807c9dcdeeab3bf8c14..4216353090aaf2cac7e2b2872a0f00e077aae5fb 100644 (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;
 }
index 70eba133add454fa809d2546e2a563ebb1a1dfa3..ba43a0dfd84a15e8aba4b1802f26d043467e721b 100644 (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);
index d29c19a8759f79b64944ae2803f3c382eeaf6cc1..3793d27dc77ca9e5ec93da7f78a94e10ad3d3412 100644 (file)
@@ -82,6 +82,7 @@ CmdList::CmdList(char *name, char *label ) : Cmd(name, label, 1)
     
     _contents    = 0;
     _numElements = 0;
+    _pane        = NULL;
 }
 
 CmdList::~CmdList()
index 4ec2dd9fdb925a0360324b95b814897247985ea0..25b184aa97e6411c7b9110e829d8cc2031de3141 100644 (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
index 84678781473ee5636d74a33514c19ceeb1f99b8d..f163151b16b9aabab2d21c3d94cd1686e6934220 100644 (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()
index c4848173a85b412fdee9ac30ed299a0e68ad3980..b0999008c92986c2ea95e9e757736609cdd004aa 100644 (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
index 74a91da266ecc8f8205240e607ff73e5afe32d51..47136515561334cec44f95c3b4d5872089f03890 100644 (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(
index 0a6d695d0167be07af09639acf7ed07db2dd8c3f..dfac3ae24b0ce43da4a0c369fe9949f60e09d426 100644 (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.
index c0912c00e93d152f493cb25a71abf485a0c216ba..a37640a677121bad62d1b14e08e61692e95739ff 100644 (file)
@@ -82,6 +82,7 @@ DmxMailbox::DmxMailbox (char *filename)
        _mbox = NULL;
        _messageCount = 0;
        _fileName = strdup_n(filename);
+        _message = NULL;
 }
 
 DmxMailbox::~DmxMailbox (void)
index c7a4736b3495936d703ce2f9e46365489c10dde5..18d1ca0af4e5d38ddf6077b91f49b374d66beb46 100644 (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
index 9eae4f42b5b0a8c468836d750bf897c00a052d7d..edbc682b2d466dfaacaaf38178f9d2ef967a02a4 100644 (file)
@@ -107,6 +107,7 @@ DtMailEditor::DtMailEditor(
     _dragX = -1;
     _dragY = -1;
     _editable = FALSE;
+    _container = NULL;
 
 }
 
index 35946165f5ae87dd6f6dc031c304745e9ba377fd..595cefa3adb1bb9e174100c984eb08f3c39cb9e4 100644 (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))
index e8f9cf4f0f2f95b4790b9f168b6cdb5e035a0501..52a6f6f18d869892eb924042fb7acb23bebd520f 100644 (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.
index f00b7409c33059940a47e6675033552e3ff6fbb2..d80f38ea4fae25cd7664a21c0e892010e05f189c 100644 (file)
@@ -96,6 +96,9 @@ IndexedOptionMenu::IndexedOptionMenu (
     Widget     menu;
     XmString   xms;
 
+    _strings = NULL;
+    _data = NULL;
+
     _nmenu_items = nmenu_items;
     if (nmenu_items && strings != NULL)
     {
index 1c7f64041126b29b61dffba52daf95b8efbaf8a9..d1719955db2308abe7405836d736dded6eb04b2c 100644 (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;
index 726ac99ea7657c10a43a58fd6c3712096ceb4074..e6eb606c8ddc9064c9da0973f8067f37ebbb202c 100644 (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;
index 39114eff5a6439eaa7a1e40627a52db762f7652d..7e0dc71621bf4c51da3135b504b49d0ab4484418 100644 (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
index 6eb139d992c56b5851a2c94337842fe5a1e016e2..e4208969fdc3b91182b45b287e5584d5c23a61f8 100644 (file)
@@ -55,6 +55,8 @@ PasswordDialogManager::PasswordDialogManager ( char   *name ) :
 {
     // Empty
     _pwd[0] = 0;
+    _user = NULL;
+    _password = NULL;
 }
 
 Widget PasswordDialogManager::createDialog ( Widget parent )
index 88680d948bb3a1ff45ee7cf9243bfd0e85624063..647fc4e3935f9d25735fb61a5010ba0da086d767 100644 (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
index da48bca2579942ec54dd74c46c25082e85208c2c..666d32b223b1dd8ed2c7d7f0734fd424c3e6e272 100644 (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
index 310adfbf01c7e6463eddd70354f46884508d1f12..a00187eb1875bac77396a17efd8a589eac54ec84 100644 (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;
index 9cfd4742bf7076ac3f6a9caa5ca60575bcfb7543..e7fc1712a1cac25954c1889734d65b88d9d5b019 100644 (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()
index cbd01ed0a9fcdc5e5692219169cc793167877098..e08ba98bda477d2cec192f39d090ac8780cab0a3 100644 (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 );
 
 }
index 314b34de8156681e9f34729a3a05f279131cbb23..d76ec4bab3a15cbe5b7e6fd0c0713b3389b96eac 100644 (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;
 }
index 4650b7b44ab56e0976418cbced22a4b55b0be44b..c758b9ecdcc4c988200de3676fca91aa85a68b4d 100644 (file)
@@ -397,6 +397,7 @@ DtMailEnv::DtMailEnv()
   _client = NULL;
   _implClearFunc = NULL;
   _fatal = DTM_FALSE;
+  _error_minor_code = DTME_NoError;
 }
 
 #ifdef hpV4
index d856dd64fdd7632e396e4def7e31444769592504..adf1b2a5c87b159fe0a0e13c9bf5ea33202ec206 100644 (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)
index f1059b1c22e84677572e862db575f23937b28605..565205cb66ecb6dbad5ad5620244b8d4a5d5fa62 100644 (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)
index afd927f112e409521015fd99f751d9a735c3d233..046d4117da7ea408c9ed222b357038adadbec20d 100644 (file)
@@ -53,6 +53,7 @@ RFCFormat::RFCFormat(DtMail::Session * session)
 {
     _session = session;
     _is_write_bcc = DTM_FALSE;
+    _use_cr = DTM_FALSE;
 }
 
 RFCFormat::~RFCFormat(void)
index 23360212474f7a1093b5eb47b752c9ebe14fa0fc..c6c23134276dffd807b22ccc18da95e78e353395 100644 (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)
index 72c9c59cb05b0c49fd90252056d336c768bf9246..cd9e4ae226e2772f382493fa574f4b29f68d149c 100644 (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)