mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #20438] Disallow "%\n" and "%\0"
This commit is contained in:
parent
61e2916d1c
commit
31c9a3a1d3
3 changed files with 51 additions and 33 deletions
|
@ -429,10 +429,6 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
|
|||
GETNUM(prec, precision);
|
||||
goto retry;
|
||||
|
||||
case '\n':
|
||||
case '\0':
|
||||
p--;
|
||||
/* fall through */
|
||||
case '%':
|
||||
if (flags != FNONE) {
|
||||
rb_raise(rb_eArgError, "invalid format character - %%");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue