mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix benign off-by-one
Previously we always reserved one more byte than necessary in the sprintf output string.
This commit is contained in:
parent
1f6dd9071c
commit
c8c94bfb1e
Notes:
git
2024-11-09 01:39:37 +00:00
1 changed files with 2 additions and 1 deletions
|
@ -67,7 +67,8 @@ sign_bits(int base, const char *p)
|
|||
|
||||
#define CHECK(l) do {\
|
||||
int cr = ENC_CODERANGE(result);\
|
||||
while ((l) >= bsiz - blen) {\
|
||||
RUBY_ASSERT(bsiz >= blen); \
|
||||
while ((l) > bsiz - blen) {\
|
||||
bsiz*=2;\
|
||||
if (bsiz<0) rb_raise(rb_eArgError, "too big specifier");\
|
||||
}\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue