[net] improve handling of invalid signatures

* Also make bPromptOnError an actual parameter to the download function calls
* Also prefer the use of assert() to custom assertion messages
This commit is contained in:
Pete Batard 2018-06-30 22:45:15 +01:00
parent fdfc9ff82d
commit 7c142fadbc
12 changed files with 93 additions and 78 deletions

View file

@ -31,6 +31,7 @@
#include <stddef.h>
#include <ctype.h>
#include <locale.h>
#include <assert.h>
#include "rufus.h"
#include "missing.h"
@ -1957,8 +1958,8 @@ DWORD WINAPI FormatThread(void* param)
// All good
} else if (tt == TT_UEFI) {
// For once, no need to do anything - just check our sanity
assert((bt == BT_IMAGE) && IS_EFI_BOOTABLE(img_report) && (fs <= FS_NTFS));
if ( (bt != BT_IMAGE) || !IS_EFI_BOOTABLE(img_report) || (fs > FS_NTFS) ) {
uprintf("Spock gone crazy error in %s:%d", __FILE__, __LINE__);
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_INSTALL_FAILURE;
goto out;
}