text
stringlengths
79
3.72M
<vulnerable_code> function configure(config, layouts) { let layout = layouts.basicLayout; if (config.layout) { layout = layouts.layout(config.layout.type, config.layout); } config.alwaysIncludePattern = false; } return appender( config.filename, config.pattern,<commit_title>[PATCH] Changed d...
<vulnerable_code> layout = layouts.layout(config.layout.type, config.layout); } return fileAppender( config.filename, layout,<commit_title>[PATCH] Changed default file modes from 0o644 to 0o600 for better<commit_description><fixed_code> layout = layouts.layout(config.layout.type, config.layout); }...
<vulnerable_code> const options = { flags: config.flags || 'a', encoding: config.encoding || 'utf8', mode: config.mode || 0o644 }; return fileAppender(<commit_title>[PATCH] Changed default file modes from 0o644 to 0o600 for better<commit_description><fixed_code> const options = { flags: config.f...
<vulnerable_code> } else if (header->bDescriptorType == USB_DT_INTERFACE_ASSOCIATION) { if (iad_num == USB_MAXIADS) { dev_warn(ddev, "found more Interface " "Association Descriptors " "than allocated for in " "configuration %d\n", cfgno); } else { config->intf_ass...
<vulnerable_code> label: $('#variableInput').val().replace(/_/g, " ") }; newChart.series.push(newSeries); $('#seriesPreview').append('- ' + newSeries.label + str + '<br/>'); newChart.nodes.push(serie); $('#variableInput').val(''); $('input[name="differentialVal...
<vulnerable_code> (r'P((\d*(\.\d+)?[YyMmWwDd]){1,3}(T(\d*(\.\d+)?[HhMmSs]){,3})?|' r'T(\d*(\.\d+)?[HhMmSs]){,3})', Literal.Date), (r'[+-]?(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float), (r'[+-]?(\d+)*\.\d+%?', Number.Float), (r'0x[0-9a-fA-F]+', Number.Hex), ...
<vulnerable_code> (r'(?:<PRIVATE|PRIVATE>)\s', Keyword.Namespace), # strings (r'"""\s+(?:.|\n)*?\s+"""', String), (r'"(?:\\\\|\\"|[^"])*"', String), (r'\S+"\s+(?:\\\\|\\"|[^"])*"', String), (r'CHAR:\s+(?:\\[\\abfnrstv]|[^\\]\S*)\s', String.Char), ...
<vulnerable_code> (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), (r'"(\\\\|\\[^\\]|[^"\\])*"', String), (r"'\\.'|'[^\\]'|'\\\{#[0-9a-fA-F]{4}\}'", String.Char), (r'".*``.*``.*"', String.Interpol), (r'(\.)([a-z_]\w*)', bygroups(Ope...
<vulnerable_code> (r'.', Comment.Multiline), ], 'deffunc': [ (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)', bygroups(Whitespace, Text, Whitespace, Punctuation, Whitespace, Name.Function, Punctuation, Text, Punctuation...
<vulnerable_code> 'logos_classname'), (r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)', bygroups(Keyword, Text, Name.Class)), (r'(%config)(\s*\(\s*)(\w+)(\s*=\s*)(.*?)(\s*\)\s*)', bygroups(Keyword, Text, Name.Variable, Text, String, Text)), (r'(%ctor)(\...
<vulnerable_code> # see doc for handling first name arg: /directives/evoque/ # + minor inconsistency: the "name" in e.g. $overlay{name=site_base} # should be using(PythonLexer), not passed out as String (r'(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?' ...
<vulnerable_code> bygroups(Name.Attribute, Operator, Name.Variable.Global, Punctuation)), (r'(\.probe)(\s*=\s*)(\{)', bygroups(Name.Attribute, Operator, Punctuation), 'probe'), (r'(\.\w+\b)(\s*=\s*)([^;]*)(\s*;)', bygroups(Name.Attribute, Operator, using(thi...
<vulnerable_code> _esd = gf_odf_desc_esd_new(SLPredef_MP4); if (!_esd) return GF_OUT_OF_MEM; _esd->decoderConfig->bufferSizeDB = 20; _esd->decoderConfig->objectTypeIndication = GF_CODECID_BIFS_V2; _esd->decoderConfig->streamType = GF_STREAM_SCENE; } avcc = gf_isom_avc_config_get(file, track, 1); if (level) a...
<vulnerable_code> len = MIN (256, width-col); ret = kodak_65000_decode (buf, len); for (i=0; i < len; i++) if ((RAW(row,col+i) = curve[ret ? buf[i] : (pred[i & 1] += buf[i])]) >> 12) derror(); } } }<commit_title>[PATCH] CVE-2017-1438 credits; fix for Kodak 65000 out of bounds<commit_descriptio...
<vulnerable_code> # with an exception with self.assertRaisesRegex(tarfile.ReadError, "file could not be opened successfully"): with tarfile.open(support.findfile('recursion.tar')) as tar: tar.getmembers() class MiscReadTestBase(CommonReadTest): def requires_name_attribute...
<vulnerable_code> utils.is_in_or_equal(abs_path, blocked_path) for blocked_path in blocks.blocked_paths ) if in_blocklist: raise HTTPException(403, f"File not allowed: {path_or_url}.") in_app_dir = utils.abspath(app.cwd) in abs_path.par...
<vulnerable_code>import os import sys import tempfile from pathlib import Path from unittest.mock import patch response = test_client.get("/") assert response.status_code == 200 demo.close()<commit_title>[PATCH] Don't allow dotfiles for /file= route (#4303)<commit_description>* Don't allow dotfiles or file...
<vulnerable_code> request.set_time_zone(QTimeZone::systemTimeZoneId().toStdString()); auto ret = request_launch(parser); if (!MP_SETTINGS.get_as<bool>(mounts_key)) { cout << fmt::format("Skipping '{}' mount due to disabled mounts feature\n", mp::home_automount_dir); } else if (ret == Ret...
<vulnerable_code> EXPECT_THAT(cout_stream.str(), HasSubstr("Skipping 'Home' mount due to disabled mounts feature\n")); } TEST_F(Client, start_cmd_forwards_verbosity_to_subcommands) { const grpc::Status ok{}, aborted = aborted_start_status({petenv_name()});<commit_title>[PATCH] [launch] only warn about mounts on...
<vulnerable_code> return False self.command, self.path = command, path # gh-87389: The purpose of replacing '//' with '/' is to protect against # open redirect attacks module which could be triggered if the path # starts with '//' because web clients treat //path as an ab...
<vulnerable_code> }, openLocalClient: function(path) { var scheme = 'nc://'; var command = 'open'; var uid = OC.getCurrentUser().uid; var url = scheme + command + '/' + uid + '@' + window.location.host + OC.encodePath(path); window.location.href = url; }, /**<commit_title>[PATCH] Require a toke...
<vulnerable_code> return -ENOMEM; spin_lock_init(&state->rx_kfifo_lock); if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL)) return -ENOMEM; state->dev = dev; sd = &state->sd;<commit_title>[PATCH] media: rc: prevent memory leak in cx23888_ir_probe<commit_description>In cx23888_ir_probe if ...
<vulnerable_code> return (hasProp (statusCode) (fs) ? fs[statusCode] : f) (res); }; // mergeUrls :: Url -> Any -> String const mergeUrls = base => input => ( typeof input === 'string' ? new URL (input, base).href : base ); // overHeaders :: (Request, Array2 String String -> Array2 String String) // ...
<vulnerable_code> assertResolves (fl.map (fn.redirectAnyRequest) (mockResponse ({}))) (getRequest), assertResolves (fl.map (fn.redirectAnyRequest) (getResponse (301) ('ftp://xxx'))) (fn.Request ({}) ('ftp://xxx/') (fn.emptyStream)), assertResolves (fl.map (fn.redirectAnyRequest) (...
<vulnerable_code>static void hash_object_body(const struct git_hash_algo *algo, git_hash_ctx *c, const void *buf, unsigned long len, struct object_id *oid, char *hdr, int *hdrlen) { algo->init_fn(c); algo->update_fn(c, hdr, *hdrlen); } static void write_object_file_prepare(const struct git_ha...
<vulnerable_code> double doubleinfo; while(ptr && *ptr) { if('%' == *ptr) { if('%' == ptr[1]) { /* an escaped %-letter */ fputc('%', stream);<commit_title>[PATCH] tool_writeout: fixed a buffer read overrun on --write-out<commit_description>If a % ended the statement, the string's trailing ...
<vulnerable_code>{ if(!m_pDataFile) { return 0; } // load it if needed if(!m_pDataFile->m_ppDataPtrs[Index]) { void CDataFileReader::ReplaceData(int Index, char *pData) { // make sure the data has been loaded GetDataImpl(Index, 0); void CDataFileReader::UnloadData(int Index) { if(Index < 0) return; // m...
<vulnerable_code> static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu) { } static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)<commit_title>[PATCH] KVM: x86: do not report a vCPU as preempted outside<commit_description><fixed_code> static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu) { if (to_svm(vcpu...
<vulnerable_code> return; handle_interrupt_nmi_irqoff(vcpu, gate_offset(desc)); } static void vmx_handle_exit_irqoff(struct kvm_vcpu *vcpu)<commit_title>[PATCH] KVM: x86: do not report a vCPU as preempted outside<commit_description><fixed_code> return; handle_interrupt_nmi_irqoff(vcpu, gate_offset(desc)); vcpu...
<vulnerable_code> STATS_DESC_COUNTER(VCPU, nested_run), STATS_DESC_COUNTER(VCPU, directed_yield_attempted), STATS_DESC_COUNTER(VCPU, directed_yield_successful), STATS_DESC_ICOUNTER(VCPU, guest_mode) }; struct kvm_memslots *slots; static const u8 preempted = KVM_VCPU_PREEMPTED; if (!(vcpu->arch.st.msr_val & KVM_...
<vulnerable_code> while (en.hasMoreElements()) { JarEntry je = en.nextElement(); java.io.File f = new File(fout, je.getName()); if (je.isDirectory()) { f.mkdirs(); continue;<commit_title>[PATCH] vuln-fix: Zip Slip Vulnerability<commit_description>This fixes a Zip...
<vulnerable_code> if(frm.doc.status==="Open") { frm.add_custom_button(__("Close"), function() { frm.set_value("status", "Closed"); frm.save(); }); } else if (frm.doc.status !== "Linked") { frm.add_custom_button(__("Reopen"), function() { frm.set_value("status", "Open"); frm.save(); }); ...
<vulnerable_code> "sent_or_received","recipients", "subject", "communication_medium", "communication_type", "sender", "seen", "reference_doctype", "reference_name", "has_attachment" ], filters: [["status", "=", "Open"]],<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix s...
<vulnerable_code> update_modified=False) mark_as_seen_unseen(name, action) @frappe.whitelist() def mark_as_trash(communication): """set email status to trash"""<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix permission issue in commun...
<vulnerable_code> accounts.forEach((account) => { let email_account = (account.email_id == "All Accounts") ? "All Accounts" : account.email_account; let route = ["List", "Communication", "Inbox", email_account].join('/'); if (!divider) { this.get_divider().appendTo($dropdown); divider = true; } ...
<vulnerable_code> this.filters = this.get_inbox_filters(); } get is_sent_emails() { const f = this.filter_area.get() .find(filter => filter[1] === 'sent_or_received'); return f && f[3] === 'Sent'; } render() { this.emails = this.data; this.render_inbox_view(); } </a> </span> </div> <di...
<vulnerable_code> }, freeze: true, callback: function(r) { frappe.msgprint(__("Email has been moved to Account {0}", [values.email_account])); frm.reload_doc(); } }); }<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untransl...
<vulnerable_code> setup_defaults() { super.setup_defaults(); this.email_account = frappe.get_route()[3]; this.page_title = this.email_account; this.filters = this.get_inbox_filters(); this.render_tags(); } /* render() { this.emails = this.data; this.render_inbox_view(); } render_inbox_view() { le...
<vulnerable_code> d.show(); }, show_move_dialog: function(frm){ var lib = "frappe.email"; var d = new frappe.ui.Dialog ({ title: __("Move"), return { "filters": { "name": ["!=", frm.doc.email_account], } } } }], primary_action_label: __("Move"), pri...
<vulnerable_code> @frappe.whitelist() def mark_as_closed_open(communication, action): """set status to open or close""" if action == "Close": frappe.db.set_value("Communication", communication, "status", "Closed") else: @frappe.whitelist() def move_email(communication, email_account): """move email to another e...
<vulnerable_code> accounts.forEach((account) => { let email_account = (account.email_id == "All Accounts") ? "All Accounts" : account.email_account; let route = ["List", "Communication", "Inbox", email_account].join('/'); let display_name = (account.email_id == "All Accounts" || account.email_id == "Sent Mail...
<vulnerable_code> } render_header() { this.$result.find('.list-row-head').remove() this.$result.prepend(this.get_header_html()); } const communication_date = comment_when(email.communication_date, true); const status = email.status == "Closed" ? `<span class="fa fa-check fa-large" title="${__(email.statu...
<vulnerable_code> @frappe.whitelist() def move_email(communication, email_account): """Move email to another email_account""" frappe.db.set_value("Communication", communication, "email_account", email_account) @frappe.whitelist() def mark_as_trash(communication): """Set email status to trash""" frappe.db.set_value...
<vulnerable_code> }, mark_as_closed_open: function(frm) { var action = frm.doc.status == "Open" ? "Close" : "Open"; return frappe.call({ method: "frappe.email.inbox.mark_as_closed_open", args: { communication: frm.doc.name, action: action }, freeze: true, callback: function(r) {<commit_tit...
<vulnerable_code> mark_as_seen_unseen(name, action) @frappe.whitelist() def mark_as_closed_open(communication, action): """Set status to open or close""" if action == "Close": frappe.db.set_value("Communication", communication, "status", "Closed") else: frappe.db.set_value("Communication", communication, "s...
<vulnerable_code> }, show_move_dialog: function(frm) { var lib = "frappe.email"; var d = new frappe.ui.Dialog ({ title: __("Move"), fields: [{ "name": ["!=", frm.doc.email_account], "enable_incoming": ["=", 1] } } } }], primary_action_label: __("Move"), email_account...
<vulnerable_code> let heart_class = liked_by.includes(user) ? 'liked-by' : 'text-extra-muted not-liked'; const seen = JSON.parse(doc._seen || '[]') .includes(user) ? '' : 'bold'; let subject_html = ` <input class="level-item list-row-checkbox hidden-xs" type="checkbox" data-name="${escape(doc.name)}"><c...
<vulnerable_code> this.email_account = frappe.get_route()[3]; this.page_title = this.email_account; this.filters = this.get_inbox_filters(); } setup_columns() { }); } get is_sent_emails() { const f = this.filter_area.get() .find(filter => filter[1] === 'sent_or_received'); render_header() { this.$...
<vulnerable_code> return '#Form/' + this.doctype + '/' + docname; } get_subject_html(doc) { let user = frappe.session.user; let subject_field = this.columns[0].df; let heart_class = liked_by.includes(user) ? 'liked-by' : 'text-extra-muted not-liked'; const seen = this.get_seen ? this.get_seen(doc) ...
<vulnerable_code><commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix permission issue in communication when changing status Fix functions in inbox view broken, like Tags View and Likes Add ability to move emails to another email account Add status ...
<vulnerable_code> primary_action_label: __("Move"), primary_action(values) { d.hide(); frappe.call({ method: "frappe.email.inbox.move_email", args: { communication: frm.doc.name, email_account: values.email_account }, freeze: true, callback: function() { window.hi...
<vulnerable_code> update_modified=False) mark_as_seen_unseen(name, action) @frappe.whitelist() def mark_as_closed_open(communication, status): """Set status to open or close""" frappe.db.set_value("Communication", communication, "status", status) @frappe.whitelist() def move_email(communication, email_accou...
<vulnerable_code>from frappe.model.base_document import get_controller ignore_values = { "Report": ["disabled", "prepared_report"], "Print Format": ["disabled"], "Notification": ["enabled"], "Print Style": ["disabled"]<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several ...
<vulnerable_code> const child_table_fields = frappe.meta.get_docfields(cdt).filter(standard_fields_filter); out[cdt] = child_table_fields; }); return out; } .map(df => ({ label: __(df.label), value: df.fieldname, checked: this.fields.find(f => f[0] === df.fieldname) })) }); doc...
<vulnerable_code> for this_file in file_list: this_file = cstr(this_file) this_file_path = os.path.join(get_backup_path(), this_file) if not is_file_old(this_file_path, older_than): if "-private-files" in this_file_path: backup_path_private_files = this_file_path elif "-files" in this_file_path:...
<vulnerable_code> def get_latest_backup_file(with_files=False): def get_latest(file_ext): file_list = glob.glob(os.path.join(get_backups_path(), file_ext)) return max(file_list, key=os.path.getctime) if file_list else None latest_file = get_latest('*.sql.gz') latest_site_config = get_latest('*.json') if wit...
<vulnerable_code> import os import json from datetime import datetime import frappe from frappe import _, conf self.backup_path_private_files = os.path.join(backup_path, for_private_files) def get_recent_backup(self, older_than): file_list = os.listdir(get_backup_path()) backup_path_files = None backup_path...
<vulnerable_code> "database": "*-{}-database.sql.gz", "public": "*-{}-files.tar", "private": "*-{}-private-files.tar", "config": "*-{}-site_config_backup.json" } def backup_time(file_path): return timegm(datetime.strptime(file_timestamp, "%Y%m%d_%H%M%S").utctimetuple()) def get_latest(file_pattern...
<vulnerable_code>def send_email(success, service_name, doctype, email_field, error_status=None): recipients = get_recipients(doctype, email_field) if not recipients: frappe.log_error("No Email Recipient found for {0}".format(service_name), "{0}: Failed to send backup status email".format(service_name)) return...
<vulnerable_code> results.append(data) from frappe.chat.util import squashify results = squashify(results) return results<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix permission issue in communication when changing status Fix function...
<vulnerable_code>from frappe import _ from six import string_types import re UNTRANSLATED_DOCTYPES = ["DocType", "Role"] if '%s' in query: query = query.replace('%s', ((txt or '') + '%')) return query<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable st...
<vulnerable_code> def tearDown(self): frappe.local.lang = 'en'<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix permission issue in communication when changing status Fix functions in inbox view broken, like Tags View and Likes Add ability to ...
<vulnerable_code> # method for reference_doctype filter @frappe.whitelist() def get_auto_repeat_doctypes(doctype, txt, searchfield, start, page_len, filters): res = frappe.db.get_all('Property Setter', { 'property': 'allow_auto_repeat',<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_descript...
<vulnerable_code> return ret @frappe.whitelist() def address_query(doctype, txt, searchfield, start, page_len, filters): from frappe.desk.reportview import get_match_cond <commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix permission issue in com...
<vulnerable_code> return has_same_user_permission def get_applicable_for_doctype_list(doctype, txt, searchfield, start, page_len, filters): linked_doctypes_map = get_linked_doctypes(doctype, True) <commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings ...
<vulnerable_code> communication_type = "Communication" and name = %s""", (reference_doctype, reference_name, name)) def get_communication_doctype(doctype, txt, searchfield, start, page_len, filters): user_perms = frappe.utils.user.UserPermissions(frappe.session.user) user_perms.build_permissions()<commit_title>...
<vulnerable_code> hide_filters = True, children = get_children(), # show_search = True, title = _('Blog') ) category = sanitize_html(frappe.local.form_dict.blog_category or frappe.local.form_dict.category) elif frappe.local.form_dict.txt: list_context.sub_title = _('Filtered by "{0}"').format(sanitize_html...
<vulnerable_code> doctype = frappe.local.form_dict.doctype context.parents = [{"route":"me", "title":_("My Account")}] context.meta = frappe.get_meta(doctype) context.update(get_list_context(context, doctype) or {}) context.doctype = doctype context.title = context.doctype context.txt = frappe.local.form_dict.txt...
<vulnerable_code> # for <body data-path=""> (remove leading slash) # path could be overriden in render.resolve_from_map context["path"] = frappe.local.request.path.strip('/ ') scheme = frappe.local.request.scheme else: context["path"] = path scheme = 'http' context.canonical = scheme + '://' + frappe.loca...
<vulnerable_code> filters = get_safe_filters(filters) try: fieldname = json.loads(fieldname) except (TypeError, ValueError): # name passed, not json pass # check whether the used filters were really parseable and usable # and did not just result in an empty string or dict if not filters: filters = None ...
<vulnerable_code> frappe.throw(_("No permission for {0}".format(doctype)), frappe.PermissionError) filters = get_safe_filters(filters) try: fields = json.loads(fieldname)<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix permission issue in...
<vulnerable_code> if not filters: filters = None value = frappe.get_list(doctype, filters=filters, fields=fields, debug=debug, limit=1) if as_dict: value = value[0] if value else {} else:<commit_title>[PATCH 01/28] Fix translation, permission & UI bugs<commit_description>Fix several untranslatable strings Fix p...
<vulnerable_code> return -ENOMEM; adis->buffer = kzalloc(burst_length + sizeof(u16), GFP_KERNEL); if (!adis->buffer) return -ENOMEM; tx = adis->buffer + burst_length; tx[0] = ADIS_READ_REG(adis->burst->reg_cmd);<commit_title>[PATCH] iio: imu: adis16400: fix memory leak<commit_description>In adis_update_scan_mo...
<vulnerable_code> //avoiding a useless round trip if (this.sequelize.options.databaseVersion === 0) { return this.sequelize.databaseVersion(_options).then(version => { this.sequelize.options.databaseVersion = semver.valid(version) ? version : this.defaultVersion; ...
<vulnerable_code> switch (message.parameterName) { case 'server_version': if (this.sequelize.options.databaseVersion === 0) { this.sequelize.options.databaseVersion = message.parameterValue; } break; case 'standard_conforming_strings':<commit_...
<vulnerable_code> authJwtRenewablePeriod: WIKI.config.auth.tokenRenewal, uploadMaxFileSize: WIKI.config.uploads.maxFileSize, uploadMaxFiles: WIKI.config.uploads.maxFiles, uploadScanSVG: WIKI.config.uploads.scanSVG } } }, WIKI.config.uploads = { maxFileSize: _...
<vulnerable_code>const crypto = require('crypto') module.exports = { /** */ generateHash(assetPath) { return crypto.createHash('sha1').update(assetPath).digest('hex') } }<commit_title>[PATCH] fix: force download of unsafe extensions<commit_description><fixed_code> const crypto = require('crypto') const pa...
<vulnerable_code> static async getAsset(assetPath, res) { try { const fileHash = assetHelper.generateHash(assetPath) const cachePath = path.resolve(WIKI.ROOTPATH, WIKI.config.dataPath, `cache/${fileHash}.dat`) if (await WIKI.models.assets.getAssetFromCache(assetPath, cachePath, res)) { r...
<vulnerable_code> $("a[target=navTab]", $p).each(function() { $(this).click(function(event) { var $this = $(this); var title = $this.attr("title") || $this.text(); if(title){ title = title.replace(/<[^>]*>/gi,""); } var titleHtml = $...
<vulnerable_code> } if (oldcode == -1) { *(*fill)++ = suffix[code]; firstchar = oldcode = code; return 1;<commit_title>[PATCH] fix possible OOB write in gif2tiff.c<commit_description><fixed_code> } if (oldcode == -1) { if (code >= clear) { fprintf(stderr, "bad input: code=%d is l...
<vulnerable_code> const ecma_value_t args_p[], /**< argument list */ const uint32_t args_count) /**< argument number */ { JERRY_UNUSED (args_count); ecma_promise_all_executor_t *executor_p = (ecma_promise_all_executor_t *) functi...
<vulnerable_code> return dict(zip(*info)) def remove_logical_volumes(*paths): """Remove one or more logical volume.""" if paths: lvremove = ('lvremove', '-f') + paths execute(*lvremove, attempts=3, run_as_root=True)<commit_title>[PATCH] Don't leak info from libvirt LVM backed instances<comm...
<vulnerable_code>const readFile = util.promisify(fs.readFile); const writeFile = util.promisify(fs.writeFile); const _browser = Symbol('browser'); const _convert = Symbol('convert'); const _destroyed = Symbol('destroyed'); const _getDimensions = Symbol('getDimensions'); const _getPage = Symbol('getPage'); const _getTe...
<vulnerable_code> this.type = type this.$element = $(element) this.options = this.getOptions(options) this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) ...
<vulnerable_code> break; case SO_SNDBUF: /* Don't error on this BSD doesn't and if you think about it this is right. Otherwise apps have to play 'guess the biggest size' games. RCVBUF/SNDBUF are treated in BSD as hints */ if (val > sysctl_wmem_max) val = sysctl_wmem_max; set_sndbuf: sk->sk_us...
<vulnerable_code> import csv from smb.SMBConnection import SMBConnection from smb.smb_structs import OperationFailure import MySQLdb except ImportError: logger.warning("Please install python dependencies.", exc_info=True) <commit_title>[PATCH] CO-2615 Remove unused import<commit_description><fixed_co...
<vulnerable_code>from vyper.builtin_interfaces import ERC20, ERC721 from vyper.cli.utils import extract_file_interface_imports from vyper.compiler import compile_code, compile_codes from vyper.exceptions import InterfaceViolation, StructureException def test_basic_extract_interface(): assert erc20.balanceOf(sende...
<vulnerable_code> # for ABI-encoded dynamic data, we must loop to unpack, since # the layout does not match our memory layout should_loop = ( src.encoding in (Encoding.ABI, Encoding.JSON_ABI) and src.typ.subtype.abi_type.is_dynamic() ) # if the subtype is...
<vulnerable_code> check_assign, check_external_call, dummy_node_for_type, get_element_ptr, ) from vyper.codegen.ir_node import Encoding, IRnode from vyper.codegen.types import InterfaceType, TupleType, get_type_for_exact_size from vyper.exceptions import StateAccessViolation, TypeCheckFailure retur...
<vulnerable_code>import vyper.utils as util from vyper.address_space import CALLDATA, DATA, MEMORY from vyper.ast.signatures.function_signature import FunctionSignature, VariableRecord from vyper.codegen.context import Context from vyper.codegen.core import get_element_ptr, getpos, make_setter from vyper.codegen.expr i...
<vulnerable_code> VYPER = auto() # abi encoded, default for args/return values from external funcs ABI = auto() # abi encoded, same as ABI but no clamps for bytestrings JSON_ABI = auto() # future: packed <commit_title>[PATCH] Merge pull request from GHSA-j2x6-9323-fp7h<commit_description>This co...
<vulnerable_code> } #if defined(CONFIG_UPDATEHUB_DTLS) int verify = TLS_PEER_VERIFY_NONE; sec_tag_t sec_list[] = { CA_CERTIFICATE_TAG }; int protocol = IPPROTO_DTLS_1_2; char port[] = "5684";<commit_title>[PATCH] updatehub: Require peer verification with DTLS<commit_description>DTLS without peer verification offer...
<vulnerable_code> type: integer description: Collaboration id required: true responses: 200: return {'msg': 'You lack the permission to do that!'}, \ HTTPStatus.UNAUTHORIZED collaboration.delete() return {"msg": f"Colla...
<vulnerable_code> minimum: 1 description: Role id required: true responses: 200: return {'msg': 'You can\'t delete a role from another ' 'organization'}, HTTPStatus.UNAUTHORIZED role.delete() return {"msg":...
<vulnerable_code> log.info(f" Removing run id={run.id}") run.delete() # permissions ok, delete... task.delete() <commit_title>[PATCH] Add flag whether linked resources should be deleted in delete<commit_description><fixed_code> log.info(f" Removing run id={run.id}") ...
<vulnerable_code> type: integer description: User id required: true responses: 200: return {'msg': 'You lack the permission to do that!'}, \ HTTPStatus.UNAUTHORIZED user.delete() log.info(f"user id={id} ...
<vulnerable_code>#include <string.h> #include "../../lib/sll.h" /* 5-tuple plus VLAN ID */ typedef struct flow_entry_data { union { break; case DLT_JUNIPER_ETHER: if (pkthdr->caplen < 5) return FLOW_ENTRY_INVALID; if (memcmp(pktdata, "MGC", 3)) warnx("No Magic ...
<vulnerable_code> } if ((pktdata[3] & JUNIPER_FLAG_EXT) == JUNIPER_FLAG_EXT) { if (datalen < 6) return 0; /* datalen too short */ eth_hdr_offset = ntohs(*((uint16_t*)&pktdata[4])); eth_hdr_offset += 6; /* MGC + flags + ext_total_len */ } else...
<vulnerable_code> l2_len = 4; /* MGC + flags (no header extensions) */ } /* fallthrough */ case DLT_EN10MB: /* l2_len will be zero if we did not fall through */ if (pkthdr->caplen < l2_len + sizeof(eth_hdr_t))<commit_title>[PATCH 1/6] Apply #616 fix to flows.c<commit_desc...
<vulnerable_code> if ((pktdata[3] & JUNIPER_FLAG_NO_L2) == JUNIPER_FLAG_NO_L2) { /* no L2 header present - eth_hdr_offset is actually IP offset */ uint32_t ip_hdr_offset = eth_hdr_offset; if (datalen < ip_hdr_offset + 1) return 0; if ((pktdata[ip_h...