Skip to content

Commit 796dc70

Browse files
committed
Added null check for "full_scale"
1 parent ab641de commit 796dc70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/bcmath/libbcmath/src/str2num.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ bool bc_str2num(bc_num *num, const char *str, const char *end, size_t scale, siz
143143
fractional_ptr = fractional_end = decimal_point + 1;
144144
/* For strings that end with a decimal point, such as "012." */
145145
if (UNEXPECTED(*fractional_ptr == '\0')) {
146-
*full_scale = 0;
146+
if (full_scale) {
147+
*full_scale = 0;
148+
}
147149
goto after_fractional;
148150
}
149151

0 commit comments

Comments
 (0)