From 46f05ea9a3bae2aac2c164a40eac2b6c2af9031b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 22 May 2025 17:36:59 +0600 Subject: [PATCH] Crash fix --- source/ubl-settings-update.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index d9f0028..02fb6d3 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -1426,7 +1426,7 @@ char *yon_password_hash_get(password_window *window){ const char *encription = gtk_combo_box_get_active_id(GTK_COMBO_BOX(window->EncryptionCombo)); const char *hash = gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry)); if (!yon_char_is_empty(hash)){ - if (strcmp(hash,window->old_password)&&strlen(hash)!=128&&strlen(hash)!=64){ + if (!yon_char_is_empty(window->old_password)&&strcmp(hash,window->old_password)&&strlen(hash)!=128&&strlen(hash)!=64){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INCORRECT_HASH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->PasswordHashEntry); return NULL; @@ -1441,6 +1441,11 @@ char *yon_password_hash_get(password_window *window){ yon_ubl_status_highlight_incorrect(window->PasswordEntry); return NULL; } + if (yon_char_is_empty(password_repeat)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->RepeatPasswordEntry); + return; + } if (strcmp(password,password_repeat)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->PasswordEntry);