text stringlengths 79 3.72M |
|---|
<vulnerable_code>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.business.environment.entity.ContextEntity;
import ch.puzzle.itc.mobilia... |
<vulnerable_code>
if (statusCode == 404) {
auto job = new StoreMetaDataApiJob(_propagator->account(),
_folderId, _metadata->encryptedMetadata());
connect(job, &StoreMetaDataApiJob::success, this, &PropagateUploadEncrypted::slotUpdateMetadataSuccess);
connect(job, &St... |
<vulnerable_code> var item = response.items[i],
$td = $($tds[i]);
var widgetHtml = '<a href="' + item.permalink + '" target="_blank">' + item.title + '</a> ';
if (item.date) {
... |
<vulnerable_code>!function(r){Craft.FeedWidget=Garnish.Base.extend({$widget:null,init:function(t,i,e){this.$widget=r("#widget"+t),this.$widget.addClass("loading");var a={url:i,limit:e};Craft.postActionRequest("dashboard/get-feed-items",a,r.proxy(function(t,i){if(this.$widget.removeClass("loading"),"success"===i){this.$... |
<vulnerable_code> return -errno;
r = json_parse_file(json_in, NULL, 0, &package_metadata, NULL, NULL);
if (r < 0 && r != -EINVAL) /* EINVAL: json was empty, so we got nothing, but that's ok */
return r;
}
<commit_title>[PATCH] share... |
<vulnerable_code>int json_parse_file_at(FILE *f, int dir_fd, const char *path, JsonParseFlags flags, JsonVariant **ret, unsigned *ret_line, unsigned *ret_column) {
_cleanup_(json_source_unrefp) JsonSource *source = NULL;
_cleanup_free_ char *text = NULL;
const char *p;
int r;
if... |
<vulnerable_code> assert_se(json_variant_equal(a, b));
}
TEST(source) {
static const char data[] =
"\n"<commit_title>[PATCH] shared/json: use different return code for empty input<commit_description>It is useful to distinguish if json_parse_file() got no input or invalid input.
Use diffe... |
<vulnerable_code> rules: {
'name': {
required: function () {
return $('#company').val().length === 0 || $('#firstname').val().length > 0;
}
},
'firstname': {
required: function () {
return $('#company').val().length === 0 || $('#name').val().length > 0;
}
},
... |
<vulnerable_code>
DEFAULT_PREFIX = "http://example.org/kb/"
# Shortcut syntax for defining an immutable named tuple is noted here:
# https://docs.python.org/3/library/typing.html#typing.NamedTuple
# via the "See also" box here: https://docs.python.org/3/library/collections.html#collections.namedtuple<commit_title>[PAT... |
<vulnerable_code>#
# We would appreciate acknowledgement if the software is used.
__version__ = "0.5.0"
from . import local_uuid<commit_title>[PATCH 01/10] Backport<commit_description>References:
https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3
Signed-off-by: Alex Nelson <alexander.nelson@nist.g... |
<vulnerable_code> def __init__(self):
self.user_map = dict()
self.log = self.add_service('auth_svc', self)
self.bypass = 'localhost:'
async def apply(self, app, users):
"""
identity = await identity_policy.identify(request)
if identity in self.user_map:
... |
<vulnerable_code>
feature = (NS_XMPP_TLS, 'starttls')
wanted = True
_deferred = None
def onProceed(self, obj):
"""
self.xmlstream.removeObserver('/failure', self.onFailure)
ctx = ssl.optionsForClientTLS(self.xmlstream.otherEntity.host)
self.xmlstream.transport.startTLS(... |
<vulnerable_code>from twisted.internet import defer, task
from twisted.internet.error import ConnectionLost
from twisted.internet.interfaces import IProtocolFactory
from twisted.internet._sslverify import ClientTLSOptions
from twisted.python import failure
from twisted.python.compat import unicode
return d
... |
<vulnerable_code>const CspStrategy = {}
const defaultDirectives = {
defaultSrc: ['\'self\''],
scriptSrc: ['\'self\'', 'vimeo.com', 'https://gist.github.com', 'www.slideshare.net'],
imgSrc: ['*'],
styleSrc: ['\'self\'', '\'unsafe-inline\'', 'https://github.githubassets.com'], // unsafe-inline is required for so... |
<vulnerable_code>import securesystemslib.util
import six
import iso8601
# The Timestamp role does not have signed metadata about it; otherwise we
# would need an infinite regress of metadata. Therefore, we use some
None.
"""
# Temporarily set consistent snapshot. Will be updated to whatever is set
#... |
<vulnerable_code><commit_title>[PATCH] Unit tests move and temporary ql<commit_description><fixed_code>
|
<vulnerable_code># This tests that the user doesn't pass user-tainted data into the msg.html attribute.
# source: https://pythonhosted.org/Flask-Mail/
from flask_mail import Message
@app.route("/")
def index():
msg = Message("Hello",
sender="from@example.com",
recipients=["to@e... |
<vulnerable_code># This tests that the user doesn't pass user-tainted data into the msg html initialized argument.
# source: https://pythonhosted.org/Flask-Mail/
from flask_mail import Message
@app.route("/")
def index():
msg = Message("Hello",
sender="from@example.com",
recip... |
<vulnerable_code># This tests that the user can't send multiple vulnerable emails.
# source: https://pythonhosted.org/Flask-Mail/
from flask_mail import Message
@app.route("/")
def index():
with mail.connect() as conn:
for user in users:
message = '...'
subject = "hello, %s" % user.name
... |
<vulnerable_code> unsigned const *const buckets = &hashtab[2];
unsigned const *const chains = &buckets[nbucket]; (void)chains;
unsigned const v_sym = get_te32(&dynp0[-1+ x_sym].d_val);
if (!nbucket
|| (nbucket>>31) || (file_size/sizeof(unsigned)) <= (2*nbucket) // FIXME: weak
... |
<vulnerable_code>}
function setPath(document, keyPath, value) {
if (!document) {
throw new Error('No document was provided.');
}
let {indexOfDot, currentKey, remainingKeyPath} = computeStateInformation(keyPath);
// if (currentKey === '__proto__' || currentKey === 'prototype' && Object.prototy... |
<vulnerable_code>
it('should protect against prototype pollution via __proto__', (done) => {
doc = {};
path.setPath(doc, '__proto__.polluted', 'yes');
assert.equal(doc.__proto__.polluted, undefined);
assert.equal(doc.polluted, undefined);
assert.equal(... |
<vulnerable_code> raise Exception("Authentication Error!")
self._access_token = response.json()["access_token"]
def post_task(self, name: str, image: str, collaboration_id: int,
input_='', description='',<commit_title>[PATCH 1/2] Introduce maximum length of refresh tokens<comm... |
<vulnerable_code> self.log.critical('Unable to authenticate. Exiting')
exit(1)
def private_key_filename(self) -> Path:
"""Get the path to the private key."""
<commit_title>[PATCH 1/2] Introduce maximum length of refresh tokens<commit_description>- configuration options to set expirat... |
<vulnerable_code># SSH TUNNEL RELATED CONSTANTS
#
SSH_TUNNEL_IMAGE = "harbor2.vantage6.ai/infrastructure/ssh-tunnel"<commit_title>[PATCH 1/2] Introduce maximum length of refresh tokens<commit_description>- configuration options to set expiration time of tokens and refresh tokens
- Automatically refreshing tokens on t... |
<vulnerable_code>"""
import jwt
import datetime
from typing import Dict, Tuple
from vantage6.common import WhoAmI
from vantage6.client import ClientBase
class NodeClient(ClientBase):
organization_name=organization_name
)
def request_token_for_container(self, task_id: int, image: str):
... |
<vulnerable_code>from vantage6.server.permission import RuleNeed, PermissionManager
from vantage6.server.globals import (
APPNAME,
JWT_ACCESS_TOKEN_EXPIRES,
JWT_TEST_ACCESS_TOKEN_EXPIRES,
RESOURCES,
SUPER_USER_INFO,
REFRESH_TOKENS_EXPIRE,
DEFAULT_SUPPORT_EMAIL_ADDRESS,
MAX_RESPONSE_TIME_... |
<vulnerable_code>#
# Expiretime of JWT tokens
JWT_ACCESS_TOKEN_EXPIRES = datetime.timedelta(hours=6)
# Expiretime of JWT token in a test environment
JWT_TEST_ACCESS_TOKEN_EXPIRES = datetime.timedelta(days=1)
"password": "root"
}
# Whenever the refresh tokens should expire. Note that setting this to true
# would ... |
<vulnerable_code> create_refresh_token,
get_jwt_identity
)
from http import HTTPStatus
from vantage6 import server
"incorrect!"
}, HTTPStatus.UNAUTHORIZED
token = create_access_token(user)
ret = {
'access_token': token,
... |
<vulnerable_code> 'refresh_token': create_refresh_token(user_or_node),
'refresh_url': api.url_for(RefreshToken),
}
import jwt
print(jwt.decode(token_dict['access_token'], options={"verify_signature": False}))
if isinstance(user_or_node, db.User):
token_dict['user_url'] = api.url_f... |
<vulnerable_code> col -= width1;
++row;
}
if (col > width2)
{
row += col / width2;
col = col % width2;<commit_title>[PATCH] patch 9.0.1367: divide by zero in zero-width window<commit_description>Problem: Divide by zero in zero-width window.
Solution: Check the width is positive.<fixed_code>
... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1366,
/**/<commit_title>[PATCH] patch 9.0.1367: divide by zero in zero-width window<commit_description>Problem: Divide by zero in zero-width window.
Solution: Check the width is positive.<fixed_code>
static i... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-h4mf-75hf-67w4<commit_description>* Fix session token issue
* verify email problem
* Fix password reset problem
* Change test file name
* Split tests
* Refetch user
* Replaces lets to consts
* Refactor unit test
What you have is just finee, but... |
<vulnerable_code>
export class PublicAPIRouter extends PromiseRouter {
verifyEmail(req) {
const { token, username } = req.query;
const appId = req.params.appId;
const config = Config.get(appId);
return this.missingPublicServerURL();
}
const { username, token } = req.query;
if (!userna... |
<vulnerable_code> }
}
if (info.clientVersion) {
info.clientSDK = ClientSDK.fromString(info.clientVersion);
}<commit_title>[PATCH] Merge pull request from GHSA-h4mf-75hf-67w4<commit_description>* Fix session token issue
* verify email problem
* Fix password reset problem
* Change test file name
* Split... |
<vulnerable_code> )
try:
result = subprocess.Popen(["asciidoctor", reportraw, "-o", reporthtml])
if str(result) == "32512":
msg = "asciidoctor not found. html cannot be generated."
QtGui.QMessageBox.information(None, "Path Sanity", msg)<commit_... |
<vulnerable_code>}
static SIXELSTATUS
load_png(unsigned char /* out */ **result,
unsigned char /* in */ *buffer,
int i;
int depth;
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr) {
sixel_helper_set_additional_message(
"p... |
<vulnerable_code> unsigned delay;
/* Continue a partial initialization */
if (type == HUB_INIT2)
goto init2;
if (type == HUB_INIT3)
goto init3;
/* The superspeed hub except for root hub has to use Hub Depth
* value as an offset into the route string to locate the bits
queue_delayed_work(system_power_effi... |
<vulnerable_code> ND_TCHECK(*bp);
c = *bp;
if (!(c >= '0' && c <= '9')) {
if (!saw_digit)
goto invalid;
break;
}
c -= '0';
if (len == 0)
goto trunc;
ND_TCHECK(*bp);
if (*bp != '\r')
goto invalid;
bp++;
len... |
<vulnerable_code> fread(frame_codestream, sample->sample_size - 8, 1,
file); /* Assuming that jp and ftyp markers size do*/
sprintf(outfilename, "%s_%05d.j2k", argv[2], snum);
outfile = fopen(outfilename, "wb");
if (!outfile) {
fprintf(stderr, "failed to open %s... |
<vulnerable_code> Object parser loop.
*/
ldblk=ReadBlobLSBLong(image);
if ((ldblk > 9999) || (ldblk < 0))
break;
HDR.Type[3]=ldblk % 10; ldblk /= 10; /* T digit */
}
filepos = TellBlob(image);
while(!EOFBlob(image)) /* object parser loop */
{
Frames = 1;
(void) SeekBlob(ima... |
<vulnerable_code># Copyright 2022 Arduino SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... |
<vulnerable_code> STRING_AGG(DISTINCT(users.username), ', ') AS users,
STRING_AGG(DISTINCT(groups.name), ', ') AS groups,
STRING_AGG(DISTINCT(host_attr_vals.value), ', ') AS nac_profiles
FROM hosts
JOIN structured_attributes_to_hosts A... |
<vulnerable_code> slot = mxArgv(i);
if (slot->kind == XS_REFERENCE_KIND) {
slot = slot->value.reference->next;
if (slot && (slot->kind == XS_ARRAY_BUFFER_KIND))
arrayBuffer = slot;
bufferInfo = slot->next;
}
if (arrayBuffer)
length = fxAddChunkSizes(the, length, bufferInfo->value.bufferInfo.len... |
<vulnerable_code>import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import test_util
from tensorflow.python.ops import gradient_checker
from tensorflow.python.ops import gradients_impl
strides=(1, 1, 1),
padding="SAME")
if __name__ == "__main__":
... |
<vulnerable_code>
def testMaxPool3DZeroPoolSize(self):
# Test case for GitHub issue 51936.
with self.session():
with self.assertRaises((errors.InvalidArgumentError, ValueError)):
input_sizes = [3, 4, 10, 11, 12]
input_data = 1.
input_tensor = constant_op.constant(
in... |
<vulnerable_code> memset(state, 128, sizeof(state));
if (f->version < 2) {
int chroma_planes, chroma_h_shift, chroma_v_shift, transparency;
unsigned v= get_symbol(c, state, 0);
if (v >= 2) {
av_log(f->avctx, AV_LOG_ERROR, "invalid version %d in ver01 header\n", v);
... |
<vulnerable_code> const auto cert = json.object().value("ocs").toObject().value("data").toObject().value("public-key").toString();
_certificate = QSslCertificate(cert.toLocal8Bit(), QSsl::Pem);
_publicKey = _certificate.publicKey();
Bio certificateBio;
const a... |
<vulnerable_code> int32_t ret = 0;
fuse_private_t *private = NULL;
gf_boolean_t start_thread = _gf_false;
glusterfs_graph_t *graph = NULL;
struct pollfd pfd = {0};
graph = data;
gf_log("fuse", GF_LOG_DEBUG, "got event %d on graph %d", event,
((graph) ? graph->id : 0));
swit... |
<vulnerable_code> tooltip: t('delete'),
handler: function (grid, rowIndex) {
let data = grid.getStore().getAt(rowIndex);
pimcore.helpers.deleteConfirm(t('predefined_metadata'), data.data.name, function () {
... |
<vulnerable_code> tooltip: t('delete'),
handler: function (grid, rowIndex) {
let data = grid.getStore().getAt(rowIndex);
pimcore.helpers.deleteConfirm(t('predefined_properties'), data.data.name, function () {
... |
<vulnerable_code>
static char **pool;
struct SWF_ACTIONPUSHPARAM *regs[256];
static char *getName(struct SWF_ACTIONPUSHPARAM *act);
sprintf(t,"%ld", act->p.Integer );
return t;
case PUSH_CONSTANT: /* CONSTANT8 */
t=malloc(strlenext(pool[act->p.Constant8])+3); /* 2 "'"s and a NULL */
strcpy(t,"'");
strcatex... |
<vulnerable_code>
if (code->ctor) {
/* Array of the form [,,,], [1,,]. */
value = array->start;
length = array->length;
do {
njs_set_invalid(value);
value++;
length--;
} while (length != 0);
} e... |
<vulnerable_code> { njs_str("(new Function('return 5' + '** 1'.repeat(2**13)))()"),
njs_str("5") },
{ njs_str("(new Function('var a = 7; return a' + '= a'.repeat(2**13)))()"),
njs_str("7") },
<commit_title>[PATCH] Fixed allocation of large array literals.<commit_description>Previously, allocation of... |
<vulnerable_code> csv = os.path.join(base, 'messages.csv')
po2csv([po, csv])
def update_loc(self, locale, no_csv):
for loc in locale:
if not no_csv:<commit_title>[PATCH] Localization / doc fixes (#650)<commit_description>* localization / doc fixes:
- add missing h... |
<vulnerable_code>
from six.moves.urllib.parse import urlsplit, quote
from jinja2 import Environment, TemplateNotFound, contextfunction
from jinja2 import FileSystemLoader, PackageLoader, ChoiceLoader
from babel.support import Translations
if overlay:
jinja_env = overlay.jinja_env.overlay(loader=l... |
<vulnerable_code> assert resp.status_int == 200
assert resp.content_type == 'text/html'
assert 'overriden search page: ' in resp.text
print(resp.text)
assert '"some":"value"' in resp.text, resp.text
def test_replay_banner_metadata(self, fmod):
""" Test adding metadata... |
<vulnerable_code> self.broker = Broker(activate_compat=False)
self.router = Router(self.broker)
self.router.debug = self.config.get('debug', False)
self.router.undirectional = self.config['unidirectional']
self.router.add_handler(
fn=self._on_shutdown_msg,
... |
<vulnerable_code>import time
import zlib
import unittest2
import testlib
import mitogen.master
import mitogen.parent
import mitogen.utils
))
class UnidirectionalTest(testlib.RouterMixin, testlib.TestCase):
def test_siblings_cant_talk(self):
self.router.unidirectional = True
l1 = self.rou... |
<vulnerable_code>#ifdef PITCH_WORKAROUND
if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
/* Ajust overlay width according to pitch */
XFree(hwdata->image);
width = hwdata->image->pitches[0] / bpp;
hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
0, ... |
<vulnerable_code> * execute Redis command and deal with return value
*/
static redisReply* oidc_cache_redis_command(request_rec *r,
oidc_cache_cfg_redis_t *context, const char *command) {
redisReply *reply = NULL;
int i = 0;
/* try to execute a command at max 2 times while reconnecting */
for (i = 0; i < OIDC_... |
<vulnerable_code> });
});
describe('existing session and keeping session data', function() {
var passport = new Passport();
<commit_title>[PATCH] Add tests.<commit_description><fixed_code>
});
});
describe('existing session and not keeping session data', function() {
... |
<vulnerable_code> qCDebug(lcPropagateDownloadEncrypted) << "Metadata Received reading"
<< _item->_instruction << _item->_file << _item->_encryptedFileName;
const QString filename = _info.fileName();
auto meta = new FolderMetadata(_propagator->account(), json.toJson(QJsonDocu... |
<vulnerable_code>{
qCDebug(lcPropagateUploadEncrypted) << "Metadata Received, Preparing it for the new file." << json.toVariant();
// Encrypt File!
_metadata = new FolderMetadata(_propagator->account(), json.toJson(QJsonDocument::Compact), statusCode);
if (!_metadata->isMetadataSetup()) {
if (_isFolderLo... |
<vulnerable_code> // TODO: the following code is borrowed from PropagateDownloadEncrypted (see HydrationJob::onNewConnection() for explanation of next steps)
qCDebug(lcHydration) << "Metadata Received reading" << e2eMangledName();
const QString filename = e2eMangledName();
auto meta = new FolderMetadata(... |
<vulnerable_code>
/*VVC*/
gf_isom_check_position(s, (GF_Box *)ptr->vvc_config, &pos);
/*AV1*/
gf_isom_check_position(s, (GF_Box *)ptr->av1_config, &pos);
e = gf_isom_box_write_header(s, bs);
if (ptr->cfg.is_ec3) s->type = GF_ISOM_BOX_TYPE_DAC3;
if (e) return e;
e = gf_odf_ac3_cfg_write_bs(&ptr->cfg, bs);
... |
<vulnerable_code> GF_Box *newBox;
Bool skip_logs = (gf_bs_get_cookie(bs) & GF_ISOM_BS_COOKIE_NO_LOGS ) ? GF_TRUE : GF_FALSE;
Bool is_special = GF_TRUE;
if ((bs == NULL) || (outBox == NULL) ) return GF_BAD_PARAM;
*outBox = NULL;
if (gf_bs_available(bs) < 8) {
BOX_DEFINE_S_CHILD( GF_QT_SUBTYPE_YVYU, video_sample_... |
<vulnerable_code> }
if (static_sample && ! (*sample)->alloc_size )
(*sample)->alloc_size = (*sample)->dataLength;
return GF_OK;
}
if (!map) return NULL;
tsel = (GF_TrackSelectionBox*)gf_list_get(map->boxes, group_index-1);
if (!tsel) return NULL;
*switchGroupID = tsel->switchGroup;
*criteriaListSize =... |
<vulnerable_code>import io.snyk.languageserver.LsRuntimeEnvironment;
import io.snyk.languageserver.download.HttpClientFactory;
import io.snyk.languageserver.download.LsBinaries;
import org.eclipse.core.net.proxy.IProxyData;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.Fiel... |
<vulnerable_code> return preferences;
}
public static final String AUTH_TOKEN_KEY = "authtoken";
public static final String PATH_KEY = "path";
public static final String ENDPOINT_KEY = "endpoint";<commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
ret... |
<vulnerable_code> private static final String TEST_PARAMS = "test";
private static final String FILE_PARAM = "--file=";
private static final String INSECURE = "--insecure";
private static final String MONITOR_PARAM = "monitor";
// private static final String AUTH_PARAM = "auth";
private ProcessResult sny... |
<vulnerable_code><commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
package io.snyk.eclipse.plugin.runner;
public class UntrustedScanRequestedException extends RuntimeException {
private static final long serialVersionUID = 4849361078384083852L;
public Untrus... |
<vulnerable_code>import io.snyk.eclipse.plugin.properties.preferences.Preferences;
import io.snyk.eclipse.plugin.utils.SnykLogger;
import java.util.Collections;
import org.eclipse.core.resources.IProject;
@SuppressWarnings("restriction")
public class LsConfigurationUpdater {
public void configurationChanged() {
... |
<vulnerable_code>
public class LsBinaries {
private static final String LS_DOWNLOAD_BASE_URL = "https://static.snyk.io/snyk-ls";
public static final String REQUIRED_LS_PROTOCOL_VERSION = "3";
public static URI getBaseUri() {
return URI.create(String.format("%s/%s", LS_DOWNLOAD_BASE_URL, REQUIRED_LS_PROTOCOL_... |
<vulnerable_code>package io.snyk.languageserver.protocolextension;
import java.util.ArrayList;
import java.util.concurrent.CompletableFuture;
import org.eclipse.lsp4e.LSPEclipseUtils;
import org.eclipse.lsp4e.LanguageClientImpl;
import org.eclipse.lsp4e.ServerMessageHandler;
import org.eclipse.lsp4j.ExecuteCommandPar... |
<vulnerable_code><commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
package io.snyk.languageserver.protocolextension.messageObjects;
public class SnykTrustedFoldersParams {
private String[] trustedFolders;
public String[] getTrustedFolders() {
return trust... |
<vulnerable_code><commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
package io.snyk.eclipse.plugin.runner;
import static org.junit.jupiter.api.Assertions.*;
import java.io.File;
import org.junit.jupiter.api.Test;
import io.snyk.eclipse.plugin.properties.preferen... |
<vulnerable_code>
import static org.junit.jupiter.api.Assertions.*;
class SnykLanguageServerTest {
@Test
assertInstanceOf(LsConfigurationUpdater.Settings.class, output);
}
}<commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
import static org.junit.jupite... |
<vulnerable_code><commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
package io.snyk.languageserver.protocolextension;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.Bef... |
<vulnerable_code>import org.eclipse.equinox.security.storage.ISecurePreferences;
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.preferences.ScopedPreferenceSto... |
<vulnerable_code>import io.snyk.eclipse.plugin.properties.preferences.Preferences;
import io.snyk.eclipse.plugin.utils.SnykLogger;
import java.util.Collections;
import org.eclipse.core.resources.IProject;
Settings getCurrentSettings() {
Preferences preferences = Preferences.getInstance();
String activateSn... |
<vulnerable_code><commit_title>[PATCH 1/7] feat: add workspace trust feature for scanning<commit_description><fixed_code>
/*******************************************************************************
* Copyright (c) 2005-2008 VecTrace (Zingo Andersen) and others.
* All rights reserved. This program and the accompa... |
<vulnerable_code>public class SnykWizard extends Wizard implements INewWizard {
protected SnykWizardConfigureAPIPage configureAPIPage;
protected SnykWizardAuthenticatePage authenticatePage;
protected SnykWizardModel model;
protected IWorkbench workbench;
protected IStructuredSelection selection;
m... |
<vulnerable_code>import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import io.snyk.eclipse.plugin.... |
<vulnerable_code>import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import org.eclipse.lsp4j.ShowDocumentResult;
import org.eclipse.lsp4j.WorkDoneProgressCreateParams;
import org.eclipse.lsp4j.jsonrpc.service... |
<vulnerable_code> if (info->signed_data)
pixel_value=ReadDCMSignedShort(stream_info,image);
else
pixel_value=ReadDCMShort(stream_info,image);
if (info->polarity != MagickFalse)
pixel_value=(int) info->max_value-pixel_va... |
<vulnerable_code> ModelAndView mv = null;
if(!password.equals(confirmPassword)) {
model.setErrorMessage("Bad username/password. ");
request.setAttribute("attemptedAccount", new Account(username, email, avatarPath, Roles.User, password));
mv = new ModelAndView(model, "/WEB-INF/register.jsp");
}
if(!em... |
<vulnerable_code>
public class DatabaseAccess implements DataService {
/* (non-Javadoc)
* @see models.DataService#login(java.lang.String, java.lang.String)
*/
public Account login(String username, String password){
Account account = null;
Driver driver = new SQLServerDriver();
String connectionUrl = "jdbc:... |
<vulnerable_code>static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
{
int i;
struct gsm_dlci *dlci = gsm->dlci[0];
struct gsm_msg *txq, *ntxq;
gsm->dead = true;
mutex_lock(&gsm->mutex);
if (dlci) {
if (disc && dlci->state != DLCI_CLOSED) {
gsm_dlci_begin_close(dlci);<commit_title>[PATCH] tty: n_gs... |
<vulnerable_code>Prism.languages.markup = {
'comment': /<!--[\s\S]*?-->/,
'prolog': /<\?[\s\S]+?\?>/,
'doctype': {
// https://www.w3.org/TR/xml/#NT-doctypedecl<commit_title>[PATCH] Markup: Fixed ReDoS (#3078)<commit_description><fixed_code>
Prism.languages.markup = {
'comment': /<!--(?:(?!<!--)[\s\S])*?-->/,
'pr... |
<vulnerable_code>Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greed... |
<vulnerable_code>********************************************** */
Prism.languages.markup = {
'comment': /<!--[\s\S]*?-->/,
'prolog': /<\?[\s\S]+?\?>/,
'doctype': {
// https://www.w3.org/TR/xml/#NT-doctypedecl<commit_title>[PATCH] Markup: Fixed ReDoS (#3078)<commit_description><fixed_code>
***********************... |
<vulnerable_code> expect(result.results.length).toEqual(0);
});
it('query with wrongly encoded parameter', done => {
rest
.create(config, nobody, 'TestParameterEncode', { foo: 'bar' })<commit_title>[PATCH] fix: brute force guessing of user sensitive data via search<commit_description><fixed_code>
... |
<vulnerable_code> return result;
};
const specialQuerykeys = [
'$and',
'$or',
'$nor',
'_rperm',
'_wperm',
'_perishable_token',
'_email_verify_token',
'_email_verify_token_expires_at',
'_account_lockout_expires_at',
'_failed_login_count',
];
const isSpecialQueryKey = key => {
return specialQuery... |
<vulnerable_code> .then(() => {
return this.buildRestWhere();
})
.then(() => {
return this.handleIncludeAll();
})
});
};
// Augments this.response with all pointers on an object
RestQuery.prototype.handleIncludeAll = function () {
if (!this.includeAll) {<commit_title>[PATCH] fix: brute f... |
<vulnerable_code> if (!Buffer)
Stream_Seek(user_data->data, (NumberOfPackets * 12));
iso_packet_size = BufferSize / NumberOfPackets;
iso_transfer = libusb_alloc_transfer(NumberOfPackets);
if (iso_transfer == NULL)
{
WLog_Print(urbdrc->log, WLOG_ERROR, "Error: libusb_alloc_transfer.");
async_transfer_user_da... |
<vulnerable_code>
// x = x mod m (HAC 14.42)
function barrettReduce(x) {
x.drShiftTo(this.m.t-1,this.r2);
if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);<commit_title>[PATCH] Merge pull request from GHSA-5h4j-qrvg-9xhw<commit_description><fixed_code>
// ... |
<vulnerable_code> forge.cipher.registerAlgorithm(name, factory);
})();
module.exports = forge;<commit_title>[PATCH] Merge pull request from GHSA-5h4j-qrvg-9xhw<commit_description><fixed_code>
forge.cipher.registerAlgorithm(name, factory);
})();
// Ensure that the jsbn modInverse function always returns a positive ... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-5h4j-qrvg-9xhw<commit_description><fixed_code>
/*!
*
* Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
*/
"use strict";
var assert = require("chai").assert;
const CURVES = require('../../lib/deps/ecc/curves.js');
const BigInteger = requir... |
<vulnerable_code> }
// load section
song_data = new unsigned char[decompressed_filesize];
unsigned char* compressed_song_data = new unsigned char[filesize-3];
fp.close(f);
// attempt to decompress the song data
// if unsuccessful, deallocate song_data[] on the spot, and return(false)
data_block sour... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.