Index: src/wp-includes/class-http.php
===================================================================
--- src/wp-includes/class-http.php	(revision 25270)
+++ src/wp-includes/class-http.php	(working copy)
@@ -864,11 +864,21 @@
 					}
 				}
 
-				if ( isset( $r['limit_response_size'] ) && ( $bytes_written + strlen( $block ) ) > $r['limit_response_size'] )
+				$this_block_size = strlen( $block );
+
+				if ( isset( $r['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $r['limit_response_size'] )
 					$block = substr( $block, 0, ( $r['limit_response_size'] - $bytes_written ) );
 
-				$bytes_written += fwrite( $stream_handle, $block );
+				$bytes_written_to_file = fwrite( $stream_handle, $block );
 
+				if ( $bytes_written_to_file != $this_block_size ) {
+					fclose( $handle );
+					fclose( $stream_handle );
+					return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
+				}
+
+				$bytes_written += $bytes_written_to_file;
+
 				$keep_reading = !isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
 			}
 
@@ -1229,8 +1239,14 @@
 		$this->headers = '';
 		$this->body = '';
 
-		// If no response
-		if ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) {
+		$curl_error = curl_errno( $handle );
+
+		// If an error occured, or, no response
+		if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {
+			if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error &&  $r['stream'] ) {
+				fclose( $this->stream_handle );
+				return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
+			}
 			if ( $curl_error = curl_error( $handle ) ) {
 				curl_close( $handle );
 				return new WP_Error( 'http_request_failed', $curl_error );
@@ -1304,16 +1320,15 @@
 			$data = substr( $data, 0, ( $this->max_body_length - strlen( $this->body ) ) );
 
 		if ( $this->stream_handle )
-			fwrite( $this->stream_handle, $data );
+			$bytes_written = fwrite( $this->stream_handle, $data );
 		else
 			$this->body .= $data;
 
-		$data_length = strlen( $data );
-
 		if ( isset( $mb_encoding ) )
 			mb_internal_encoding( $mb_encoding );
 
-		return $data_length;
+		// Upon event of this function returning less than strlen( $data ) curl will error with CURLE_WRITE_ERROR
+		return isset( $bytes_written ) ? $bytes_written : strlen( $data );
 	}
 
 	/**
