Skip to content

Commit 7c9872e

Browse files
committed
Fixed pointer subtraction for scale (#17986)
Closes #17986
1 parent f4ba356 commit 7c9872e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.4.6
44

5+
- BCMath:
6+
. Fixed pointer subtraction for scale. (SakiTakamachi)
7+
58
- Core:
69
. Fixed property hook backing value access in multi-level inheritance.
710
(ilutov)

Diff for: ext/bcmath/libbcmath/src/str2num.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ bool bc_str2num(bc_num *num, const char *str, const char *end, size_t scale, siz
180180
*/
181181
if (str_scale > 0) {
182182
const char *fractional_new_end = bc_skip_zero_reverse(fractional_end, fractional_ptr);
183-
str_scale -= fractional_new_end - fractional_end;
183+
str_scale -= fractional_end - fractional_new_end; /* fractional_end >= fractional_new_end */
184184
}
185185
}
186186
} else {

0 commit comments

Comments
 (0)