Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return code not propagated for TLD download failure #79

Open
jdiner opened this issue Dec 22, 2016 · 0 comments
Open

Return code not propagated for TLD download failure #79

jdiner opened this issue Dec 22, 2016 · 0 comments

Comments

@jdiner
Copy link

jdiner commented Dec 22, 2016

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

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant