| 129 | } |
| 130 | |
| 131 | void CSecureEdit::SetRealText(const WCHAR *pszNewString) |
| 132 | { |
| 133 | LockZeroBuffer<WCHAR> dotsBuf(MAX_PASSWORD_LEN+1, true); |
| 134 | WCHAR * strDots = dotsBuf.m_buf; |
| 135 | int i = 0; |
| 136 | |
| 137 | if(pszNewString == NULL) return; |
| 138 | |
| 139 | wcscpy_s(m_strRealText, MAX_PASSWORD_LEN+1, pszNewString); |
| 140 | wcscpy_s(m_strOldText, MAX_PASSWORD_LEN+1, pszNewString); |
| 141 | m_nOldLen = (int)wcslen(m_strRealText); |
| 142 | |
| 143 | for(i = 0; i < m_nOldLen; i++) strDots[i] = SE_PASSWORD_CHAR; |
| 144 | strDots[i] = '\0'; |
| 145 | |
| 146 | SetWindowText(strDots); |
| 147 | |
| 148 | if (wcslen(pszNewString) < 1) { |
| 149 | m_pBuf->Clear(); |
| 150 | m_pBufOld->Clear(); |
| 151 | } |
| 152 | } |
| 153 |
no test coverage detected