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

ipaddr_remote segfaults on domain names, not actually tested? #224

Open
wusspuss opened this issue Apr 7, 2023 · 0 comments
Open

ipaddr_remote segfaults on domain names, not actually tested? #224

wusspuss opened this issue Apr 7, 2023 · 0 comments

Comments

@wusspuss
Copy link

wusspuss commented Apr 7, 2023

Adaptation from the tutorial:

#include <libdill.h>
#include <stdio.h>

int main() {
  struct ipaddr addr;
  int rc = ipaddr_remote(&addr, "example.org", 80, 0, -1);
  if (rc != 0) {
    printf("rc=%i,errno=%i\n",rc,errno);
    return 1;
  }
   
  return 0;
}

Sometimes prints rc=-1,errno=99 (not a valid errno), sometimes segfaults straight away. If you swap "example.org" for "127.0.0.1" it works just fine. From grepping tests/ for ipaddr_remote it seems it's only tested for 0.0.0.0 and 127.0.0.1 and not domain names.

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