Sha256: b6dd9043d2f56beba35b201b46b7265e0a6069fa3d8f04418d7ac3586d34ee1f
Contents?: true
Size: 1.65 KB
Versions: 7
Compression:
Stored size: 1.65 KB
Contents
/* Copyright (c) 2020 Contrast Security, Inc. See * https://www.contrastsecurity.com/enduser-terms-0317a for more details. */ #include "cs__assess_marshal_module.h" #include "../cs__common/cs__common.h" #include <ruby.h> static VALUE contrast_assess_marshal_module_load(const int argc, const VALUE *argv) { VALUE result; VALUE source_string; result = rb_call_super(argc, argv); if (argc >= 1) { source_string = argv[0]; if (rb_respond_to(source_string, rb_sym_cs_tracked)) { VALUE tracked = rb_funcall(source_string, rb_sym_cs_tracked, 0); if (tracked == Qtrue) { VALUE skip = rb_funcall(contrast_patcher(), rb_sym_skip_assess_analysis, 0); if (skip == Qfalse) { VALUE scope = rb_funcall(contrast_patcher(), rb_sym_enter_scope, 0); rb_funcall(marshal_module, rb_sym_assess_load_trigger_check, 2, source_string, result); rb_funcall(contrast_patcher(), rb_sym_exit_scope, 1, scope); } } } } return result; } void Init_cs__assess_marshal_module(void) { rb_sym_assess_load_trigger_check = rb_intern("cs__load_trigger_check"); marshal_module = rb_define_module("Marshal"); VALUE contrast_marshal = rb_define_module("MarshalWithContrastAssess"); rb_define_method(contrast_marshal, "load", contrast_assess_marshal_module_load, -1); rb_prepend_module(rb_singleton_class(marshal_module), contrast_marshal); }
Version data entries
7 entries across 7 versions & 1 rubygems