[wp-trac] [WordPress Trac] #59116: Integer Casting Error in WP_Site_Health::get_test_available_updates_disk_space() wordpress
WordPress Trac
noreply at wordpress.org
Wed Aug 23 13:30:07 UTC 2023
#59116: Integer Casting Error in
WP_Site_Health::get_test_available_updates_disk_space() wordpress
-------------------------------------------------+-------------------------
Reporter: mathsgrinds | Owner:
| SergeyBiryukov
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.3.1
Component: Site Health | Version: 6.3
Severity: normal | Resolution: fixed
Keywords: has-patch fixed-major dev-reviewed | Focuses:
commit |
-------------------------------------------------+-------------------------
Changes (by audrasjb):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"56428" 56428]:
{{{
#!CommitTicketReference repository="" revision="56428"
Site Health: Correct the check for disk space available to safely perform
updates.
If the available disk space exceeds the `PHP_INT_MAX` value, i.e. a 32-bit
PHP version is in use with more than 2 GB free, the type casting to
`(int)` could cause
an overflow, and the Site Health test would then erroneously report that
there is not enough free space.
This commit removes the unnecessary type casting and uses the result from
`disk_free_space()` directly.
Includes optimizing the logic to skip further checks if the available disk
space could not be determined.
Follow-up to [55720].
Props mathsgrinds, Presskopp, rajinsharwar, SergeyBiryukov.
Reviewed by azaozz, audrasjb.
Merges [56401] to the 6.3 branch.
Fixes #59116.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59116#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list