Fix psync_my_pass wipe to use strlen instead of sizeof pointer (#338)

In psync_unlink(), putil_wipe(psync_my_pass, sizeof(psync_my_pass))
only wiped 8 bytes (pointer size) instead of the full password string.
Changed to strlen(psync_my_pass) and added NULL check.

Fixes pcl-zqv.9.1 (partial)
GH #276

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
This commit is contained in:
Levi Neely 2026-03-03 17:11:10 +01:00 committed by GitHub
parent 7175636e49
commit 63d8685240
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -343,8 +343,11 @@ void psync_logout(uint32_t auth_status, int doinvauth) {
pcryptofolder_lock();
pthread_mutex_lock(&psync_my_auth_mutex);
putil_wipe(psync_my_pass, sizeof(psync_my_pass));
free(psync_my_pass);
if (psync_my_pass) {
putil_wipe(psync_my_pass, strlen(psync_my_pass));
free(psync_my_pass);
psync_my_pass = NULL;
}
pthread_mutex_unlock(&psync_my_auth_mutex);
pstatus_set(PSTATUS_TYPE_ONLINE, PSTATUS_ONLINE_CONNECTING);