text
stringlengths
79
3.72M
<vulnerable_code> s = run_inc_schema if request.args.get('include') == 'task' \ else run_schema return s.dump(run, many=False).data, HTTPStatus.OK @with_node def patch(self, id): run.status = data.get("status", run.status) run.save() return run_schema.dump(r...
<vulnerable_code># schema = CollaborationSchemaSimple(many=True) # return { # 'collaborations': schema.dump(db.Collaboration.get()).data # }, HTTPStatus.OK<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> # schema = CollaborationSchemaSi...
<vulnerable_code> log.debug(f" name: '{task.name}'") log.debug(f" image: '{task.image}'") return task_schema.dump(task, many=False).data, HTTPStatus.CREATED @staticmethod def __verify_container_permissions(container, image, collaboration_id): return {'msg': 'You lack the...
<vulnerable_code> user.save() return user_schema.dump(user).data, HTTPStatus.CREATED class User(UserBase): (self.r.v_org.can() and same_org) or same_user ): return user_schema.dump(user, many=False).data, HTTPStatus.OK else: return {'msg...
<vulnerable_code> Dumped page """ if self.is_included('metadata'): return schema.meta_dump(page) else: return schema.default_dump(page) <commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> Dumped page """ ...
<vulnerable_code>from vantage6.server import db from vantage6.common import logger_name from vantage6.common.globals import STRING_ENCODING from vantage6.server.model import Organization log = logging.getLogger(logger_name(__name__)) class HATEOASModelSchema(SQLAlchemyAutoSchema): """ This class is used to c...
<vulnerable_code> name: rule_id schema: type: integer description: Rule that is part of a role - in: query name: user_id schema: type: integer description: get roles for this user id ...
<vulnerable_code> schema: type: integer description: Get rules for a specific role - in: query name: include schema: q = q.join(db.role_rule_association).join(db.Role)\ .filter(db.Role.id == args['role_id']) ...
<vulnerable_code>class ConfigurationManager(object): """Class to maintain valid configuration settings. A configuration file contains at top level an `application` and/or `environments` key. The `environments` key can contain up to four keys: `dev`, `test`, `acc`, `prod`. e.g.: application: ...
<vulnerable_code> from vantage6.common import Singleton, error, Fore, Style, logger_name from vantage6.common.colors import ColorStreamHandler from vantage6.common.globals import DEFAULT_ENVIRONMENT, APPNAME from vantage6.common.configuration_manager import ( ConfigurationManager ) def __init__( self, ...
<vulnerable_code># STRING_ENCODING = "utf-8" DEFAULT_ENVIRONMENT = "application" APPNAME = "vantage6" MAIN_VERSION_NAME = "petronas"<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> # STRING_ENCODING = "utf-8" APPNAME = "vantage6" MAIN_VERSION_NAME = "petronas"
<vulnerable_code> """Lists all nodes in the default configuration directories.""" # FIXME: use package 'table' for this. click.echo("\nName"+(21*" ")+"Environments"+(21*" ")+"System/User") click.echo("-" * 70) configs, f1 = NodeContext.available_configurations(system_folders=True) for config in...
<vulnerable_code> @classmethod def from_external_config_file(cls, path): return super().from_external_config_file( cls.test_config_location(), "unittest", "application", True ) @staticmethod<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fi...
<vulnerable_code># DEFAULT_NODE_SYSTEM_FOLDERS = False DEFAULT_NODE_ENVIRONMENT = "application" # # INSTALLATION SETTINGS #<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> # DEFAULT_NODE_SYSTEM_FOLDERS = False # # INSTALLATION SETTINGS #
<vulnerable_code>from vantage6.common.globals import PING_INTERVAL_SECONDS from vantage6.server import db from vantage6.cli.context import ServerContext from vantage6.cli.globals import DEFAULT_SERVER_ENVIRONMENT from vantage6.server.model.base import DatabaseSessionManager, Database from vantage6.server.resource.commo...
<vulnerable_code>) from vantage6.server.model.base import Database from vantage6.server import ServerApp, run_dev_server from vantage6.cli.globals import ( DEFAULT_SERVER_ENVIRONMENT as S_ENV, DEFAULT_SERVER_SYSTEM_FOLDERS as S_FOL ) from vantage6.server.controller import fixture from vantage6.cli.configuration...
<vulnerable_code> Context object """ return super().from_external_config_file( cls.test_config_location(), "unittest", "application", True ) @staticmethod<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> Co...
<vulnerable_code># refresh token. MIN_REFRESH_TOKEN_EXPIRY_DELTA = 1 # Expiretime of JWT token in a test environment JWT_TEST_ACCESS_TOKEN_EXPIRES = datetime.timedelta(days=1) # Which resources should be initialized. These names correspond to the # file-names in the resource directory RESOURCES = ['node', 'collaborat...
<vulnerable_code> # returns a list of configurations and failed inports def side_effect(system_folders): config = MagicMock(available_environments=["Application"]) config.name = "iknl" if not system_folders: return [[config], []] # check printe...
<vulnerable_code> container1.name = f"{APPNAME}-iknl-system" containers.list.return_value = [container1] config = MagicMock(available_environments=["application"]) config.name = "iknl" context.available_configurations.return_value = ([config], []) <commit_title>[PATCH 01/15] Upda...
<vulnerable_code> "config": "/some/path/" } file_ = configuration_wizard("node", "vtg6", "application", False) self.assertEqual(Path("/some/path/vtg6.yaml"), file_) file_ = configuration_wizard("server", "vtg6", "application", True) self.assertEqual(Path("/some/path/...
<vulnerable_code> return config def configuration_wizard(type_: str, instance_name: str, environment: str, system_folders: bool) -> Path: """ Create a configuration file for a node or server instance. Type of the instance. Either "node" or "server" instance_name : str ...
<vulnerable_code>from vantage6.common.globals import APPNAME from vantage6.cli.configuration_manager import (NodeConfigurationManager, ServerConfigurationManager) from vantage6.cli.globals import (DEFAULT_NODE_ENVIRONMENT as N_ENV, DEFAUL...
<vulnerable_code># DEFAULT_SERVER_SYSTEM_FOLDERS = True DEFAULT_SERVER_ENVIRONMENT = "prod" # # NODE SETTINGS # DEFAULT_NODE_SYSTEM_FOLDERS = False DEFAULT_NODE_ENVIRONMENT = "application" # # INSTALLATION SETTINGS #<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> # DEFAU...
<vulnerable_code> from vantage6.cli.context import NodeContext from vantage6.cli.globals import ( DEFAULT_NODE_ENVIRONMENT as N_ENV, DEFAULT_NODE_SYSTEM_FOLDERS as N_FOL ) from vantage6.cli.configuration_wizard import ( header = \ "\nName"+(21*" ") + \ "Environments"+(20*" ") + \ "S...
<vulnerable_code>) from vantage6.cli.rabbitmq import split_rabbitmq_uri from vantage6.cli.globals import (DEFAULT_SERVER_ENVIRONMENT, DEFAULT_SERVER_SYSTEM_FOLDERS) from vantage6.cli.context import ServerContext from vantage6.cli.configuration_wizard import ( select_configuration_...
<vulnerable_code> Raises ------ AssertionError If the environment is not valid. """ configuration = self.conf_class(config) if configuration.is_valid:<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> Raises ...
<vulnerable_code> f"{status:25} User " ) click.echo("-"*85) if len(f1)+len(f2): warning( f"{Fore.RED}Failed imports: {len(f1)+len(f2)}{Style.RESET_ALL}")<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> f"{status:25} Us...
<vulnerable_code> result.output, "\nName Status System/User\n" "-----------------------------------------------------\n" "iknl Offline System \n" "iknl Online User \n" ...
<vulnerable_code> running_node_names else stopped click.echo( f"{config.name:25}" f"{status:25} System " ) # user folders running_node_names else stopped click.echo( f"{config.name:25}" f"{status:25} User " ) ...
<vulnerable_code>from vantage6.common import logger_name from vantage6.common.globals import STRING_ENCODING from vantage6.server.model import Base from vantage6.server.resource.pagination import Page log = logging.getLogger(logger_name(__name__)) <commit_title>[PATCH 01/15] Updated marshmallow version<commit_descript...
<vulnerable_code> dict Dumped page """ if self.is_included('metadata'): return schema.page_dump(page) else: return schema.default_dump(page) def response(self, page: Page, schema: HATEOASModelSchema): """<commit_title>[PATCH 01/15] Updated ...
<vulnerable_code>from vantage6.common import logger_name from vantage6.common.globals import STRING_ENCODING from vantage6.server.model import Base from vantage6.server.resource.common.pagination import Page log = logging.getLogger(logger_name(__name__)) else: log.error("No API found?") def p...
<vulnerable_code> children = fields.Function(lambda obj: create_one_to_many_link( obj, link_to="task", link_from="parent_id" )) class ResultSchema(HATEOASModelSchema):<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> children = fields.Function(lambda obj: creat...
<vulnerable_code>log = logging.getLogger(logger_name(__name__)) def create_one_to_many_link(obj: Base, link_to: str, link_from: str): """ Create an API link to get objects related to a given object. <commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code> log = logging.getLogger...
<vulnerable_code> # verify the values self.assertEqual(result.json.get("name"), body["name"]) self.assertEqual(result.json.get("description"), body["description"]) self.assertEqual(len(result.json.get("rules")), 2) def test_create_role_as_root_for_different_organization(self): ...
<vulnerable_code> exclude = ("assigned_at", "started_at", "finished_at", "status", "task", "ports", "organization", "log", "input",) run_link = fields.Method("make_run_link") @staticmethod def make_run_link(obj): 'last_seen') class ResultSchema(HATEOASModelSc...
<vulnerable_code> role.rules.append(rule) role.save() return rule_schema.dump(role.rules, many=False), HTTPStatus.CREATED @with_user def delete(self, id, rule_id): # Ok jumped all hoopes, remove it.. role.rules.remove(rule) return rule_schema.dump(role.rules, ma...
<vulnerable_code> setattr(self, "run", lambda obj: self.create_hateoas("run", obj)) setattr(self, "task", lambda obj: self.create_hateoas("task", obj)) setattr(self, "port", lambda obj: self.create_hateoas("port", obj)) setattr(self, "parent_", lambda obj: self.create_hate...
<vulnerable_code> .replace(/([$&;|])/gu, "\\$1") .replace(/([()<>])/gu, "\\$1") .replace(/(["'`])/gu, "\\$1") .replace(/\{/gu, "\\{") .replace(/(?<=[:=])(~)(?=[\s+\-/0:=]|$)/gu, "\\$1"); } else if (quoted) { result = result.replace(/'/gu, `'\\''`);<commit_title>[PATCH] chore: partiall...
<vulnerable_code> n=0; quantum=0; for (x=0; x < (ssize_t) number_pixels; x+=2) { for (i=0; i < 4; i++) {<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/126<commit_description><fixed_code> n=0; quantum=0; ...
<vulnerable_code> case BGRAQuantum: packet_size=4; break; case CMYKQuantum: packet_size=4; break; case CMYKAQuantum: packet_size=5; break; default: break; } extent=MagickMax(image->columns,image->rows); quantum_info->pack=pack; } /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
<vulnerable_code> int col; bit_state_t BS; set_bit_state(&BS, (uint8_t *)ID->data + HUF->row_offsets.element[row]); for (col = 0; col < ID->columns; col++)<commit_title>[PATCH] X3F: check for data offset limit<commit_description><fixed_code> int col; bit_state_t BS; if (HUF->row_offsets.element[row] > I...
<vulnerable_code> return; } ND_TCHECK2(bp[0], sizeof(struct in_addr)); if (ndo->ndo_vflag > 1) ND_PRINT((ndo, "\n")); ND_PRINT((ndo, " Upstream Nbr: %s", ipaddr_string(ndo, bp))); ND_TCHECK2(bp[6], 2); if (ndo->ndo_vflag > 1) ND_PRINT((ndo, "\n")); ND_PRINT((ndo, " Hold time: ")); unsigned_relts_print(ndo...
<vulnerable_code> if (family == AF_INET) { struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; sin->sin_family = AF_INET; sin->sin_port = 0 /* skb->h.uh->source */; sin->sin_addr.s_addr = ip_hdr(skb)->saddr; memset(sin->sin_zero, 0, sizeof(sin->sin_zero)); *addr_len = sizeof(*sin); if (isk->c...
<vulnerable_code> if (setOptimizer) { em.createNativeQuery("ALTER SESSION SET optimizer_mode = FIRST_ROWS").executeUpdate(); } Sort sort = createSort(colToSort, sortingDirection, lowerSortCol); Query query = commonFilterService.addFilterAndCreateQuery(stringQuery, filters, s...
<vulnerable_code> import static ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentFilterTypes.QLConstants.*; public enum DeploymentFilterTypes { ID("Id", DEPLOYMENT_QL_ALIAS + ".id", FilterType.IntegerType, true), BUILD_SUCCESS("Build success", DEPLOYMENT_QL_ALIAS + ".buildSuccess", FilterType.booleanTyp...
<vulnerable_code><commit_title>[PATCH] move order creation into dedicated class for ShakedownTest<commit_description><fixed_code> package ch.puzzle.itc.mobiliar.business.deploy.entity; import ch.puzzle.itc.mobiliar.business.domain.commons.Sort; import ch.puzzle.itc.mobiliar.business.domain.commons.Sort.Order; import ...
<vulnerable_code><commit_title>[PATCH] move order creation into dedicated class for ShakedownTest<commit_description><fixed_code> package ch.puzzle.itc.mobiliar.business.deploy.entity; public interface SortableColumn { String getFilterTabColumnName(); }
<vulnerable_code>import lombok.Builder; import lombok.Singular; import java.io.Serializable; import java.util.Collections; import java.util.Iterator; import java.util.List; @Builder public final class Sort implements Iterable<Sort.Order>, Serializable { public static final SortingDirectionType DEFAULT_DIRECTION ...
<vulnerable_code>import ch.puzzle.itc.mobiliar.business.security.entity.Action; import ch.puzzle.itc.mobiliar.business.security.entity.Permission; import ch.puzzle.itc.mobiliar.business.security.interceptor.HasPermission; import ch.puzzle.itc.mobiliar.business.shakedown.entity.ShakedownTestEntity; import ch.puzzle.itc....
<vulnerable_code><commit_title>[PATCH] move order creation into dedicated class for ShakedownTest<commit_description><fixed_code> package ch.puzzle.itc.mobiliar.business.shakedown.entity; import ch.puzzle.itc.mobiliar.business.domain.commons.Sort; import ch.puzzle.itc.mobiliar.business.domain.commons.Sort.Order; impo...
<vulnerable_code> import ch.puzzle.itc.mobiliar.business.deploy.entity.FilterType; public enum ShakedownTestFilterTypes { ID("Test Id", QLConstants.SHAKEDOWN_TEST_QL_ALIAS + ".id", FilterType.IntegerType), TRACKING_ID("Test tracking Id", QLConstants.SHAKEDOWN_TEST_QL_ALIAS + ".trackingId", FilterType.IntegerTy...
<vulnerable_code>import ch.puzzle.itc.mobiliar.builders.DeploymentEntityBuilder; import ch.puzzle.itc.mobiliar.builders.ReleaseEntityBuilder; import ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentEntity; import ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentState; import ch.puzzle.itc.mobiliar.busines...
<vulnerable_code> import ch.puzzle.itc.mobiliar.business.deploy.entity.CustomFilter; import ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentEntity; import ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentState; import ch.puzzle.itc.mobiliar.business.domain.commons.Sort.SortingDirectionType; import ch.puz...
<vulnerable_code> return(0); } if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) { if (count >= 4) { int retTIFFReadRawTile; /* Ignore EOI marker of JpegTables */ _TIFFmemcpy(buffer, jpt, count - 2);<commit_title>[PATCH] * tools/...
<vulnerable_code> def guard(dest, ev_args): next(dest) depth = 1 while True: ev = yield if ev[0] == "start": depth += 1 elif ev[0] == "end": depth -= 1 try: dest.send(ev) except StopIteration as exc: return exc.value ...
<vulnerable_code> ctx.exception ) class TestSAXDriver(unittest.TestCase): def setUp(self):<commit_title>[PATCH] xso: fix parser error handling<commit_description>guard() was incorrectly counting the depth when either of the following was true: - the error occured inside the first "start" event...
<vulnerable_code>{ register const struct rip6 *rp = (const struct rip6 *)dat; register const struct netinfo6 *ni; register u_int amt; register u_int i; int j; int trunc; if (ndo->ndo_snapend < dat) return; amt = ndo->ndo_snapend - dat; i = min(length, amt); if (i < (sizeof(struct rip6) - sizeof(struct neti...
<vulnerable_code> Parser parser = new Parser(new TomlFactory(), ioContext, new TomlStreamReadException.ErrorContext(ioContext.contentReference(), null), options, reader); try { return parser.parse(); } finally { if (TomlReadFeature.VALIDATE_NESTING_DEPTH.en...
<vulnerable_code>abstract class TomlMapperTestBase { protected static TomlFactory newTomlFactory() { return TomlFactory.builder() //.enable(TomlReadFeature.VALIDATE_NESTING_DEPTH) .build(); } <commit_title>[PATCH] reorder code<commit_description><fixed_code> abstract ...
<vulnerable_code> int ret; int chk_addr_ret; if (!sock_flag(sk, SOCK_ZAPPED)) return -EINVAL; if (addr_len < sizeof(struct sockaddr_l2tpip)) return -EINVAL; if (addr->l2tp_family != AF_INET) read_unlock_bh(&l2tp_ip_lock); lock_sock(sk); if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_l2t...
<vulnerable_code> /* 9. */ uint32_t indexed_position = ecma_number_to_uint32 (idx) * element_size + offset; JERRY_UNUSED (indexed_position); JERRY_UNUSED (element_type); JERRY_UNUSED (val);<commit_title>[PATCH] Fix memory leak in AtomicModifyWrite<commit_description>This patch fixes #4894. JerryScript-DCO-1....
<vulnerable_code><commit_title>[PATCH] Fix memory leak in AtomicModifyWrite<commit_description>This patch fixes #4894. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu<fixed_code> // Copyright JS Foundation and other contributors, http://js.foundation // // Licensed under the Apache License, V...
<vulnerable_code>import pandas as pd from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker import geoalchemy2 from sqlalchemy import Table, MetaData from sqlalchemy.ext.declarative import declarative_base import random limit=None, keys=None, ): if schema is not...
<vulnerable_code>import logging import random import smtplib import string import urllib from html import escape ) try: smtp: smtplib.SMTP if mailTLSMode == "SSL" or mailTLSMode == "TLS": smtp = smtplib.SMTP_SSL(mailServer, mailPort, myHostname) elif mailTLSMode == "STARTTLS"...
<vulnerable_code>from synapse.events.builder import EventBuilder from synapse.events.snapshot import EventContext from synapse.types import StateMap, get_domain_from_id from synapse.util.metrics import Measure if TYPE_CHECKING: from synapse.server import HomeServer ) async def is_host_in_room(self, ro...
<vulnerable_code> del env["PYTHONPATH"] if "PYTHONHOME" in env: del env["PYTHONHOME"] elif not nzo: # No modification return None return env <commit_title>[PATCH] Notification Script did not get environment variables<commit_description><fixed_code> del...
<vulnerable_code> """Run user's notification script""" if test: script = test.get("nscript_script") env = {"notification_parameters": test.get("nscript_parameters")} else: script = sabnzbd.cfg.nscript_script() env = {"notification_parameters": sabnzbd.cfg.nscript_parameters()}...
<vulnerable_code> var nextPage = pagination.get('page'); do { page = pages[nextPage]; nextPage++; } while (!page.enabled); pagination.set('page', nextPage); }, prevPage: function() {<commit_title>[PATCH] LPS-70561 Checking if the current page is valid before<commit_description><fixed_...
<vulnerable_code> ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); max_packets=(size_t) (number_pixels*viff_info.number_data_bands); } pixels=(unsigned char *) AcquireQuantumMemory(MagickMax(number_pixels, max_packets),bytes_per_pixel*sizeof(*pixels)); if (pixels =...
<vulnerable_code> (*e)->CallVoidMethod(e, c->session_context, sessionRemove, sessionId); (*javavm)->DetachCurrentThread(javavm); } void setup_session_context(JNIEnv *e, tcn_ssl_ctxt_t *c) {<commit_title>[PATCH] WFSSL-51 sessions not removed correctly<commit_description><fixed_code> (*e)->CallVoidMethod(e, ...
<vulnerable_code> decorateReply: false }) fastify.register(fastifyStatic, { root: opts.baseDir || path.join(__dirname, '..'), serve: false }) // Handler for external documentation files passed via $ref fastify.route({ url: '/*', method: 'GET', schema: { hide: true }, ...hooks, ...
<vulnerable_code> t.equal(res.headers.location, './static/index.html') }) test('should return silent log level of route /documentation', async (t) => { const fastify = Fastify() <commit_title>[PATCH] Merge pull request from GHSA-62jr-84gf-wmg4<commit_description>Signed-off-by: Matteo Collina <hello@matteocollina.co...
<vulnerable_code> fieldLabel: t('name'), length: 50, allowBlank: false, value: this.settings.gridConfigName ? this.settings.gridConfigName : defaultName }); var descriptionField = new Ext.form.TextArea({ for (var i = 0; i < list.length; i++) { ...
<vulnerable_code>export default function semverRegex() { return /(?<=^v?|\sv?)(?:(?:0|[1-9]\d*)\.){2}(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*)(?:\.(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*))*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b/gi; }<commit_title>[PATCH] Fix ReDoS vulnerability<commit_description><fixed_c...
<vulnerable_code> '2.7.2-foo+bar', '1.2.3-alpha.10.beta', '1.2.3-alpha.10.beta+build.unicorn.rainbow', 'foo 0.0.0 bar 0.0.0' ]; test('matches semver versions on test', t => { `v1.1.3-0aa${postfix}$`, semverRegex() ); });<commit_title>[PATCH] Fix ReDoS vulnerability<commit_description><fixed_code> '2.7.2-foo+b...
<vulnerable_code> }, 250) }, 250) }) })<commit_title>[PATCH] add unit tests for plugins<commit_description><fixed_code> }, 250) }, 250) }) QUnit.test('should raise exception to avoid xss on target', function (assert) { assert.expect(1) assert.throws(function () { var templateHTM...
<vulnerable_code> .bootstrapCollapse('show') }) })<commit_title>[PATCH] add unit tests for plugins<commit_description><fixed_code> .bootstrapCollapse('show') }) QUnit.test('should raise exception to avoid xss on data-parent', function (assert) { assert.expect(1) assert.throws(function () { ...
<vulnerable_code> }) }) })<commit_title>[PATCH] add unit tests for plugins<commit_description><fixed_code> }) }) QUnit.test('should raise exception to avoid xss on data-container', function (assert) { assert.expect(1) assert.throws(function () { $('<button data-toggle="tooltip" data-contain...
<vulnerable_code> # init state self.__idle_id = 0 self.__prop_dict = {} try: self.__is_utf8 = (getpreferredencoding().lower() == 'utf-8') except: self.__lookup_table.set_page_size(size) def do_focus_out(self): mode = self.__prefs.get_value('com...
<vulnerable_code> ROS_WARN("Use of \"--split <MAX_SIZE>\" has been deprecated. Please use --split --size <MAX_SIZE> or --split --duration <MAX_DURATION>"); if (S < 0) throw ros::Exception("Split size must be 0 or positive"); opts.max_size = 1048576 * S; } } if(vm.count("m...
<vulnerable_code>#include "ecma-objects.h" #include "ecma-string-object.h" #include "jrt.h" #include "lit-char-helpers.h" ecma_value_t mapped_value, /**< mapped value */ ecma_value_t thisArg) /**< this arg */ { /* 7. */ ecma_length_t t...
<vulnerable_code> in_pdf = PdfReader(BytesIO(get_pdf_from_url(url, name=name))) in_pdf.trailer["/ID"] # removed to cope with missing cryptodome during commit check : len(in_pdf.pages)<commit_title>[PATCH] TST: add test for #1825<commit_description><fixed_code> in_pdf = PdfReader(BytesIO(get_pdf_from_url(...
<vulnerable_code> error = l2t_send(tdev, skb, l2e); if (error < 0) kfree_skb(skb); return error; } int iwch_cxgb3_ofld_send(struct t3cdev *tdev, struct sk_buff *skb) error = cxgb3_ofld_send(tdev, skb); if (error < 0) kfree_skb(skb); return error; } static void release_tid(struct t3cdev *tdev, u32 hwtid, stru...
<vulnerable_code> return `${Math.round(bytes / (1024 ** ii), 2)} ${sizes[ii]}`; } // Convert cars/vw/golf.png to golf.png function fullpath2filename(path) { return path.replace(/^.*[\\/]/, ''); } // Convert cars/vw/golf.png to cars/vw/ function fullpath2pathname(path) { const index = path.lastIndexOf('/');...
<vulnerable_code>} /** * get_desc() - Obtain pointer to a segment descriptor * @sel: Segment selector * * Given a segment selector, obtain a pointer to the segment descriptor. * * Returns: * * Pointer to segment descriptor on success. * * NULL on error. */ static struct desc_struct *get_desc(unsigned short ...
<vulnerable_code> parser_stack_pop_uint8 (context_p); lexer_next_token (context_p); if (context_p->token.type == LEXER_ASSIGN) { uint32_t flags = 0; #if ENABLED (JERRY_ES2015) if (JERRY_UNLIKELY (token == LEXER_LEFT_PAREN)) { flags = PARSER_PATTERN_GROUP_EXPR; } #endif /* ENABLED (JERRY_ES...
<vulnerable_code> const ERC165CheckerMock = artifacts.require('ERC165CheckerMock'); const ERC165MissingData = artifacts.require('ERC165MissingData'); const ERC165NotSupported = artifacts.require('ERC165NotSupported'); const ERC165InterfacesSupported = artifacts.require('ERC165InterfacesSupported'); }); }); co...
<vulnerable_code>#if ENABLED (JERRY_ES2015) if (re_ctx_p->flags & RE_FLAG_UNICODE) { if (*re_ctx_p->input_curr_p == LIT_CHAR_LEFT_BRACE) { re_ctx_p->input_curr_p++; if (re_ctx_p->input_curr_p < re_ctx_p->input_end_p && lit_char_is_hex_digit (*re_ctx_p->input_curr_p)) ...
<vulnerable_code><commit_title>[PATCH] Add missing end-of-string checks to RegExp parser in unicode<commit_description><fixed_code> // Copyright JS Foundation and other contributors, http://js.foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in complia...
<vulnerable_code> {text: t("date"), width: 120, sortable: true, dataIndex: 'date', editor: new Ext.form.DateField() }, {text: t("time"), width: 100, sortable: true, dataIndex: 'time', editor: new Ext.form.TimeField({ format: "H:i", ...
<vulnerable_code>import host_tools.cargo_build as host # pylint: disable=import-error COVERAGE_TARGET_PCT = 84.02 COVERAGE_MAX_DELTA = 0.05 CARGO_KCOV_REL_PATH = os.path.join(host.CARGO_BUILD_REL_PATH, 'kcov') <commit_title>[PATCH] Update max delta to fix AMD coverage.<commit_description>Signed-off-by: Andrei Sandu ...
<vulnerable_code> if (avcc) { sprintf(sdpLine, "a=fmtp:%d profile-level-id=%02X%02X%02X; packetization-mode=1", tkHint->rtp_p->PayloadType, avcc->AVCProfileIndication, avcc->profile_compatibility, avcc->AVCLevelIndication); } else { sprintf(sdpLine, "a=fmtp:%d profile-level-id=%02X%02X%02X; packetization-mode=...
<vulnerable_code> while(!foundStartXref && mStream->NotEnded()) { PDFObjectCastPtr<PDFSymbol> startxRef(mObjectParser.ParseNewObject()); foundStartXref = startxRef.GetPtr() && (startxRef->GetValue() == scStartxref); } <commit_title>[PATCH] Found NP dereference in pdf parser<commit_description><fixed_cod...
<vulnerable_code> try: port = int(port) if port < 1 or port > 65535: logger.warning("Contact port for agent %s is not a number between 1 and got: %s.", agent_id, port) port = None except ValueError: logger.war...
<vulnerable_code> */ function validateLink(url) { var BAD_PROTOCOLS = [ 'vbscript', 'javascript', 'file' ]; var str = url.trim().toLowerCase(); // Care about digital entities "javascript&#x3A;alert(1)" str = utils.replaceEntities(str);<commit_title>[PATCH] Outlaw data: URLs by default<commit_description>See #2...
<vulnerable_code> // Validate paths supplied by the user in order to avoid "arbitrary command execution" var validPath = function (filename){ var filter = /[`!@#$%^&*()_+\-=\[\]{};':"|,<>?~]/; if (filter.test(filename)){ console.log('\nInvalid characters inside the path to the browser\n'); return<commit_tit...
<vulnerable_code> } } // currently only active for LIST_0 due to have no B frames iErr = CreatePicBuff (pCtx, &pCtx->pPicBuff[LIST_0], iPicQueueSize, kiPicWidth, kiPicHeight); if (iErr != ERR_NONE)<commit_title>[PATCH] dpb uninitial crash for EC<commit_description><fixed_code> } } pCtx->pPreviousDe...
<vulnerable_code> :copyright: (c) 2010 by Thadeus Burgess. :license: BSD, see LICENSE for more details. """ def iteritems_wrapper(mappingorseq): of 0 indicates that the cache never expires. """ def __init__(self, default_timeout=300): self.default_timeout = default_...