text
stringlengths
79
3.72M
<vulnerable_code> keep_quoted: true, reserved: [ 'fullpage', // options 'menu', 'anchors',<commit_title>[PATCH] - Fixed bug: jquery adaptor didnt work<commit_description><fixed_code> keep_quoted: true, reserv...
<vulnerable_code> rkeylen = strlen(rkey); /* key is valid */ if(nad_find_attr(nad, 0, -1, "type", "valid") >= 0) { log_write(out->s2s->log, LOG_NOTICE, "[%d] [%s, port=%d] outgoing route '%s' is now valid%s%s", out->fd->fd, out->ip, out->port, rkey, (out->s->flags & SX_SSL_WRAPPER) ? ", TLS negotiat...
<vulnerable_code>from synapse.events import EventBase, relation_from_event from synapse.events.builder import EventBuilder from synapse.events.snapshot import EventContext from synapse.events.validator import EventValidator from synapse.handlers.directory import DirectoryHandler from synapse.logging import opentracing ...
<vulnerable_code> * \param ip_len Equal to 0 if the packet is not a fragment (IP length * is then inferred from the L2 length), non 0 if the packet is a 1st * fragment. */ static void uncompress_hdr_iphc(uint8_t *buf, uint16_t buf_size, uint16_t ip_len) { uint8_t tmp, iphc0, iphc1, nhc; context = addr_contex...
<vulnerable_code> template = conn.extra_dejson.get("principal", "hive/_HOST@EXAMPLE.COM") if "_HOST" in template: template = utils.replace_hostname_pattern(utils.get_components(template)) proxy_user = self._get_proxy_user() jdbc_url +=...
<vulnerable_code> # Verify assert "hive.server2.proxy.user=a_user_proxy" in result[2]<commit_title>[PATCH] Sanitize beeline principal parameter<commit_description>Similar to other parameters of Beeline, principal should not contain the semicolon.<fixed_code> # Verify assert "hive.server...
<vulnerable_code> Macho_Binary_t** macho_parse(const char *file) { FatBinary* fat = Parser::parse(file).release(); auto** c_macho_binaries = static_cast<Macho_Binary_t**>( malloc((fat->size() + 1) * sizeof(Macho_Binary_t**))); for (size_t i = 0; i < fat->size(); ++i) { Binary* binary = fat->at(i); ...
<vulnerable_code> switch(architecture_) { case CPU_TYPES::CPU_TYPE_X86: { entry = reinterpret_cast<const details::x86_thread_state_t*>(state_.data())->eip; break; } case CPU_TYPES::CPU_TYPE_X86_64: { entry = reinterpret_cast<const details::x86_thread_state64_t*>(state...
<vulnerable_code>from django.test import override_settings from zulip_bots.custom_exceptions import ConfigValidationError from zerver.actions.realm_settings import do_set_realm_property from zerver.actions.streams import do_change_stream_permission from zerver.actions.users import do_change_can_create_users, do_change...
<vulnerable_code> CannotDeactivateLastUserError, JsonableError, MissingAuthenticationError, OrganizationOwnerRequired, RateLimited, ) if role is not None and target.role != role: # Require that the current user has permissions to # grant/remove the role in question. access_user_...
<vulnerable_code>import { Meteor } from 'meteor/meteor'; import Logger from '/imports/startup/server/logger'; const allowRecentMessages = (eventName, message) => { const { userId, meetingId, time, rate, state, } = message; Logger.debug(`ExternalVideo Streamer auth allowed userId: ${userId},...
<vulnerable_code> httpie_session_headers = None if args.session or args.session_read_only: httpie_session = get_httpie_session( config_dir=env.config.directory, session_name=args.session or args.session_read_only, host=args.headers.get('Host'), if httpie_session: ...
<vulnerable_code>import json import os from pathlib import Path from typing import Union from . import __version__ from .compat import is_windows pass class BaseConfigDict(dict): name = None helpurl = None def is_new(self) -> bool: return not self.path.exists() def load(self): co...
<vulnerable_code>from httpie.cli.argparser import HTTPieManagerArgumentParser from httpie import __version__ COMMANDS = { 'plugins': { 'help': 'Manage HTTPie plugins.', 'List all installed HTTPie plugins.' ], }, } ) for command, properties in definitions.items(): i...
<vulnerable_code>import argparse from httpie.context import Environment from httpie.manager.plugins import PluginInstaller from httpie.status import ExitStatus from httpie.manager.cli import missing_subcommand, parser MSG_COMMAND_CONFUSION = '''\ This command is only for managing HTTPie plugins. '''.rstrip("\n").form...
<vulnerable_code><commit_title>[PATCH] Implement new style cookies<commit_description><fixed_code> import argparse from typing import TypeVar, Callable, Tuple from httpie.sessions import SESSIONS_DIR_NAME, Session, get_httpie_session from httpie.status import ExitStatus from httpie.context import Environment from http...
<vulnerable_code>import re from http.cookies import SimpleCookie from pathlib import Path from typing import Iterable, Optional, Union from urllib.parse import urlsplit from requests.auth import AuthBase from requests.cookies import RequestsCookieJar, create_cookie from .cli.dicts import HTTPHeadersDict from .config...
<vulnerable_code>from http.cookiejar import parse_ns_headers from pathlib import Path from pprint import pformat from typing import Any, List, Optional, Tuple, Callable, Iterable, TypeVar import requests.auth return unwrap_context(context) else: return exc<commit_title>[PATCH] Implement new style c...
<vulnerable_code>tests_require = [ 'pytest', 'pytest-httpbin>=0.0.6', 'responses', ] dev_require = [<commit_title>[PATCH] Implement new style cookies<commit_description><fixed_code> tests_require = [ 'pytest', 'pytest-httpbin>=0.0.6', 'pytest-lazy-fixture>=0.0.6', 'responses', ] dev_require ...
<vulnerable_code>import pytest from pytest_httpbin import certs from .utils import HTTPBIN_WITH_CHUNKED_SUPPORT_DOMAIN, HTTPBIN_WITH_CHUNKED_SUPPORT from .utils.plugins_cli import ( # noqa broken_plugin, dummy_plugin,<commit_title>[PATCH] Implement new style cookies<commit_description><fixed_code> import pytes...
<vulnerable_code>"""Test data""" from pathlib import Path from httpie.encoding import UTF8 from httpie.output.formatters.xml import pretty_xml, parse_xml JSON_FILE_PATH = FIXTURES_ROOT / 'test.json' JSON_WITH_DUPE_KEYS_FILE_PATH = FIXTURES_ROOT / 'test_with_dupe_keys.json' BIN_FILE_PATH = FIXTURES_ROOT / 'test.bin' X...
<vulnerable_code><commit_title>[PATCH] Implement new style cookies<commit_description><fixed_code> import pytest from .utils import http @pytest.fixture def remote_httpbin(httpbin_with_chunked_support): return httpbin_with_chunked_support def _stringify(fixture): return fixture + '' @pytest.mark.parametri...
<vulnerable_code><commit_title>[PATCH] Implement new style cookies<commit_description><fixed_code> import pytest import shutil import json from httpie.sessions import SESSIONS_DIR_NAME from httpie.status import ExitStatus from tests.utils import DUMMY_HOST, httpie from tests.fixtures import SESSION_FILES_PATH, SESSION_...
<vulnerable_code>import pytest from httpie.status import ExitStatus from tests.utils import httpie from tests.utils.plugins_cli import parse_listing # No warning now, since it is uninstalled. data = parse_listing(httpie_plugins_success('list')) assert len(data) == 1 @pytest.mark.requires_installation d...
<vulnerable_code>import json import os import shutil from datetime import datetime from unittest import mock import pytest from .fixtures import FILE_PATH_ARG, UNICODE from httpie.encoding import UTF8 from httpie.plugins import AuthPlugin from httpie.plugins.builtin import HTTPBasicAuth from httpie.sessions import Se...
<vulnerable_code>import json import tempfile import warnings from io import BytesIO from pathlib import Path from typing import Any, Optional, Union, List, Iterable from httpie.status import ExitStatus from httpie.config import Config from httpie.context import Environment # pytest-httpbin currently does not support ...
<vulnerable_code> handler.end_headers() @pytest.fixture(scope="function") def http_server(): """A custom HTTP server implementation for our tests, that is<commit_title>[PATCH] Implement new style cookies<commit_description><fixed_code> handler.end_headers() @TestHandler.handler('GET', '/cookies/set-and-r...
<vulnerable_code> package com.google.refine.extension.database; public class DatabaseConfiguration { private String connectionName; + databaseSchema + ", useSSL=" + useSSL + "]"; } }<commit_title>[PATCH] Merge pull request from GHSA-qqh2-wvmv-h72m<commit_description><fixed_code> package com....
<vulnerable_code> Class.forName(type.getClassPath()); DriverManager.setLoginTimeout(10); String dbURL = getDatabaseUrl(databaseConfiguration); connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(), databaseConfiguratio...
<vulnerable_code> return connection; } } String dbURL = getDatabaseUrl(databaseConfiguration); Class.forName(type.getClassPath()); // logger.info("*** type.getClassPath() ::{}, {}**** ", type.getClassPath()); } private String ...
<vulnerable_code>import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; } public static String getDatabaseUrl(DatabaseConfiguration dbConfig) { return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + ":" + d...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-qqh2-wvmv-h72m<commit_description><fixed_code> package com.google.refine.extension.database; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; public class DatabaseConfigurationTest { @Test public void testTo...
<vulnerable_code> size_t source_size; uint8_t *source_p = jerry_port_read_source (path_str_p, &source_size); /* Revert the error message. */ *path_str_end_p = ':'; <commit_title>[PATCH] Fix unavailable source file handling in<commit_description><fixed_code> size_t source_size; ...
<vulnerable_code> pj_scan_get_until_ch(scanner, ']', &node->content); while (pj_scan_strcmp(scanner, "]]>", 3)) { pj_str_t dummy; pj_scan_get_until_ch(scanner, ']', &dummy); } node->content.slen = scanner->curptr - node->content.ptr;<commit_title>[PATCH] Merge pull request from GHSA-5x45-qp78-g4p4<commit_d...
<vulnerable_code> if shell is None: shell = self.USE_SHELL cmd_not_found_exception = FileNotFoundError maybe_patch_caller_env = contextlib.nullcontext() if os.name == "nt": if kill_after_timeout is not None: raise GitCommandError( ...
<vulnerable_code> import base64 import pickle import bz2 import flask @XMLRPC.register def checkin(pickledata): config = pickle.loads(bz2.decompress(base64.urlsafe_b64decode(pickledata))) r, message = read_host_config(SESSION, config) if r is not None: return message + 'checked in successful'<comm...
<vulnerable_code> ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val); ecma_value_t ret_value = ECMA_VALUE_EMPTY; JMEM_DEFINE_LOCAL_ARRAY (pass_value_list_p, len * element_size, lit_utf8_byte_t); lit_utf8_byte_t *pass_value_p = pass_value_list_p;<commit_title>[PATCH] Fix for null pointer de...
<vulnerable_code>#include <sys/wait.h> #include <sys/eventfd.h> #include <sys/signalfd.h> #include <sys/capability.h> #include <sys/prctl.h> #include <linux/sched.h> die_with_error ("capset failed"); } /* Else, we try unprivileged user namespaces */ /* We need the process to be dumpable, or we can't ac...
<vulnerable_code> self._test_mapping_file_plain() def _test_mapping_file_plain(self): unichrs = lambda s: ''.join(map(chr, map(eval, s.split('+')))) urt_wa = {} with self.open_mapping_file() as f: for line in f: if not line: break ...
<vulnerable_code> */ dentry = file->f_path.dentry; if (strcmp(dentry->d_name.name, "ipc_flood_count") && strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) return -EINVAL; if (!strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) flood_duration_test = true;<commit_title>[PATCH] ASoC: SOF: Fix memory l...
<vulnerable_code> while ( fscanf(sfd,"%lg %lg %c", &cp.x, &cp.y, &cp.ty )==3 ) { if ( cur!=NULL ) { if ( cur->spiro_cnt>=cur->spiro_max ) cur->spiros = realloc(cur->spiros,(cur->spiro_max+=10)*sizeof(spiro_cp)); cur->spiros[cur->spiro_cnt++] = cp; } } if ( cur!=NULL && (cur->spiros[cur->spiro_c...
<vulnerable_code> /* Fix up some gunk from really old versions of the sfd format */ SFDCleanupAnchorClasses(&sf->sf); if ( sf->sf.uni_interp==ui_unset ) sf->sf.uni_interp = interp_from_encoding(sf->sf.map->enc,ui_none); /* Fixup for an old bug */<commit_title>[PATCH] Fix for #4084 Use-after-free (heap...
<vulnerable_code> import SearchInput from "../SearchTokenizer/SearchInput.js"; /* global sortable */ /* global glpi_toast_error */ l.append(` <div class="member-details"> ${member_item} ${l.attr('data-name') || `${member_itemtype...
<vulnerable_code> No StartTLS is initiated when wanted, not required, SSL not available. """ xmlstream.ssl = None d = self.init.start() d.addCallback(self.assertEqual, None) tls = domish.Element(('urn:ietf:params:xml:ns:xmpp-tls', 'starttls')) self.xmlstream.featu...
<vulnerable_code> qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW); if (!qcadev->bt_en && data->soc_type == QCA_WCN6750) { dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n"); power_ctrl_enabled = false; } qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->de...
<vulnerable_code> {ERR_PACK(0, 0, GOST_R_ERROR_SETTING_PEER_KEY), "error setting peer key"}, {ERR_PACK(0, 0, GOST_R_INCOMPATIBLE_ALGORITHMS), "incompatible algorithms"}, {ERR_PACK(0, 0, GOST_R_INCOMPATIBLE_PEER_KEY), "incompatible peer key"}, {ERR_PACK(0, 0, GOST_R_INVALID_CIPHER), "invalid cipher"}, ...
<vulnerable_code> int exp_len = 0, iv_len = 0; unsigned char *exp_buf = NULL; int key_is_ephemeral = 0; switch (data->cipher_nid) { case NID_magma_ctr: goto err; } if ((*out_len = i2d_PSKeyTransport_gost(pst, out ? &out : NULL)) > 0) ret = 1; err: OPENSSL_cleanse(expkey...
<vulnerable_code> // The current match-position is stord in these variables: linenr_T lnum; // line number, relative to first line char_u *line; // start of current line char_u *input; // current input, points into "regline" int need_clear_subexpr; // subexpressions still need to be cleared #ifde...
<vulnerable_code> case NFA_MARK_GT: case NFA_MARK_LT: { pos_T *pos = getmark_buf(rex.reg_buf, t->state->val, FALSE); // Compare the mark position to the match position, if the mark // exists and mark is set in reg_buf. if (pos != NULL && pos->lnum > 0)<commit_title>[PATCH] patch 8.2.3612: using...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 3611, /**/<commit_title>[PATCH] patch 8.2.3612: using freed memory with regexp using a mark<commit_description>Problem: Using freed memory with regexp using a mark. Solution: Get the line again after getting t...
<vulnerable_code> def test_get_dir_redirect_location_domain_injection_bug(self): """Ensure //evil.co/..%2f../../X does not put //evil.co/ in Location. //domain/ in a Location header is a redirect to a new domain name. https://github.com/python/cpython/issues/87389 This checks that a...
<vulnerable_code>_MAX_LEN_NAME = 128 def _validate_name(name: str): """ Validate a name field in the request input. ) def _validate_password(password: str): """ Check if the password is strong enough. if 'input' not in organization: raise ValidationError( ...
<vulnerable_code> # The only entity that is allowed to algorithm ports is the node where # those algorithms are running. run_id = data.get('run_id') linked_run = g.session.query.query(Run).filter(Run.id == run_id).one() if g.node.id != linked_run.node.id: return {'msg...
<vulnerable_code> return {'msg': 'Request body is incorrect', 'errors': errors}, \ HTTPStatus.BAD_REQUEST id_ = body.get('id') node = db.Node.get(id_) if not node: return {<commit_title>[PATCH] Address review comments for marshmallow validation<commit_desc...
<vulnerable_code> length, keyword = match.groups() length = int(length) value = buf[match.end(2) + 1:match.start(1) + length - 1] # Normally, we could just use "utf-8" as the encoding and "strict"<commit_title>[PATCH] bpo-39017 Fix infinite loop in the tarfile module<com...
<vulnerable_code> with self.assertRaisesRegex(tarfile.ReadError, "unexpected end of data"): tar.extractfile(t).read() class MiscReadTestBase(CommonReadTest): def requires_name_attribute(self): pass<commit_title>[PATCH] bpo-39017 Fix infinite loop in the tarfile module<com...
<vulnerable_code> mongoose.connect(`mongodb://${config.database.server}:${config.database.port}/${config.database.name}`, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false}); // Models import require('./models/user'); require('./models/audit');<commit_title>[PATCH] Applie...
<vulnerable_code> } var token = cookie[1] jwt.verify(token, jwtSecret, (err, decoded) => { if (err) { if (err.name === 'TokenExpiredError') Response.Unauthorized(res, 'Expired token') Response.Una...
<vulnerable_code> const rawNoPage = req.originalUrl.replace(/[?&]page=[^&#]*(#.*)?$/, '$1').replace(/([?&])page=[^&]*&/, '$1') if (!_.isUndefined(status) && !_.isArray(status)) status = [status] if (!_.isUndefined(priority) && !_.isArray(priority)) priority = [priority] if (!_.isUndefined(groups) && !_.isArray...
<vulnerable_code>const MAX_FIELD_TEXT_LENGTH = 255 const MAX_SHORT_FIELD_TEXT_LENGTH = 25 module.exports.applyMaxShortTextLength = function (text) { return text.toString().substring(0, MAX_SHORT_FIELD_TEXT_LENGTH) }<commit_title>[PATCH] fix(tickets): security fix<commit_description><fixed_code> const MAX_FIELD_TEXT_...
<vulnerable_code> else: self.post_init() self._init_extension(app) def _init_extension(self, app): app.appbuilder = self app.extensions = {} app.extensions["appbuilder"] = self def post_init(self): for baseview in self.baseviews: # ins...
<vulnerable_code>from langchain.prompts.base import BasePromptTemplate from langchain.utilities import PythonREPL DEFAULT_CODE_VALIDATIONS = { "solution_expression": {}, "allow_imports": False, "allow_non_math_operations": True, "allow_command_exec": False, } COMMAND_EXECUTION_FUNCTIONS = ["system", "e...
<vulnerable_code>import multiprocessing import sys from io import StringIO from pydantic import BaseModel, Field class PythonREPL(BaseModel): """Simulates a standalone Python REPL.""" locals: Optional[Dict] = Field(default_factory=dict, alias="_locals") @classmethod def worker(cls, command: str, glo...
<vulnerable_code> import pytest from langchain.chains.pal.base import PALChain from langchain.chains.pal.colored_object_prompt import COLORED_OBJECT_PROMPT from langchain.chains.pal.math_prompt import MATH_PROMPT from tests.unit_tests.llms.fake_llm import FakeLLM return random.choice() """ _FULL_CODE_VALIDATIONS ...
<vulnerable_code> if (!state->planes) goto fail; state->dev = dev; drm_dbg_atomic(dev, "Allocated atomic state %p\n", state); void __drm_atomic_state_free(struct kref *ref) { struct drm_atomic_state *state = container_of(ref, typeof(*state), ref); struct drm_mode_config *config = &state->dev->mode_config; drm...
<vulnerable_code> if (v == FORM_UNKNOWN) return NULL; if (!q) { switch (v) { case FORM_INPUT_SUBMIT:<commit_title>[PATCH] Prevent segfault with incorrect button type<commit_description>Bug-Debian: https://github.com/tats/w3m/issues/17<fixed_code> if (v == FORM_UNKNOWN) return NUL...
<vulnerable_code> ifstream input_file; ofstream tmp_file; char buffer[READ_BUFFER_SIZE]; char *iconv_buffer; string s_buffer; char *filenames[3]; char tmp_filename[256]; if (file_is_xml == false) { #ifdef HAVE_ICONV size_t inbytesleft = strlen(s_buffer.c_str()); ...
<vulnerable_code> return rc; } static void removeSBITS(const char *path) { struct stat stb; if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode)) { if ((stb.st_mode & 06000) != 0) { (void) chmod(path, stb.st_mode & 0777); } #if WITH_CAP if (stb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) { (void) cap_se...
<vulnerable_code> if (!trak->Media->information->sampleTable->CompositionOffset) return GF_BAD_PARAM; if (!trak->Media->information->sampleTable->CompositionOffset->unpack_mode) return GF_BAD_PARAM; for (i=0; i<trak->Media->information->sampleTable->CompositionOffset->nb_entries; i++) { /*we're in unpack mode: one...
<vulnerable_code> br = (Double) (s64) gf_isom_get_media_duration(file, track); br /= timescale; if (br) { GF_ESD *esd = NULL; if (!csize || !cdur) { bitrate = (u32) ((Double) (s64)avg_rate / br);<commit_title>[PATCH] fixed #2357<commit_description><fixed_code> br = (Double) (s64) gf_isom_get_media_duration(...
<vulnerable_code> raise ProxyAuthenticationFailed() parts = request.headers[b'proxy-authorization'][1].split() if len(parts) != 2 \ and parts[0].lower() != b'basic' \ and parts[1] != self.flags.auth_code: raise ProxyAuthentic...
<vulnerable_code> if (destinationDir == null){ destinationDir = tempWorkDir; } File tempdir = new File(destinationDir); if (!tempdir.isDirectory()) { log.error("'" + ConfigurationManager.getProperty("org.dspace.app.itemexport.work.dir") + ...
<vulnerable_code> ept_info.tiff=(unsigned char *) AcquireQuantumMemory(ept_info.tiff_length+1, sizeof(*ept_info.tiff)); if (ept_info.tiff == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); (void) ResetMagickMemory(ept_info.tiff,0,(ept_info.tiff_length+1)* size...
<vulnerable_code> group4_image=CloneImage(image,0,0,MagickTrue,exception); if (group4_image == (Image *) NULL) { (void) CloseBlob(image); return(MagickFalse); } group4_image=DestroyImage(group4_image); if (group4 == (unsigned char *) NULL) { (void) CloseBlob(image); return(Mag...
<vulnerable_code> } result = mysql_dr_connect(dbh, imp_dbh->pmysql, mysql_socket, host, port, user, password, dbname, imp_dbh) ? TRUE : FALSE; if (fresh && !result) { /* Prevent leaks, but do not free in case of a reconnect. See #97625 */ Safefree(imp_dbh->pmysql); } return result; } if (!...
<vulnerable_code> Dwarf_Bool is_actuals_tab) { if (!is_single_tab) { /* Ugly indenting follows, it makes lines shorter to see them better. Best to use a wider text window to really see how it looks.*/ if (is_actuals_tab) { _dwarf_printf(dbg,"\nActuals Table\n"); _dwarf_printf(dbg, if(!is_single_table...
<vulnerable_code> feedgen.entry ~~~~~~~~~~~~~ :copyright: 2013, Lars Kiesow <lkiesow@uos.de> :license: FreeBSD and LGPL, see license.* for more details. ''' import dateutil.parser import dateutil.tz import warnings from lxml import etree from feedgen.compat import string_types from feedgen.util import...
<vulnerable_code> :license: FreeBSD and LGPL, see license.* for more details. ''' from lxml import etree from feedgen.ext.base import BaseExtension class DcBaseExtension(BaseExtension): def extend_ns(self): return {'dc': 'http://purl.org/dc/elements/1.1/'} def _extend_xml(self, xml_elem): ...
<vulnerable_code>import numbers import warnings from lxml import etree from feedgen.ext.base import BaseEntryExtension class GeoRSSPolygonInteriorWarning(Warning): GEO_NS = 'http://www.georss.org/georss' if self.__point: point = etree.SubElement(entry, '{%s}point' % GEO_NS) p...
<vulnerable_code> :license: FreeBSD and LGPL, see license.* for more details. ''' from lxml import etree from feedgen.ext.base import BaseEntryExtension, BaseExtension from feedgen.util import ensure_format MEDIA_NS = 'http://search.yahoo.com/mrss/' # Define current media:group group = gr...
<vulnerable_code> :license: FreeBSD and LGPL, see license.* for more details. ''' from lxml import etree from feedgen.compat import string_types from feedgen.ext.base import BaseExtension from feedgen.util import ensure_format class PodcastExtension(BaseExtension): channel = rss_feed[0] if self....
<vulnerable_code> :license: FreeBSD and LGPL, see license.* for more details. ''' from lxml import etree from feedgen.ext.base import BaseEntryExtension class PodcastEntryExtension(BaseEntryExtension): ITUNES_NS = 'http://www.itunes.com/dtds/podcast-1.0.dtd' if self.__itunes_author: ...
<vulnerable_code>http://web.resource.org/rss/1.0/modules/syndication/ ''' from lxml import etree from feedgen.ext.base import BaseExtension SYNDICATION_NS = 'http://purl.org/rss/1.0/modules/syndication/' PERIOD_TYPE = ('hourly', 'daily', 'weekly', 'monthly', 'yearly') def _set_value(channel, name, value): if va...
<vulnerable_code> :license: FreeBSD and LGPL, see license.* for more details. ''' from lxml import etree from feedgen.ext.base import BaseEntryExtension, BaseExtension TORRENT_NS = 'http://xmlns.ezrss.it/0.1/dtd/' :param feed: The RSS item XML element to use. ''' if self.__torrent_filenam...
<vulnerable_code> feedgen.feed ~~~~~~~~~~~~ :copyright: 2013-2016, Lars Kiesow <lkiesow@uos.de> :license: FreeBSD and LGPL, see license.* for more details. import dateutil.parser import dateutil.tz from lxml import etree import feedgen.version from feedgen.compat import string_types from feedgen.ent...
<vulnerable_code>''' import locale import sys def ensure_format(val, allowed, required, allowed_values=None, defaults=None):<commit_title>[PATCH] Prevent XML Denial of Service Attacks<commit_description>This patch prevents entity expansion for provided XML content to guard against XML denial of service attacks like X...
<vulnerable_code> return False self.command, self.path = command, path # Examine the headers and look for a Connection directive. try: self.headers = http.client.parse_headers(self.rfile, if not parts.path.endswith('/'): # redirect browser ...
<vulnerable_code> pass def setUp(self): BaseTestCase.setUp(self) self.cwd = os.getcwd() basetempdir = tempfile.gettempdir() os.chdir(basetempdir) except: pass finally: BaseTestCase.tearDown(self) def check_status_and_reason...
<vulnerable_code> continue; r = dma_fence_wait_timeout(fence, true, timeout); dma_fence_put(fence); if (r < 0) return r; if (r == 0) break; if (fence->error) return fence->error; } memset(wait, 0, sizeof(*wait));<commit_title>[PATCH] drm/amdgpu: Fix potential fence use-after-free v2<commit_de...
<vulnerable_code>var utils = require('./utils'); var debug = require('debug')('launchpad:local:version'); module.exports = function(browser) { if (!browser || !browser.path) { return Q(null); debug('Retrieving version for windows executable', command); // Can't use Q.nfcall here unfortunately because of...
<vulnerable_code> } } __clear_bit(*old_keycode, dev->keybit); __set_bit(ke->keycode, dev->keybit); for (i = 0; i < dev->keycodemax; i++) { if (input_fetch_keycode(dev, i) == *old_keycode) { __set_bit(*old_keycode, dev->keybit); break; /* Setting the bit twice is useless, so break */ } } return 0; } ...
<vulnerable_code> return r; } /* * Handle string options that need some action to perform when changed. * Returns NULL for success, or an error message for an error. #ifdef FEAT_KEYMAP else if (varp == &curbuf->b_p_keymap) { /* load or unload key mapping tables */ errmsg = keymap_init(); if (errmsg ==...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 55, /**/<commit_title>[PATCH] patch 8.0.0056 Problem: When setting 'filetype' there is<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 56,...
<vulnerable_code>from yaml import YAMLError try: from yaml import CLoader as Loader except ImportError: from yaml import Loader SETTINGS_FILE = "settings.yaml" SETTINGS_STRUCT = { """ try: with open(filename) as stream: data = load(stream, Loader=Loader) except (YAMLError, OSEr...
<vulnerable_code> * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof d...
<vulnerable_code>/* radare2 - LGPL - Copyright 2014-2015 - pancake */ #include <r_asm.h> #include <r_lib.h> int opsize = -1; op->type = -1; opsize = 2; switch (buf[0]) { case 0x3f: case 0x4f: op->type = R_ANAL_OP_TYPE_LEA; if (len > 5) { op->ptr = buf[2]; op->ptr |= buf[3]<<8; op->ptr |= buf[4]<<16;...
<vulnerable_code> kernel=(KernelInfo *) RelinquishMagickMemory(kernel); return(kernel); } /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % last = kernel; clone = CloneKernelInfo(last); RotateKer...
<vulnerable_code> return; } case LIT_CHAR_ASTERISK: #endif /* ENABLED (JERRY_ES2015) */ case LIT_CHAR_RIGHT_BRACE: { } context_p->token.type = LEXER_RIGHT_BRACE; #if ENABLED (JERRY_ES2015) if (context_p->source_p[0] == LIT_CHAR_ASTERISK) { contex...
<vulnerable_code>from synapse.api.ratelimiting import Ratelimiter from synapse.events import EventBase from synapse.events.snapshot import EventContext from synapse.storage.roommember import RoomsForUser from synapse.types import JsonDict, Requester, RoomAlias, RoomID, StateMap, UserID from synapse.util.async_helpers i...
<vulnerable_code># See the License for the specific language governing permissions and # limitations under the License. import logging from typing import TYPE_CHECKING, Dict, FrozenSet, Iterable, List, Optional, Set from synapse.api.constants import EventTypes, Membership from synapse.events import EventBase ...