Selaa lähdekoodia

telnet: check return code from fileno()

and return error if necessary

Spotted by CodeSonar

Closes #13457
Daniel Stenberg 3 viikkoa sitten
vanhempi
commit
a090111613
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      lib/telnet.c

+ 5 - 0
lib/telnet.c

@@ -1535,6 +1535,11 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done)
     pfd[1].events = POLLIN;
     poll_cnt = 2;
     interval_ms = 1 * 1000;
+    if(pfd[1].fd < 0) {
+      failf(data, "cannot read input");
+      result = CURLE_RECV_ERROR;
+      keepon = FALSE;
+    }
   }
 
   while(keepon) {