From c7baa9844d08910b5bf6d44cd817b2d8c6a2dbff Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Fri, 7 Mar 2025 09:33:51 +0900 Subject: [PATCH 1/3] The left and right of the ptr subtraction were reversed, so corrected it. --- ext/bcmath/libbcmath/src/str2num.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c index 79c1d4216fe7b..270208f6bcaf4 100644 --- a/ext/bcmath/libbcmath/src/str2num.c +++ b/ext/bcmath/libbcmath/src/str2num.c @@ -180,7 +180,7 @@ bool bc_str2num(bc_num *num, const char *str, const char *end, size_t scale, siz */ if (str_scale > 0) { const char *fractional_new_end = bc_skip_zero_reverse(fractional_end, fractional_ptr); - str_scale -= fractional_new_end - fractional_end; + str_scale -= fractional_end - fractional_new_end; // fractional_end >= fractional_new_end } } } else { From a190da0b6ac9bf4541fd97ac57c0cec732c6b374 Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Sat, 8 Mar 2025 01:36:41 +0900 Subject: [PATCH 2/3] use c-style comment --- ext/bcmath/libbcmath/src/str2num.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c index 270208f6bcaf4..bd9a44a240503 100644 --- a/ext/bcmath/libbcmath/src/str2num.c +++ b/ext/bcmath/libbcmath/src/str2num.c @@ -180,7 +180,7 @@ bool bc_str2num(bc_num *num, const char *str, const char *end, size_t scale, siz */ if (str_scale > 0) { const char *fractional_new_end = bc_skip_zero_reverse(fractional_end, fractional_ptr); - str_scale -= fractional_end - fractional_new_end; // fractional_end >= fractional_new_end + str_scale -= fractional_end - fractional_new_end; /* fractional_end >= fractional_new_end */ } } } else { From 12c3a4f2698d7a08bf45d43784ef01a4dcba7b4a Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Sat, 8 Mar 2025 01:39:09 +0900 Subject: [PATCH 3/3] [skip ci] NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 404290dcf615b..d8a9c6d894245 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.4.6 +- BCMath: + . Fixed pointer subtraction for scale. (SakiTakamachi) + - Core: . Fixed property hook backing value access in multi-level inheritance. (ilutov)