Make WordPress Core

Ticket #54036: pclzip.diff

File pclzip.diff, 549 bytes (added by DavidAnderson, 3 years ago)

Fix potentially invalid fread() call

  • wp-admin/includes/class-pclzip.php

     
    26732673          return PclZip::errorCode();
    26742674        }
    26752675
    2676         // ----- Read the file content
    2677         $v_content = @fread($v_file, $p_header['size']);
    2678 
     2676        if ( $p_entry['compressed_size'] > 0 ) {
     2677            // ----- Read the file content
     2678            $v_content = @fread($v_file, $p_header['size']);
     2679        }
     2680        else {
     2681            $v_content = '';
     2682        }
     2683       
    26792684        // ----- Close the file
    26802685        @fclose($v_file);
    26812686