summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/marshal.c b/marshal.c
index 90c0788b83..473aee9ccd 100644
--- a/marshal.c
+++ b/marshal.c
@@ -871,6 +871,7 @@ r_bytes0(len, arg)
{
VALUE str;
+ if (len == 0) return rb_str_new(0, 0);
if (!arg->end) {
VALUE src = (VALUE)arg->ptr;
VALUE n = LONG2NUM(len);