Skip to content

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

@wusspuss

Description

@wusspuss

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions