~igor-cali/bilancio/trunk-a18

« back to all changes in this revision

Viewing changes to src/ombconvert/dataconverter.cpp

  • Committer: Igor Calì
  • Date: 2024-04-07 15:42:12 UTC
  • Revision ID: igor.cali0@gmail.com-20240407154212-za8iy8efo91nwmz9
[Desktop] Code security harneded based on Flawfinder checks; [Android] Code security hardening baseline based on Insider checks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Name:      dataconverter.cpp
3
3
 * Purpose:   convertion Code for OpenMoneyBox Application Class
4
4
 * Author:    Igor Calì (igor.cali0@gmail.com)
5
 
 * Created:   2023-04-30
 
5
 * Created:   2024-04-07
6
6
 * Copyright: Igor Calì (igor.cali0@gmail.com)
7
7
 * License:             GNU
8
8
 **************************************************************/
63
63
                        t_new.c_lflag &= ~(ICANON | ECHO);
64
64
                        tcsetattr(STDIN_FILENO, TCSANOW, &t_new);
65
65
 
66
 
                        ch = getchar();
 
66
                        ch = getchar(); // flawfinder: ignore
67
67
 
68
68
                        tcsetattr(STDIN_FILENO, TCSANOW, &t_old);
69
69
                        return ch;
70
70
        }
71
71
 
72
 
        std::string getpass(const char *prompt, bool show_asterisk = true)
 
72
        std::string getpass(const char *prompt, bool show_asterisk = true) // flawfinder: ignore
73
73
        {
74
74
                const char BACKSPACE=127;
75
75
                const char RETURN=10;
114
114
                std::string test(p.mb_str(wxConvUTF8));
115
115
 
116
116
                while (tries){
117
 
                        pwd = getpass(_("Enter the document password: ").c_str(), true);
118
 
                        if(pwd == test) return true;
 
117
                        pwd = getpass(_("Enter the document password: ").c_str(), true);        // flawfinder: ignore
 
118
                        if(pwd == test){
 
119
                                delete pwd;
 
120
                                return true;
 
121
                        }
119
122
                        else{
120
123
                                printf("%s", output_string);
121
124
                                if(tries) tries--;
122
125
                        }
123
 
                }
 
126
                }
 
127
 
 
128
                delete pwd;
124
129
        #endif // __LINUX__
125
130
 
126
131
        #ifdef __WXMSW__