mirror of
https://github.com/rfc1036/whois.git
synced 2026-05-03 06:51:09 +00:00
Always check the values returned by fdopen(3)
This commit is contained in:
parent
dc588f10ee
commit
2c20d77516
8
whois.c
8
whois.c
@ -801,6 +801,8 @@ char *do_query(const int sock, const char *query)
|
|||||||
strcat(temp, "\r\n");
|
strcat(temp, "\r\n");
|
||||||
|
|
||||||
fi = fdopen(sock, "r");
|
fi = fdopen(sock, "r");
|
||||||
|
if (!fi)
|
||||||
|
err_sys("fdopen");
|
||||||
if (write(sock, temp, strlen(temp)) < 0)
|
if (write(sock, temp, strlen(temp)) < 0)
|
||||||
err_sys("write");
|
err_sys("write");
|
||||||
free(temp);
|
free(temp);
|
||||||
@ -875,6 +877,8 @@ char *query_crsnic(const int sock, const char *query)
|
|||||||
strcat(temp, "\r\n");
|
strcat(temp, "\r\n");
|
||||||
|
|
||||||
fi = fdopen(sock, "r");
|
fi = fdopen(sock, "r");
|
||||||
|
if (!fi)
|
||||||
|
err_sys("fdopen");
|
||||||
if (write(sock, temp, strlen(temp)) < 0)
|
if (write(sock, temp, strlen(temp)) < 0)
|
||||||
err_sys("write");
|
err_sys("write");
|
||||||
free(temp);
|
free(temp);
|
||||||
@ -928,6 +932,8 @@ char *query_afilias(const int sock, const char *query)
|
|||||||
strcat(temp, "\r\n");
|
strcat(temp, "\r\n");
|
||||||
|
|
||||||
fi = fdopen(sock, "r");
|
fi = fdopen(sock, "r");
|
||||||
|
if (!fi)
|
||||||
|
err_sys("fdopen");
|
||||||
if (write(sock, temp, strlen(temp)) < 0)
|
if (write(sock, temp, strlen(temp)) < 0)
|
||||||
err_sys("write");
|
err_sys("write");
|
||||||
free(temp);
|
free(temp);
|
||||||
@ -980,6 +986,8 @@ char *query_iana(const int sock, const char *query)
|
|||||||
strcat(temp, "\r\n");
|
strcat(temp, "\r\n");
|
||||||
|
|
||||||
fi = fdopen(sock, "r");
|
fi = fdopen(sock, "r");
|
||||||
|
if (!fi)
|
||||||
|
err_sys("fdopen");
|
||||||
if (write(sock, temp, strlen(temp)) < 0)
|
if (write(sock, temp, strlen(temp)) < 0)
|
||||||
err_sys("write");
|
err_sys("write");
|
||||||
free(temp);
|
free(temp);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user