summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2024-10-23 22:32:55 -0700
committerJohn Hawthorn <[email protected]>2024-11-08 17:39:19 -0800
commitc8c94bfb1edd6e1e045d503dfba9a96077306a27 ()
treee1f002f103520a9fb55ff149f0a64e97ba30f5ce /sprintf.c
parent1f6dd9071c7994dd639d2e1cf2fe04e944173f17 (diff)
Fix benign off-by-one
Previously we always reserved one more byte than necessary in the sprintf output string.
Notes: Merged: https://.com/ruby/ruby/pull/12029
-rw-r--r--sprintf.c3
1 files changed, 2 insertions, 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) {\
bsiz*=2;\
if (bsiz<0) rb_raise(rb_eArgError, "too big specifier");\
}\