text stringlengths 79 3.72M |
|---|
<vulnerable_code> * String Commands
*----------------------------------------------------------------------------*/
static int checkStringLength(client *c, long long size) {
if (!mustObeyClient(c) && size > server.proto_max_bulk_len) {
addReplyError(c,"string exceeds maximum allowed size (proto-max-bulk-l... |
<vulnerable_code> if not fnd_path:
return ''
try:
fnd_mode = fnd.get('stat', [])[0]
except (IndexError, TypeError):
fnd_mode = None
if not salt.utils.is_windows():
if fnd_mode is not None:
try:
if os.sta... |
<vulnerable_code> return _client().hash_file(path, saltenv)
def push(path, keep_symlinks=False, upload_path=None, remove_source=False):
'''
WARNING Files pushed to the master will have global read permissions..<commit_title>[PATCH] stat file when placing it on server instead of caching<commit_description>r... |
<vulnerable_code> if _urlparse(source).scheme in ('salt', 'file') \
or source.startswith('/'):
try:
mode = salt.utils.st_mode_to_octal(os.stat(sfn).st_mode)
except Exception as exc:
log.warning('Unable to stat %s: %s'... |
<vulnerable_code> the ``contents`` options, setting the ``mode`` to ``keep`` is also
incompatible with the ``contents`` options.
template
If this setting is applied, the named templating engine will be used to
render the downloaded file. The following templates are supported:... |
<vulnerable_code> contentEqualsIgnoreCase(name, HttpHeaderNames.KEEP_ALIVE);
case 16: return contentEqualsIgnoreCase(name, HttpHeaderNames.PROXY_CONNECTION);
case 17: return contentEqualsIgnoreCase(name, HttpHeaderNames.TRANSFER_ENCODING);
}
return false;
}... |
<vulnerable_code>import static org.junit.jupiter.api.Assertions.assertThrows;
public class HpackDynamicTableTest {
AsciiString foo = AsciiString.cached("foo");
AsciiString bar = AsciiString.cached("bar");
AsciiString hello = AsciiString.cached("hello");
AsciiString world = AsciiString.cached("world");
... |
<vulnerable_code>
typedef struct FlatpakProxyClient FlatpakProxyClient;
/* We start looking ignoring the first cr-lf
since there is no previous line initially */
#define AUTH_END_INIT_OFFSET 2
#define AUTH_END_STRING "\r\nBEGIN\r\n"
typedef enum {
EXPECTED_REPLY_NONE,
FlatpakProxy *proxy;
gboolean auth... |
<vulnerable_code>/*!
* Simditor v2.3.21
* http://simditor.tower.im/
* 2018-10-17
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define('simditor', ["jquery","simple-module","simple-hotkeys","simple-uploader"], ... |
<vulnerable_code><commit_title>[PATCH] ADD: DOMPurify for preventing xss attacks<commit_description><fixed_code>
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.DOMPurify =... |
<vulnerable_code> _this.files.splice($.inArray(file, _this.files), 1);
if (_this.queue.length > 0 && _this.files.length < _this.opts.connectionCount) {
return _this.upload(_this.queue.shift());
} else {
return _this.uploading = false;
}
};<commit_title>[PATCH] AD... |
<vulnerable_code>#define EXT4_EXT_MARK_UNINIT1 0x2 /* mark first half uninitialized */
#define EXT4_EXT_MARK_UNINIT2 0x4 /* mark second half uninitialized */
static __le32 ext4_extent_block_csum(struct inode *inode,
struct ext4_extent_header *eh)
{
unsigned int ee_len, depth;
int err = 0;
ext_debug("ext... |
<vulnerable_code>import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* <p>WebSecurityUtils class.</p>
*
if (raw==null || raw.length()==0) {
return raw;
}
Matcher scriptMatcher = scriptPattern.matcher(raw);
String next = scriptMatcher.replaceAll("scrip... |
<vulnerable_code> script = WebSecurityUtils.sanitizeString(script);
imgXss = WebSecurityUtils.sanitizeString(imgXss);
html = WebSecurityUtils.sanitizeString(html);
assertEquals("Script is sanitized", "<script>foo</script>", script);
assertEquals("IMG XSS is sanitized", "<img src=/ ... |
<vulnerable_code><commit_title>[PATCH] Add regression test for #426<commit_description><fixed_code>
# -*- coding: utf-8 -*-
import system_tests
class DetectsWrongLengthOfImageResourceInPSDFile(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/426"
filename = system_tests.path("$... |
<vulnerable_code> graydata=(unsigned char *) xcfdata; /* used by gray and indexed */
count=ReadBlob(image,data_length,(unsigned char *) xcfdata);
if (count != (ssize_t) data_length)
ThrowBinaryException(CorruptImageError,"NotEnoughPixelData",
image->filename);
exception=(&image->exception);
for (y=0... |
<vulnerable_code> ],
"NETWORK_DRIVERS": [
{},
mark_safe(
"Extend or override default Platform.network_driver translations provided by "
'<a href="https://netutils.readthedocs.io/en/latest/user/lib_use_cases_lib_mapper/">netutils</a>. '
"Enter a dictionary in JS... |
<vulnerable_code>from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import NoReverseMatch, reverse
from django.utils.html import escape
from django.utils.http import is_safe_url
from django.utils.safestring import mark_safe
from django.views.generic im... |
<vulnerable_code>from django.shortcuts import get_object_or_404, redirect
from django.template.loader import select_template, TemplateDoesNotExist
from django.utils.http import is_safe_url
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.views.generic.edit import FormView
... |
<vulnerable_code> model = Site
fields = Site.csv_headers
help_texts = {
"time_zone": mark_safe(
'Time zone (<a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">available options</a>)'
)
}
feature="locations",
requi... |
<vulnerable_code>from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import F, ProtectedError, Q
from django.utils.functional import cached_property
from django.urls import reverse
from django.utils.safestring import mark_safe
from nautobot.dcim.ch... |
<vulnerable_code> modelformset_factory,
)
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.views.generic import View
from django_tables2 import RequestConfig
if membership_form.is_valid():
... |
<vulnerable_code> self.fields["provided_contents"] = CSVMultipleChoiceField(
choices=get_git_datasource_content_choices(),
required=False,
help_text=mark_safe(
"The data types this repository provides. Multiple values must be comma-separated and wrapped in "
... |
<vulnerable_code>from django.db import models
from django.forms.widgets import TextInput
from django.urls import reverse
from django.utils.safestring import mark_safe
from nautobot.extras.choices import CustomFieldFilterLogicChoices, CustomFieldTypeChoices
from nautobot.extras.models import ChangeLoggedModel
... |
<vulnerable_code> name = models.CharField(max_length=100, unique=True)
text = models.CharField(
max_length=500,
help_text="Jinja2 template code for link text. Reference the object as <code>{{ obj }}</code> such as <code>{{ obj.platform.slug }}</code>. Links which render as empty text will not be ... |
<vulnerable_code>from django.db.models import Q
from django.urls import reverse
from django.urls.exceptions import NoReverseMatch
from django.utils.safestring import mark_safe
from nautobot.core.fields import AutoSlugField
from nautobot.core.models import BaseModel
widgets,
)
from nautobot.utilities.querysets impo... |
<vulnerable_code>import django_tables2 as tables
from django.conf import settings
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django_tables2.utils import Accessor
from jsonschema.exceptions import ValidationError as JSONSchemaValidationError
def render_description(... |
<vulnerable_code>from django import template
from django.contrib.contenttypes.models import ContentType
from django.utils.html import escape
from django.utils.safestring import mark_safe
from nautobot.extras.models import ComputedField
if not computed_fields:
return ""
template_code = ""
for lab... |
<vulnerable_code>
from django import template
from django.contrib.contenttypes.models import ContentType
from django.utils.safestring import mark_safe
from nautobot.extras.models import CustomLink
"user": context["user"], # django.contrib.auth.context_processors.auth
"perms": context["perms"], # djan... |
<vulnerable_code>from django import template
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from django.utils.safestring import mark_safe
from nautobot.extras.models import JobButton
"user": context["user"], # django.contrib.auth.context_processors.auth
"per... |
<vulnerable_code> if not return_html:
return objects
return mark_safe(html)
@register.simple_tag(takes_context=True)<commit_title>[PATCH] [1.6] Fix unsafe `mark_safe` use in various features (#4833)<commit_description>* Audit all uses of mark_safe() and change to format_html() where appropriate
* Tes... |
<vulnerable_code> ],
"expected_errors": {
"api": {
"objects_nonexistent": "Circuit types require a platform, but no platforms exist yet. "
"Create a platform by posting to /api/dcim/platforms/",
"o... |
<vulnerable_code>from django.test import override_settings
from django.urls import reverse
from django.utils import timezone
from unittest import mock
from nautobot.dcim.models import ConsolePort, Device, DeviceRole, DeviceType, Interface, Manufacturer, Site
from nautobot.dcim.tests import test_views
from nautobot.ext... |
<vulnerable_code>from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils import timezone
from django.utils.html import escape
from django.utils.http import is_safe_url
from django.utils.safestring import mark_safe
from django.views.generic import View
from djan... |
<vulnerable_code> VRF,
)
AVAILABLE_LABEL = mark_safe('<span class="label label-success">Available</span>')
UTILIZATION_GRAPH = """
{% load helpers %}<commit_title>[PATCH] [1.6] Fix unsafe `mark_safe` use in various features (#4833)<commit_description>* Audit all uses of mark_safe() and change to format_html() wher... |
<vulnerable_code>from django.contrib import messages
from django.utils.html import escape
from django.utils.safestring import mark_safe
"""
protected_objects = list(e.protected_objects)
protected_count = len(protected_objects) if len(protected_objects) <= 50 else "More than 50"
err_message = (
... |
<vulnerable_code>from django.core.exceptions import FieldDoesNotExist
from django.db.models.fields.related import RelatedField
from django.urls import reverse
from django.utils.html import escape, format_html
from django.utils.safestring import mark_safe
from django.utils.text import Truncator
from django_tables2.data ... |
<vulnerable_code>from nautobot.utilities.forms import TableConfigForm
from nautobot.utilities.utils import foreground_color, get_route_for_model, UtilizationData
HTML_TRUE = '<span class="text-success"><i class="mdi mdi-check-bold" title="Yes"></i></span>'
HTML_FALSE = '<span class="text-danger"><i class="mdi mdi-clos... |
<vulnerable_code> """
rendering_engine = engines["jinja"]
template = rendering_engine.from_string(template_code)
return template.render(context=context)
def prepare_cloned_fields(instance):<commit_title>[PATCH] [1.6] Fix unsafe `mark_safe` use in various features (#4833)<commit_description>* Audit all ... |
<vulnerable_code> run_command(context, command)
@task
def serve_docs(context):
"""Runs local instance of mkdocs serve (ctrl-c to stop)."""
flake8(context)
hadolint(context)
markdownlint(context)
pylint(context)
check_migrations(context)
check_schema(context)<commit_title>[PATCH] [1.... |
<vulnerable_code> }
this.app = express();
this.events = {};
this.modelCache = new Object();
this.plugins = [];
res.end();
}
function startServer(web, cb) {
<commit_title>[PATCH] Framework fix for open redirect vulnerability<commit_description><fixed_code>
}
this.app = express();
fi... |
<vulnerable_code>
dataDir: 'data',
tmpDir: 'data/tmp',
extendWeb: {
enabled: true,<commit_title>[PATCH] Framework fix for open redirect vulnerability<commit_description><fixed_code>
dataDir: 'data',
tmpDir: 'data/tmp',
allowedRedirectHosts: [],
extendWeb: {
enabled: true, |
<vulnerable_code> * ProFTPD - FTP server daemon
* Copyright (c) 1997, 1998 Public Flood Software
* Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver@tos.net>
* Copyright (c) 2001-2016 The ProFTPD Project team
*
* This program is free software; you can redistribute it and/or modify
* it under the term... |
<vulnerable_code> runlength=(size_t *) RelinquishMagickMemory(runlength);
if (packet_info != (MemoryInfo *) NULL)
packet_info=RelinquishVirtualMemory(packet_info);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
packets=(unsigned ... |
<vulnerable_code> SD_BUS_PROPERTY("DNSSECNegativeTrustAnchors", "as", bus_property_get_ntas, 0, 0),
SD_BUS_PROPERTY("DNSStubListener", "s", bus_property_get_dns_stub_listener_mode, offsetof(Manager, dns_stub_listener_mode), 0),
SD_BUS_PROPERTY("ResolvConfMode", "s", bus_property_get_resolv_conf_m... |
<vulnerable_code>
assert(m);
if (!m->enable_varlink_notifications || m->varlink_monitor_server)
return 0;
r = varlink_server_new(&server, VARLINK_SERVER_ROOT_ONLY);<commit_title>[PATCH] resolved: don't make monitoring optional<commit_description>The socket is only accessible to... |
<vulnerable_code> if ((edit->segment_cache[ASSOC_ARRAY_FAN_OUT] ^ base_seg) == 0)
goto all_leaves_cluster_together;
/* Otherwise we can just insert a new node ahead of the old
* one.
*/
goto present_leaves_cluster_but_not_new_leaf;
}
split_node:
pr_devel("split node\n");
/* We need to split the curr... |
<vulnerable_code> mrb_exc_set(mrb, exc);
goto L_RAISE;
}
if (target_class->flags & MRB_FL_CLASS_IS_PREPENDED) {
target_class = mrb_vm_ci_target_class(ci);
}
else if (target_class->tt == MRB_TT_MODULE) {
target_class = mrb_vm_ci_target_class(ci);
if (!target... |
<vulnerable_code> confirmation, self.instance)
else:
self.add_error("oldpassword", _("This field is required."))
return self.cleaned_data
def save(self, commit=True):<commit_title>[PATCH] Fixed security issue with password update.<commit_description><fixed... |
<vulnerable_code> self.client.login(username="user@test.com", password="toto"), True
)
self.ajax_post(
reverse("core:user_profile"),
{"oldpassword": "toto",<commit_title>[PATCH] Fixed security issue with password update.<commit_description><fixed_code>
sel... |
<vulnerable_code> signaling.updateCurrentCallFlags(expectedCallFlags)
})
webrtc.on('localTrackReplaced', function(newTrack, oldTrack/*, stream */) {
// Device disabled, just update the call flags.
if (!newTrack) {
if (oldTrack && oldTrack.kind === 'audio') {
signaling.updateCurrentCallFlags(signaling.get... |
<vulnerable_code>
setup(
name='sopel_plugins.channelmgnt',
version='1.0.2',
description='Channelmgnt plugin for Sopel',
long_description=readme,
long_description_content_type='text/markdown', # This is important!<commit_title>[PATCH] Update setup.py<commit_description><fixed_code>
setup(
name=... |
<vulnerable_code> if (offset) *offset += sz;
return sz;
}
static size_t consume_init_expr (ut8 *buf, ut8 *max, ut8 eoc, void *out, ut32 *offset) {
ut32 i = 0;
while (buf + i < max && buf[i] != eoc) {
// TODO: calc the expresion with the bytcode (ESIL?)
i += 1;
}
if (buf[i] != eoc) {
return 0;
}
static RList... |
<vulnerable_code> * compile perl to know about them) */
bool is_nv_type = FALSE;
unsigned int i, j = 0;
int equals_pos = -1; /* Where the '=' is found, or negative if none */
int slash_pos = -1; /* Where the '/' is found, or negative if none */
int table_index = 0; /* The entry number... |
<vulnerable_code> byte webp[len];
byte data[len];
byte riff[len];
iIo.read(riff, len);
iIo.read(data, len);
iIo.read(webp, len);
bool matched_riff = (memcmp(riff, RiffImageId, len) == 0);
bool matched_webp = (memcmp(webp, WebPImageId, len) == 0);
iI... |
<vulnerable_code>import org.apache.cocoon.ResourceNotFoundException;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.generation.AbstractGenerator;
import org.dspace.app.xmlui.objectmanager.AbstractAdapter;
import org.dspace.app.xmlui.objectm... |
<vulnerable_code>import org.dspace.app.xmlui.wing.AttributeMap;
import org.dspace.app.xmlui.wing.Namespace;
import org.dspace.app.xmlui.wing.WingException;
import org.dspace.content.Bitstream;
import org.dspace.content.BitstreamFormat;
import org.dspace.content.Item;
protected ContentHandler contentHandler;
pro... |
<vulnerable_code> // Close out field
endElement(DIM,"field");
}
}<commit_title>[PATCH 1/3] DSpaceMETSGenerator: Check permissions<commit_description>Ensure that the metadata of objects are not accessible via the mets file, if
the current user doesn't have sufficient permissions.<fixed_code>
... |
<vulnerable_code> }
}
/**
* Checks which Bundles of current item a user has requested.<commit_title>[PATCH 1/3] DSpaceMETSGenerator: Check permissions<commit_description>Ensure that the metadata of objects are not accessible via the mets file, if
the current user doesn't have sufficient permission... |
<vulnerable_code>
}
/**
*
* <commit_title>[PATCH 1/3] DSpaceMETSGenerator: Check permissions<commit_description>Ensure that the metadata of objects are not accessible via the mets file, if
the current user doesn't have sufficient permissions.<fixed_code>
}
@Override
pub... |
<vulnerable_code>
Element ore = xwalk.disseminateElement(context, item);
out.output(ore);
/* Generate the METS document
contentHandler.startDocument();
adapter.renderMETS(contentHandler,lexicalHandler);
contentHandler.endDocument();*/
} catch (JDOMExcep... |
<vulnerable_code>/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 408
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 72
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 41
/* YYNRULES -- Number of rules. */
#defin... |
<vulnerable_code> def __str__(self):
return "<SvnAuth username=%s ...>" %(self.username,)
rex_blame = re.compile(r'\s*(\d+)\s*(\S+) (.*)')
class SvnWCCommandPath(common.PathBase):
""" path implementation offering access/modification to svn working copies.<commit_title>[PATCH] svnwc: fix regular express... |
<vulnerable_code> list_for_each_entry(srp, &sfp->rq_list, entry) {
if (val > SG_MAX_QUEUE)
break;
memset(&rinfo[val], 0, SZ_SG_REQ_INFO);
rinfo[val].req_state = srp->done + 1;
rinfo[val].problem =
srp->header.masked_status &
else {
sg_req_info_t *rinfo;
rinfo = kmalloc(SZ_SG_REQ_INFO * SG_MAX_QUE... |
<vulnerable_code> map.add(StructureDefinition.SP_URL, new UriParam("http://hl7.org/fhir/uv/shorthand/CodeSystem/shorthand-code-system"));
IBundleProvider result = myCodeSystemDao.search(map);
assertEquals(1, result.sizeOrThrowNpe());
});
}
@Test<commit_title>[PATCH 02/15] Test now passes.<commit_descriptio... |
<vulnerable_code>import org.apache.commons.lang3.Validate;
import org.hl7.fhir.instance.model.api.IBase;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.hl7.fhir.r4.model.Identifier;
import org.hl7.fhir.utilities.npm.IPackageCacheManager;
ourL... |
<vulnerable_code>package ca.uhn.fhir.jpa.term.custom;
import ca.uhn.fhir.jpa.entity.TermConceptProperty;
import ca.uhn.fhir.jpa.entity.TermConceptPropertyTypeEnum;
import ca.uhn.fhir.jpa.term.IRecordHandler;<commit_title>[PATCH 02/15] Test now passes.<commit_description><fixed_code>
package ca.uhn.fhir.jpa.term.custom... |
<vulnerable_code> myVersionAdapter.setResponseLastModified(newEntry, lastModifier);
if (theRequestDetails != null) {
String prefer = theRequestDetails.getHeader(Constants.HEADER_PREFER);
PreferReturnEnum preferReturn = RestfulServerUtils.parsePreferHeader(null, prefer).getReturn();
if (preferReturn != n... |
<vulnerable_code>import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
import org.apache.commons.io.IOUtils;
import org.hamcrest.Matchers;
import org.hl7.fhi... |
<vulnerable_code> createResource(dao, theResource);
ourLog.info("Created resource with new id");
} else {
updateResource(dao, theResource);
ourLog.info("Created resource with existing id");
}
} else {
ourLog.info("Updating existing resource matching {}", map.toNormalizedQueryString(my... |
<vulnerable_code> IBaseResource resource = result.getResources(0, 1).get(0);
assertEquals("CodeSystem/shorthand-code-system/_history/1", resource.getIdElement().toString());
});
}
<commit_title>[PATCH 02/15] Test now passes.<commit_description><fixed_code>
IBaseResource resource = result.getResources(0, 1).... |
<vulnerable_code>import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.jpa.util.QueryChunker;
import ca.uhn.fhir.rest.api.server.storage.ResourcePers... |
<vulnerable_code>
public interface IRequestPartitionHelperSvc {
@Nonnull
RequestPartitionId determineReadPartitionForRequest(@Nullable RequestDetails theRequest, String theResourceType);
@Nonnull
RequestPartitionId determineCreatePartitionForRequest(@Nullable RequestDetails theRequest, @Nonnull IBaseResource theRe... |
<vulnerable_code> if (myPartitionSettings.isPartitioningEnabled()) {
boolean nonPartitionableResource = myNonPartitionableResourceNames.contains(theResourceType);
if (theRequest instanceof SystemRequestDetails) {
requestPartitionId = getSystemRequestPartitionId(theRequest, nonPartitionableResource);
} el... |
<vulnerable_code>import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.param.QuantityParam;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.exceptio... |
<vulnerable_code>import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.Appointment;
import org.hl7.fhir.r4.model.Appointment.AppointmentStatus;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.ChargeItem;
import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r4.model.Observa... |
<vulnerable_code> }
}
}<commit_title>[PATCH 02/15] Test now passes.<commit_description><fixed_code>
}
}
} |
<vulnerable_code> blkImportJobFileTable.addForeignKey("20210410.6", "FK_BLKIMJOBFILE_JOB").toColumn("JOB_PID").references("HFJ_BLK_IMPORT_JOB", "PID");
version.addIdGenerator("20210410.7", "SEQ_BLKIMJOBFILE_PID");
}
private void init530() {<commit_title>[PATCH 02/15] Test now passes.<commit_description><fixed_co... |
<vulnerable_code>
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.Null;
import java.time.LocalDate;
@Embeddable<commit_title>[PATCH 02/1... |
<vulnerable_code>})
public class ResourceLink extends BaseResourceIndex {
public static final int SRC_PATH_LENGTH = 200;
private static final long serialVersionUID = 1L;
@SequenceGenerator(name = "SEQ_RESLINK_ID", sequenceName = "SEQ_RESLINK_ID")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_RES... |
<vulnerable_code>import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.not;
//Then
SearchPar... |
<vulnerable_code>import ca.uhn.fhir.jpa.model.config.PartitionSettings;
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.partition.IPartitionLookupSvc;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.server.excep... |
<vulnerable_code> version.addIdGenerator("20210410.7", "SEQ_BLKIMJOBFILE_PID");
//Increase ResourceLink path length
version.onTable("HFJ_RES_LINK").modifyColumn("20210505.1", "SRC_PATH").nonNullable().withType(ColumnTypeEnum.STRING, 500);
}
private void init530() {<commit_title>[PATCH 02/15] Test now passes.<c... |
<vulnerable_code> startRequest(theServletRequest);
try {
IBundleProvider bundleProvider = ((IFhirResourceDaoComposition<Composition>) getDao()).getDocumentForComposition(theServletRequest, theId, theCount, theOffset, theLastUpdated, theSortSpec, theRequestDetails);
List<IBaseResource> resourceList = bundleProv... |
<vulnerable_code> if (bundleProvider.size() == null) {
return resolveResourceList(bundleProvider.getResources(0, 10000));
}
if (bundleProvider.size() == 0) {
return new ArrayList<>();
}
List<IBaseResource> resourceList = bundleProvider.getResources(0, bundl... |
<vulnerable_code>import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry;
import ca.uhn.fhir.jpa.term.api.ITermReadSvcDstu3;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import org.cqframework.cql.cql2elm.CqlTr... |
<vulnerable_code>import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry;
import ca.uhn.fhir.jpa.term.api.ITermReadSvcR4;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import org.cqframework.cql.cql2elm.CqlTrans... |
<vulnerable_code>import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.Extension;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.IntegerType;
import org.hl7.fhir.dstu3.model.ListResource;
import org.hl7.fhir.dstu3.model.Measure;
import org.hl7.fhir.dstu3.model.MeasureReport;
... |
<vulnerable_code> }
IBundleProvider bundleProvider = myValueSetDao
.search(new SearchParameterMap().add(ValueSet.SP_URL, new UriParam(valueSet.getId())));
List<IBaseResource> valueSets = bundleProvider.getResources(0, bundleProvider.size());
if (valueSets.isEmpty()) {
throw new IllegalArgumentExcept... |
<vulnerable_code> version = parts[1];
}
SearchParameterMap map = new SearchParameterMap();
map.add("url", new UriParam(resourceUrl));
if (version != null) {
map.add("version", new TokenParam(version));
ca.uhn.fhir.rest.api.server.IBundleProvider bundleProvider = myLibraryDao.search(map);
if (bundleP... |
<vulnerable_code>import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.Extension;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.IntegerType;
import org.hl7.fhir.r4.model.ListResource;
import org.hl7.fhir.r4.model.Measure;
import org.hl7.fhir.r4.model.MeasureReport;
private static final... |
<vulnerable_code> * #L%
*/
import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.log.Logs;
import ca.uhn.fhir.mdm.rules.json.MdmFilterSearchParamJson;
import ca.uhn.fhir.mdm.rules.json.MdmResourceSearchParamJson;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
im... |
<vulnerable_code>package ca.uhn.fhir.jpa.mdm.svc;
import ca.uhn.fhir.mdm.api.IMdmSubmitSvc;
import ca.uhn.fhir.interceptor.api.IInterceptorService;
import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.jpa.mdm.BaseMdmR4Test;
import ca.uhn.test.concurrency.PointcutLatch;
import org.apache.commons.lang3.time.D... |
<vulnerable_code>
@Scope("prototype")
public class SubscriptionDeliveringRestHookSubscriber extends BaseSubscriptionDeliverySubscriber {
private static Logger ourLog = LoggerFactory.getLogger(SubscriptionDeliveringRestHookSubscriber.class);
@Autowired
private DaoRegistry myDaoRegistry;
IBundleProvider searchResul... |
<vulnerable_code>package ca.uhn.fhir.rest.api.server;
import org.apache.commons.lang3.Validate;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Date;
import java.util.List;
... |
<vulnerable_code> * limitations under the License.
* #L%
*/
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.lang.reflect.Method;
import java.util.List;
import org.hl7.fhir.instance.model.api.IBaseResource;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.Fhir... |
<vulnerable_code>package ca.uhn.fhir.rest.api.server;
import ca.uhn.fhir.rest.server.SimpleBundleProvider;
import com.google.common.collect.Lists;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.juni... |
<vulnerable_code> termConceptMap = myConceptMapDao.save(termConceptMap);
int codesSaved = 0;
if (theConceptMap.hasGroup()) {
TermConceptMapGroup termConceptMapGroup;
for (ConceptMap.ConceptMapGroupComponent group : theConceptMap.getGroup()) {
String groupSource = group.getSource();
if (isBla... |
<vulnerable_code>import ca.uhn.fhir.context.support.TranslateConceptResult;
import ca.uhn.fhir.context.support.TranslateConceptResults;
import ca.uhn.fhir.jpa.api.model.TranslationRequest;
import ca.uhn.fhir.jpa.entity.TermConceptMap;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r4.model.Canonica... |
<vulnerable_code> mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given");
}
p = MRB_OBJ_ALLOC(mrb, MRB_TT_PROC, mrb->proc_class);
mrb_proc_copy(p, mrb_proc_ptr(blk));
p->flags |= MRB_PROC_STRICT;
MRB_METHOD_FROM_PROC(m, p);
mrb_define_method_raw(mrb, c, mid, m);<commit_title>[PATCH] proc.c: add `mrb_state` a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.