diff options
author | Christian Hesse <mail@eworm.de> | 2021-12-13 09:22:34 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-12-13 09:22:34 +0100 |
commit | fcd828e19728c6c99d98ba246d2de3352c77507e (patch) | |
tree | 7318f486bbdf87d281839981a2b9b4775bba17c7 | |
parent | 10e7015cce790efe748ff8d0b7f943577e805edf (diff) | |
download | dyndhcpd-fcd828e19728c6c99d98ba246d2de3352c77507e.tar.gz dyndhcpd-fcd828e19728c6c99d98ba246d2de3352c77507e.tar.zst |
check valid response from gethostbyname()
-rw-r--r-- | dyndhcpd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -142,7 +142,7 @@ int main(int argc, char ** argv) { /* get the domainname */ hp = gethostbyname(hostname); - if ((domainname = strchr(hp->h_name, '.')) != NULL) + if (hp && (domainname = strchr(hp->h_name, '.')) != NULL) domainname++; else { fprintf(stderr, "Could not get domainname, using '" FALLBACKDOMAIN "'\n"); |