faup
faup copied to clipboard
Return code not propagated for TLD download failure
TLD updates aren't working today (2016-12-22). Error message "(connect) Cannot connect outside.". Caused by connections being rejected by the server. This situation has highlighted a bug in tld.c. Function faup_tld_update() falsely returns zero (SUCCESS) if the download failed. This is because it does not check the value returned code from faup_tld_download_mozilla_list(). The code is pasted below, with the faulty marked marked with a comment:
int faup_tld_update(void) { char *tld_file;
tld_file = faup_datadir_file_to_write("mozilla.tlds", false);
if (tld_file) {
faup_tld_download_mozilla_list(tld_file); // <--- *BUG* return value ignored
free(tld_file);
} else {
return -1;
}
return 0; // <-- *BUG* zero is returned even if the download failed
}