diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2017-08-29 11:23:52 +0000 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-08-29 11:23:52 +0000 |
commit | 00aeb6ee00efa98c7e2d6d9bebeb1c4799ba1705 (patch) | |
tree | d86a1c02b36cfc5feea1ba5f22c6899f8a6c0c9c /src/ipcpd/shim-udp | |
parent | e8875c08ac04a1d9aca342d94d4f788239334f72 (diff) | |
parent | 4de841c26b7208d5395da349ea16c937b1361414 (diff) | |
download | ouroboros-00aeb6ee00efa98c7e2d6d9bebeb1c4799ba1705.tar.gz ouroboros-00aeb6ee00efa98c7e2d6d9bebeb1c4799ba1705.zip |
Merged in sandervrijders/ouroboros/be-bugfixes (pull request #573)
lib, ipcpd, irmd: Fix bugs reported by static analysis
Diffstat (limited to 'src/ipcpd/shim-udp')
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index 0bf57741..b6f516bd 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -693,10 +693,8 @@ static uint32_t ddns_resolve(char * name, char * addr_str = "Address:"; uint32_t ip_addr = 0; - if (inet_ntop(AF_INET, &dns_addr, dnsstr, INET_ADDRSTRLEN) == NULL) { + if (inet_ntop(AF_INET, &dns_addr, dnsstr, INET_ADDRSTRLEN) == NULL) return 0; - } - if (pipe(pipe_fd)) { log_err("Failed to create pipe."); @@ -743,7 +741,7 @@ static uint32_t ddns_resolve(char * name, substr = strtok(NULL, "\n"); } - if (strstr(substr2, addr_str) == NULL) { + if (substr2 == NULL || strstr(substr2, addr_str) == NULL) { log_err("Failed to resolve DNS address."); return 0; } |