Index: marshal.c =================================================================== --- marshal.c.orig +++ marshal.c @@ -224,9 +224,9 @@ { VALUE buf = arg->str; rb_str_buf_cat(buf, s, n); + if (arg->taint) OBJ_TAINT(buf); + if (arg->untrust) OBJ_UNTRUST(buf); if (arg->dest && RSTRING_LEN(buf) >= BUFSIZ) { - if (arg->taint) OBJ_TAINT(buf); - if (arg->untrust) OBJ_UNTRUST(buf); rb_io_write(arg->dest, buf); rb_str_resize(buf, 0); } @@ -859,12 +859,6 @@ st_free_table(arg->encodings); arg->encodings = 0; } - if (arg->taint) { - OBJ_TAINT(arg->str); - } - if (arg->untrust) { - OBJ_UNTRUST(arg->str); - } } /*