| Age | Commit message (Collapse) | Author |
|
|
|
ref #4576 and ref #4947
* Need MRBAPI functions without `MRB_DISABLE_STDIO`:
* mrbgems/mruby-bin-debugger
* mrbgems/mruby-bin-mirb
* mrbgems/mruby-bin-mrbc
* mrbgems/mruby-bin-mruby
* mrbgems/mruby-bin-strip
* Need `stdio.h`:
* mrbgems/mruby-io
* mrbgems/mruby-print
* Need `snprintf()` in `stdio.h`:
* mrbgems/mruby-pack
* mrbgems/mruby-sprintf
|
|
'stdio.h' is included in 'mruby.h' ('mrbconf.h').
However, keep 'stdio.h' used by mruby-test.
|
|
It is writing side by side with the original authors.
|
|
|
|
|
|
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in
my environment than before the introduction of new specifiers/modifiers
(5116789a) with this change.
------------+-------------------+-------------------+--------
BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO
------------+-------------------+-------------------+--------
mruby | 593416 bytes | 593208 bytes | -0.04%
libmruby.a | 769048 bytes | 767264 bytes | -0.23%
------------+-------------------+-------------------+--------
BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613,
so I put it back.
|
|
- I think "Info" is used only to `skip`, so change to "Skip".
- Changed the default value of `assert` and specify the argument explicitly
at the caller of `assert` because it is unnatural "Assertion failed" is
output even though the assertion doesn't fail.
== Example:
def assert_foo(exp, act)
assert do
assert_equal exp[0], act[0]
assert_equal exp[1], act[1]
end
end
def assert_bar(exp, act)
assert do
skip
end
end
def assert_baz(exp, act)
assert do
assert_equal exp, act
assert_bar exp, act
end
end
assert 'test#skip_in_nested_assert' do
assert_baz 1, 1
end
=== Before this patch:
?..
Info: test#skip_in_nested_assert (core)
- Assertion[1]
Info: Assertion failed (core)
- Assertion[1-2]
Skip: Assertion failed (core)
Total: 3
OK: 2
KO: 0
Crash: 0
Warning: 0
Skip: 1
=== After this patch:
???
Skip: test#skip_in_nested_assert (core)
- Assertion[1]
Skip: assert (core)
- Assertion[1-2]
Skip: assert (core)
Total: 3
OK: 0
KO: 0
Crash: 0
Warning: 0
Skip: 3
|
|
For example, `"".unpack("")` evaluates to `[]`.
|
|
The pack/unpack "m" directive should be treated as a length rather than
an element count.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The argument is converted to fixnum before calling.
|
|
|
|
|
|
The `MRB_ENDIAN_BIG` macro is originally used for `NaN` boxing.
We cannot assume it is defined on every big endian platform (#4190
is the case). So instead of relying on untrusted `MRB_ENDIAN_BIG`, we
use `BYTE_ORDER` macro with a fallback function to check endian in
runtime.
|
|
The ISO standard does not include implicit type conversion using
`to_int`. This implicit conversion often causes vulnerability.
There will be no more attacks like #4120.
In addition, we have added internal convenience method `__to_int` which
does type check and conversion (from floats).
|
|
|
|
The ISO standard does not include implicit type conversion using
`to_int`, `to_str` and sometimes `to_f`. For the compactness of the
mruby implementation, maybe we should remove those implicit conversion
from mruby.
|
|
|
|
|
|
`mrb_raisef()` only takes `%S` specifier. If you don't have extra
arguments, use `mrb_raise()`.
|
|
When running the mruby-pack test with big endian, test data is incorrect,
so it will fail with "i" and "I".
------
Fail: pack/unpack "i" (mrbgems: mruby-pack)
- Assertion[1] Failed: Expected to be equal
Expected: "\xff\xff\xc7\xcf"
Actual: "\xff\xff\xcf\xc7"
- Assertion[2] Failed: Expected to be equal
Expected: [-12345]
Actual: [-14385]
Fail: pack/unpack "I" (mrbgems: mruby-pack)
- Assertion[1] Failed: Expected to be equal
Expected: "\x00\x0090"
Actual: "\x00\x0009"
- Assertion[2] Failed: Expected to be equal
Expected: [12345]
Actual: [14640]
------
This will fix the test data at big-endian.
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
|
|
The fix was proposed by https://hackerone.com/aerodudrizzt
|
|
The issue (and the fix) reported by https://hackerone.com/aerodudrizzt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
git-subtree-dir: mrbgems/mruby-pack
git-subtree-mainline: 842e6945f2d0a519d7cf0525016830246cd337ab
git-subtree-split: 383a9c79e191d524a9a2b4107cc5043ecbf6190b
|