We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90e3f33 commit 5481fdfCopy full SHA for 5481fdf
src/simple_http.c
@@ -75,7 +75,12 @@ http_get(const int sockfd, const char *req)
75
}
76
77
debug(LOG_DEBUG, "Sending HTTP request to auth server: [%s]\n", req);
78
- send(sockfd, req, reqlen, 0);
+ numbytes = send(sockfd, req, reqlen, 0);
79
+ // Cast numbytes to unsigned type because < 0 is already checked
80
+ if (numbytes < 0 || (size_t) numbytes != reqlen) {
81
+ debug(LOG_ERR, "An error occurred while writing to server: %s", strerror(errno));
82
+ goto error;
83
+ }
84
85
debug(LOG_DEBUG, "Reading response");
86
done = 0;
0 commit comments