# HG changeset patch # User reimar # Date 1352555609 0 # Node ID f570e9faa3c7a3be1526a5b01f66dce77bd373a9 # Parent 57027e8acb1148da90cc99b2bc7248aad0b7b013 Fix off-by-one errors in file descriptor validity checks. diff -r 57027e8acb11 -r f570e9faa3c7 stream/http.c --- a/stream/http.c Sat Nov 10 13:41:38 2012 +0000 +++ b/stream/http.c Sat Nov 10 13:53:29 2012 +0000 @@ -717,7 +717,7 @@ do { redirect = 0; - if (fd > 0) closesocket(fd); + if (fd >= 0) closesocket(fd); fd = http_send_request( url, 0 ); if( fd<0 ) { goto err_out; @@ -847,7 +847,7 @@ } while( redirect ); err_out: - if (fd > 0) closesocket( fd ); + if (fd >= 0) closesocket( fd ); fd = -1; http_free( http_hdr ); http_hdr = NULL;