text stringlengths 79 3.72M |
|---|
<vulnerable_code>import org.hisp.dhis.configuration.ConfigurationService;
import org.hisp.dhis.dxf2.webmessage.WebMessageException;
import org.hisp.dhis.dxf2.webmessage.WebMessageUtils;
import org.hisp.dhis.fieldfilter.Defaults;
import org.hisp.dhis.fileresource.FileResource;
import org.hisp.dhis.fileresource.FileResou... |
<vulnerable_code>import org.hisp.dhis.dxf2.webmessage.WebMessageException;
import org.hisp.dhis.dxf2.webmessage.WebMessageUtils;
import org.hisp.dhis.dxf2.webmessage.responses.FileResourceWebMessageResponse;
import org.hisp.dhis.feedback.ErrorCode;
import org.hisp.dhis.feedback.Status;
import org.hisp.dhis.fileresource... |
<vulnerable_code>import org.hisp.dhis.dxf2.webmessage.WebMessageUtils;
import org.hisp.dhis.dxf2.webmessage.responses.FileResourceWebMessageResponse;
import org.hisp.dhis.event.EventStatus;
import org.hisp.dhis.fieldfilter.FieldFilterParams;
import org.hisp.dhis.fieldfilter.FieldFilterService;
import org.hisp.dhis.file... |
<vulnerable_code><commit_title>[PATCH 1/7] fix: DHIS2-11799<commit_description><fixed_code>
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*... |
<vulnerable_code> */
package org.hisp.dhis.webapi.security.config;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.hisp.dhis.security.oidc.OIDCLoginEnabledCondition;
import org.hisp.dhis.security.spring2fa.TwoFactorAuthenticationProvider;
import org.hisp.dhis.webapi.filter.CorsFilter;
... |
<vulnerable_code> */
package org.hisp.dhis.webapi.utils;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.lang3.StringUtils;
import org.hisp.dhis.dxf2.webmessage.WebMessageException;
import org.hisp.dhis.dxf2.webmessage.WebMessageUtils;
import org.hisp.dhis.fileres... |
<vulnerable_code><commit_title>[PATCH 1/7] fix: DHIS2-11799<commit_description><fixed_code>
/*
* Copyright (c) 2004-2022, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*... |
<vulnerable_code> */
package org.hisp.dhis.security.action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
// -------------------------------------------------------------------------
// Input & Output
// ------------------------------------------------------------------------... |
<vulnerable_code>import org.hisp.dhis.security.MappedRedirectStrategy;
import org.hisp.dhis.security.ldap.authentication.CustomLdapAuthenticationProvider;
import org.hisp.dhis.security.oidc.DhisOidcLogoutSuccessHandler;
import org.hisp.dhis.security.spring2fa.TwoFactorAuthenticationProvider;
import org.hisp.dhis.securi... |
<vulnerable_code> .expiredUrl( "/dhis-web-commons-security/logout.action" )
.sessionRegistry( sessionRegistry() );
}
@Bean
public DefaultCookieSerializer defaultCookieSerializer()
{
DefaultCookieSerializer defaultCookieSerializer = new DefaultC... |
<vulnerable_code>
import javax.servlet.http.HttpServletResponse;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
svg = replaceUnsafeSvgText( svg );
PNGTranscoder transcoder = new PNGTransco... |
<vulnerable_code> AUDIT_ENABLED( "system.audit.enabled", Constants.TRUE, false ),
TRACKER_IMPORT_PREHEAT_CACHE_ENABLED( "tracker.import.preheat.cache.enabled", Constants.ON, false ),
ENABLE_OAUTH2_AUTHORIZATION_SERVER( "oauth2.authorization.server.enabled", Constants.ON, false ),
ENABLE_JWT_OIDC_TOKEN_AU... |
<vulnerable_code> self.assertFalse(
base.CsrfTokenManager.is_csrf_token_valid(uid, 'new_token'))
self.assertFalse(
base.CsrfTokenManager.is_csrf_token_valid(uid, 'new/token'))
def test_non_default_csrf_secret_is_used(self) -> None:
base.CsrfTokenManager.create_csrf_to... |
<vulnerable_code> key = "area_km2"
if "WHERE" in filter_cond:
filter_cond = filter_cond + f" AND {view_name}.{key} >= {area[0]} AND" \
f" {view_name}.{key} < {area[1]}"
else:
filter_cond = f" WHERE {view_name}.{key} >= {area[0]} AND ... |
<vulnerable_code> total_clusters = total_clusters + 1;
if (
centroids[key].feature.properties.grid_dist_km >= currentfilter.ogmindtg &&
centroids[key].feature.properties.grid_dist_km < currentfilter.ogmaxdtg &&
centroids[key].feature.properties.building_count >= currentfilter.ogminb ... |
<vulnerable_code><commit_title>[PATCH] - Add a patch to fix heap overflow - Bump PORTREVISION<commit_description>Obtained from: https://github.com/the-tcpdump-group/tcpdump/issues/446
MFH: 2015Q2
Security: CVE-2015-3138<fixed_code>
From 8aa5edea1b8846740514dee4158b6c707d38fc13 Mon Sep 17 00:00:00 2001
From: Denis Ovsi... |
<vulnerable_code> is greater than this value.
:param cookie: Name of the HTTP cookie that contains the client session
id. If set to ``None``, a cookie is not sent to the client.
:param cors_allowed_origins: List of origins that are allowed to connect
... |
<vulnerable_code> id. If set to ``None``, a cookie is not sent to the client.
The default is ``'io'``.
:param cors_allowed_origins: Origin or list of origins that are allowed to
connect to this server. All origins are
... |
<vulnerable_code> s = asyncio_server.AsyncServer()
_run(s.handle_request('request'))
headers = a._async['make_response'].call_args[0][1]
self.assertIn(('Access-Control-Allow-Origin', '*'), headers)
self.assertIn(('Access-Control-Allow-Credentials', 'true'), headers)
@mock.pat... |
<vulnerable_code> start_response = mock.MagicMock()
s.handle_request(environ, start_response)
headers = start_response.call_args[0][1]
self.assertIn(('Access-Control-Allow-Origin', '*'), headers)
self.assertIn(('Access-Control-Allow-Credentials', 'true'), headers)
def test_co... |
<vulnerable_code> return ''
def clean_id(id_):
'''
Returns if the passed id is clean.
'''
if re.search(r'\.\.\{sep}'.format(sep=os.sep), id_):
return False
return True
def valid_id(opts, id_):
'''
Returns if the passed id is valid
'''
try:
return bool(clean_pat... |
<vulnerable_code> opts = {'pki_dir': '/tmp/whatever'}
self.assertFalse(valid_id(opts, None))
def test_zmq_verify(self):
self.assertTrue(zmq_version())
<commit_title>[PATCH] Don't allow path separators in minion ID<commit_description><fixed_code>
opts = {'pki_dir': '/tmp/whatever'}
... |
<vulnerable_code>from tensorflow.python.tpu import tpu
from tensorflow.python.tpu import tpu_feed
from tensorflow.python.tpu import training_loop
class TPUContextTest(test.TestCase):
graph.get_operation_by_name("import/y").get_attr(
tpu._TPU_REPLICATE_ATTR)
def do_einsum():
a = array_ops.placeh... |
<vulnerable_code>free:
kfree(table);
out:
return -ENOBUFS;
}
struct net *net = dev_net(dev);
struct ctl_table *table;
table = mdev->sysctl->ctl_table_arg;
unregister_net_sysctl_table(mdev->sysctl);
kfree(table);<commit_title>[PATCH] net: mpls: fix stale pointer if allocation fails during<commit_description><fi... |
<vulnerable_code> */
package com.xpn.xwiki.web;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.script.ScriptContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xwiki.component.annotation.Component;
import org.xwiki.rendering.syntax.Syntax;
import com.xpn.xwiki.XWikiCon... |
<vulnerable_code>import org.xwiki.context.ExecutionContextManager;
import org.xwiki.environment.Environment;
import org.xwiki.environment.internal.ServletEnvironment;
import org.xwiki.model.internal.reference.EntityReferenceFactory;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.model.reference.Do... |
<vulnerable_code><commit_title>[PATCH] XWIKI-20385: Improve author handling in the edit action<commit_description><fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under ... |
<vulnerable_code>xmit_failed:
can_free_echo_skb(priv->netdev, ctx->ndx, NULL);
mcba_usb_free_ctx(ctx);
dev_kfree_skb(skb);
stats->tx_dropped++;
return NETDEV_TX_OK;<commit_title>[PATCH] can: mcba_usb: mcba_usb_start_xmit(): fix double<commit_description><fixed_code>
xmit_failed:
can_free_echo_skb(priv->netdev, c... |
<vulnerable_code> !cpumask_test_cpu(cpu_id, buffer->cpumask))
return size;
size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
size *= BUF_PAGE_SIZE;
/* we need a minimum of two pages */
if (size < BUF_PAGE_SIZE * 2)
size = BUF_PAGE_SIZE * 2;
nr_pages = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
/*
* Don't succeed if... |
<vulnerable_code>import _hashlib # type: ignore # noqa
import py7zr.win32compat
# String used at the beginning of relative paths
RELATIVE_PATH_MARKER = "./"
def islink(path):
"""
Cross-platform islink implementation.
Supports Windows NT symbolic links and reparse points.
"""
is_symlink = os.path... |
<vulnerable_code> MemIO,
NullIO,
calculate_crc32,
filetime_to_dt,
readlink,
remove_relative_path_marker,
)
from py7zr.properties import DEFAULT_FILTERS, FILTER_DEFLATE64, MAGIC_7Z, get_default_blocksize, get_memory_limit
from py7zr.win32compat import is_windows_native_python, is_windows_unc_path
... |
<vulnerable_code> for i, cf in enumerate(archive.files):
assert cf is not None
archive.worker.register_filelike(cf.id, None)
archive.worker.extract(archive.fp, parallel=True)
archive.close()
<commit_title>[PATCH] Fix sanity check for path traversal attack<commit_description>- Previous versio... |
<vulnerable_code><commit_title>[PATCH] Fix sanity check for path traversal attack<commit_description>- Previous versions do not detect the attack in some case
- fixed it by call resolve()
- resolve() converts "/hoge/fuga/../../../tmp/evil.sh" to be "/tmp/evil.sh" then
relative_to() can detect path traversal ... |
<vulnerable_code>#define MULTIPLIER 37
static unsigned long get_ctl_id_hash(const struct snd_ctl_elem_id *id)
{
unsigned long h;
const unsigned char *p;
h = id->iface;
h = MULTIPLIER * h + id->device;
h = MULTIPLIER * h + id->subdevice;
for (p = id->name; *p; p++)
h = MULTIPLIER * h + *p;
h = MULTIPLIER * h +... |
<vulnerable_code> data_dict = {}
for key in data:
if self.is_yaml(key):
data_dict[key] = yaml.load(data[key])
else:
data_dict[key] = json.loads(data[key])
return {}
if self.is_yaml(name):
return yaml.load(data[name]... |
<vulnerable_code> if os.path.exists(file_path):
with open(file_path) as f:
try:
self.container = yaml.load(f) or {}
except yaml.scanner.ScannerError as e:
msg = ('Failed to parse YAML file "{file}": {reason}'
... |
<vulnerable_code> self._testError(
np.arange(0., 30).reshape([2, 3, 5]), [0, 1, 1], "2 is missing")
if __name__ == "__main__":
test.main()<commit_title>[PATCH 2/2] Address review comment and merge tests into<commit_description><fixed_code>
self._testError(
np.arange(0., 30).reshape([2, 3, 5])... |
<vulnerable_code> np.arange(0, 16).reshape([1, 2, 1, 2, 1, 2, 1, 2]).astype(np.float64))
def testComplex64(self):
self._testBoth(
np.complex(1, 2) *
np.arange(0, 21).reshape([3, 7]).astype(np.complex64))
np.arange(0, 1260).reshape([2, 3, 5, 7, 2, 3]).astype(np.complex64))
def te... |
<vulnerable_code>
int exitStatus = 0;
//
// check input
//
{
MultiPartInputFile input (inFile);
int parts = input.parts();
if (partnum < 0 || partnum >= parts){
cerr << "ERROR: you asked for part " << partnum << " in " << inFile;
cerr << ", which onl... |
<vulnerable_code>#include "MagickCore/module.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/property.h"
#include "MagickCore/resource_.h"
#include "MagickCore/static.h"
#include "MagickCore/st... |
<vulnerable_code>
#define CHECKOVERFLOW(offset,datasize,structsize) (( offset >= datasize) || (structsize > datasize) || (offset > datasize - structsize ))
static void
exif_mnote_data_canon_clear (ExifMnoteDataCanon *n)
{
ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne;
ExifShort c;
size_t i, tcount, o, datao;
... |
<vulnerable_code> result = {}
result["configs"] = {}
with open(config_path) as f:
cfg = yaml.load(f.read(), Loader=yaml.FullLoader)
# get world path
result["world_path"] = cfg.get("world_module")
if not result["world_path"]:<commit_title>[PATCH] RCE Fixed (#3402)<commit_descri... |
<vulnerable_code><commit_title>[PATCH] Limit maximum allowed NFA and DFA size.<commit_description>Instead of failing with an out of memory exception or crashing with a
stack overflow, emit an error message and exit. This is a partial fix
for bug #394 "Stack overflow due to recursion in src/dfa/dead_rules.cc",
where re2... |
<vulnerable_code>#include "jv_dtoa.h"
#include "jv_unicode.h"
#define ESC "\033"
#define COL(c) (ESC "[" c "m")
#define COLRESET (ESC "[0m")
}
}
}
switch (jv_get_kind(x)) {
default:
case JV_KIND_INVALID:
if (flags & JV_PRINT_INVALID) {<commit_title>[PATCH] Skip printing what's below a MAX_PRINT_D... |
<vulnerable_code>
if( rc==SQLITE_OK ){
zPath = (const char*)sqlite3_value_text(apVal[2]);
nPath = (int)strlen(zPath);
mTime = zipfileGetTime(apVal[4]);
}<commit_title>[PATCH] Fix the zipfile extension so that INSERT works even if the<commit_description><fixed_code>
if( rc==SQLITE_OK ){
... |
<vulnerable_code> }
private void parseAndLoginFromWebView(String dataString) {
String prefix = getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/";
LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, dataString);
try {
if (mHostUrlInput != null) {
... |
<vulnerable_code> Uri data = getIntent().getData();
if (data != null) {
String prefix = getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/";
LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, data.toString());
TextView loginText = findViewById(R... |
<vulnerable_code> spos = a->start.pos;
epos = a->end.pos;
}
pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col,
rows > 1,
form->type == FORM_INPUT_PASSWORD);<commit_title>[PATCH] Prevent segfault for formUpdateBuffer<commit_description>Bug-Debian: https://github.com/tats/w3m/issu... |
<vulnerable_code> ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
ctxt->input->cur += l; \
if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \
} while (0)
#define CUR_CHAR(l) xmlCurrentChar(ctxt, &l)
len += l;
NEXTL(l);
c = CUR_CHAR(l);
... |
<vulnerable_code> { "Error cases regression tests",
errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err",
0 },
#ifdef LIBXML_READER_ENABLED
{ "Error cases stream regression tests",
streamParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".str",<commit_title>[PATCH] Fix hand... |
<vulnerable_code>
package e2e;
import com.webauthn4j.springframework.security.webauthn.sample.SampleSPA;
import e2e.page.AuthenticatorLoginComponent;
import e2e.page.PasswordLoginComponent;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator;
imp... |
<vulnerable_code> );
AuthenticationParameters authenticationParameters = new AuthenticationParameters(
parameters.getServerProperty(),
new AuthenticatorImpl(
webAuthnAuthenticator.getAttestedCredentialData(),
webAuthnAuthenti... |
<vulnerable_code>import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.thymeleaf.ITemplateEngine;
import org.thymeleaf.TemplateEngine;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
final String serverBase = theRequest.... |
<vulnerable_code> if (rtm->rtm_flags & RTM_F_LOOKUP_TABLE)
table_id = rt->rt_table_id;
if (rtm->rtm_flags & RTM_F_FIB_MATCH)
err = fib_dump_info(skb, NETLINK_CB(in_skb).portid,
nlh->nlmsg_seq, RTM_NEWROUTE, table_id,
rt->rt_type, res.prefix, res.prefixlen,
fl4.flowi4_tos, res.fi, 0);
else... |
<vulnerable_code>
})
suite('redos', function () {
var parse = refImpl(regexes).parse
function timer () {
var start = Date.now()
return function () {
return Date.now() - start
}
}
function testRedos (ua) {
var time = timer()
parse(ua)
var diff = time()
assert.ok(diff < 300, d... |
<vulnerable_code> case CHAR_NOTE:
p = parse_note(p - 1, flags);
flags &= ABC_F_GRACE;
parse.last_sym->u.note.slur_st = slur;
slur = 0;
if (parse.last_sym->u.note.notes[0].len > 0) /* if not space */
curvoice->last_note = parse.last_sym;
break;
case CHAR_SLASH: /* '/' */
if (flags & ABC_F_GR... |
<vulnerable_code> (void) CopyMagickString(write_info->magick,images->magick,MagickPathExtent);
p=images;
for ( ; GetNextImageInList(p) != (Image *) NULL; p=GetNextImageInList(p))
if (p->scene >= GetNextImageInList(p)->scene)
{
register ssize_t
i;
p->scene=(size_t) i++;
... |
<vulnerable_code># `valgrind --tool=memcheck python check_jp2_overflow.py 2>&1 | grep Decode.c`
# the output should be empty. There may be python issues
# in the valgrind especially if run in a debug python
# version.
from PIL import Image
repro = ('00r0_gray_l.jp2', '00r1_graya_la.jp2'
)
for path i... |
<vulnerable_code>
// Presto based
/(opera\smini)\/([\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/([\w\.]+)/i, ... |
<vulnerable_code> //
// Clear all other capabilities, effectively discarding our root permissions.
cap_value_t newcaps[] = {CAP_NET_ADMIN, CAP_SETUID};
int numcaps = sizeof(newcaps)/sizeof(cap_value_t);
if (cap_set_flag(caps, CAP_EFFECTIVE, numcaps, newcaps, CAP_SET) ||
cap_set_flag(caps, CAP_PERMITTED, ... |
<vulnerable_code> import socks
except (ImportError, AttributeError):
socks = None
# Build the appropriate socket wrapper for ssl
ssl = None
ssl_CertificateError = getattr(ssl, "CertificateError", None)
def _ssl_wrap_socket(
sock, key_file, cert_file, disable_validation, ca_certs, ssl_versi... |
<vulnerable_code><commit_title>[PATCH] parse auth headers using pyparsing instead of regexp<commit_description>Fixes CPU burn DoS by cubic complexity of whitespace matching in
WWW_AUTH_RELAXED (default) regexp.<fixed_code>
import base64
import re
import pyparsing as pp
from .error import *
UNQUOTE_PAIRS = re.compile... |
<vulnerable_code><commit_title>[PATCH] parse auth headers using pyparsing instead of regexp<commit_description>Fixes CPU burn DoS by cubic complexity of whitespace matching in
WWW_AUTH_RELAXED (default) regexp.<fixed_code>
# All exceptions raised here derive from HttpLib2Error
class HttpLib2Error(Exception):
pass
... |
<vulnerable_code> # TODO: remove this fallback and copypasted socksipy module upon py2/3 merge,
# idea is to have soft-dependency on any compatible module called socks
from . import socks
from .iri2uri import iri2uri
RETRIES = 2
# All exceptions raised here derive from HttpLib2Error
class HttpLib2Error(E... |
<vulnerable_code> def run_tests(self):
# pytest may be not installed yet
import pytest
args = ['--forked', '--fulltrace', '--no-cov', 'tests/']
if self.test_suite:
args += ['-k', self.test_suite]
sys.stderr.write('setup.py:test run pytest {}\n'.format(' '.join(args... |
<vulnerable_code> msg = kind()
msg.raw = start_line
if kind is HttpRequest:
assert re.match(
br".+ HTTP/\d\.\d\r\n$", start_line
), "Start line does not look like HTTP request: " + repr(start_line)
msg.method, msg.uri, msg.proto = start_line.rstrip().decode().split(" ", 2)... |
<vulnerable_code>import httplib2
import pytest
import tests
# Test Basic Authentication
http = httplib2.Http()
password = tests.gen_password()
handler = tests.http_reflect_with_auth(
allow_scheme="basic", allow_credentials=(("joe", password),)
)
with tests.server_request(handler, request... |
<vulnerable_code> unsigned char doc_stack[DOC_STACK_SIZE];
size_t doc_stack_pointer = 0;
size_t array_index = 0;
unsigned int array_index_stack[ARRAY_INDEX_STACK_SIZE];
size_t array_index_stack_pointer = 0;
char array_index_buffer[ARRAY_INDEX_BUFFER_SIZE]; /* max BSON size */
int end_of_data;... |
<vulnerable_code> return i;
}
MONGO_EXPORT int bson_buffer_size( const bson *b ) {
return (b->cur - b->data + 1);
}
}
MONGO_EXPORT bson_type bson_iterator_next( bson_iterator *i ) {
int ds;
if ( i->first ) {
i->first = 0;
case BSON_INT:
return bson_iterator_int_raw( i );
case ... |
<vulnerable_code>}
/* If the name is part of a db ref ($ref, $db, or $id), then return true. */
static int bson_string_is_db_ref( const unsigned char *string, const int length ) {
int result = 0;
if( length >= 4 ) {
}
static int bson_validate_string( bson *b, const unsigned char *string,
... |
<vulnerable_code> return closesocket( socket );
}
int mongo_env_write_socket( mongo *conn, const void *buf, int len ) {
const char *cbuf = buf;
int flags = 0;
while ( len ) {
int sent = send( conn->sock, cbuf, len, flags );
if ( sent == -1 ) {
__mongo_set_error( conn, MONGO_... |
<vulnerable_code>MONGO_EXPORT void gridfile_write_buffer( gridfile *gfile, const char *data,
gridfs_offset length ) {
int bytes_left = 0;
int data_partial_len = 0;
int chunks_to_write = 0;
char *buffer;
bson *oChunk;
gridfs_offset to_write = length + gfile->pending_len;
}
}
MONGO_E... |
<vulnerable_code>
MONGO_EXPORT void __mongo_set_error( mongo *conn, mongo_error_t err, const char *str,
int errcode ) {
int errstr_size, str_size;
conn->err = err;
conn->errcode = errcode;
static const int ZERO = 0;
static const int ONE = 1;
static mongo_message *mongo... |
<vulnerable_code> // If one click upgrade, hide other content
addOneClickModal( this );
jQuery( '.frm_feature_label' ).html( this.getAttribute( 'data-upgrade' ) );
jQuery( '#frm_upgrade_modal h2' ).show();
$info.dialog( 'open' );<commit_title>[PATCH] data-upgrade fix<commit_description><fixed_code>
/... |
<vulnerable_code> paginatedResults[count] = {
"page_number": (i + 1),
"page_name": page.getName(),
"score": Math.round(pageScaledScore * 100) / 100,
"absolute_score": score['score'],
... |
<vulnerable_code> var goodSelections = [];
var goodSelectionIndexes = [];
var correctAnswers = [];
var gridContainerWrapper;
var gridContainer;
rows: 0,
columns: 0,
gridElements: [],
answers: []
};
presenter.ERROR_MESSAGES = {
}
};
function p... |
<vulnerable_code><commit_title>[PATCH 02/14] Revert "added page_id to paginated score (#824)" (#827)<commit_description>This reverts commit 4351ae900c48bfa6c7d8102fdbe762680c1586ab.<fixed_code>
TestCase("[Magic_Boxes] Events tests", {
setUp: function() {
this.presenter = AddonMagic_Boxes_create();
t... |
<vulnerable_code> this.presenter = AddonMagic_Boxes_create();
},
'test horizontal answer': function () {
var grid = [
['a', 'b', 'c'],
['k', 'o', 't'],
[true, true, true],
[false, false, false]
], answers = ["kot"];
var result = ... |
<vulnerable_code> value: function _enableEventsHandling() {
var _this7 = this;
var self = this;
this.mediaNode.onloadstart = function () {
return _this7.onStartLoadingCallback();
};
return _this7._onPausedCallback();
};
... |
<vulnerable_code> presenter.isStarted = false;
presenter.isErrorMode = false;
presenter.isShowAnswersActive = false;
presenter.executeCommand = function(name, params) {
switch(name.toLowerCase()) {
case 'hide'.toLowerCase():
presenter.getErrorCount = function(){
var error... |
<vulnerable_code> if (_this2.enableAnalyser) {
_this2.mediaAnalyserService.closeAnalyzing();
}
_this2.player.stopStreaming();
if (!_this2.model.disableRecording) {
_this2.recorder.stopRecording... |
<vulnerable_code> DownloadButton: "Download button",
ResetDialog: "Reset dialog",
StartRecording: "Start recording",
StopRecording: "Stop recording",
Disabled: "Disabled",
};
},<commit_title>[PATCH 02/14] Revert "added page_id to paginated score (#8... |
<vulnerable_code>
private void setGapText(int gapIndex, String text) {
if (view != null && gapIndex <= view.getChildrenCount() && gapIndex > 0) {
String gapID = this.getGapID(gapIndex);
view.setValue(gapID, text);
view.refreshMath();
values.put(gapID, text);
}
}
private String getGapID(int index) {
... |
<vulnerable_code> private final ArrayList<String> mathGapIds = new ArrayList<String>();
private boolean moduleHasFocus = false;
private int activeGapIndex = -1;
private TextElementDisplay activeGap = null;
private PageController pageController;
private ArrayList<InlineChoiceInfo> inlineChoiceInfoArrayList = new Ar... |
<vulnerable_code> return dictionary.toString();
}
public void addOutstretchPage(int y, int height, boolean dontMoveModules, String layoutName) {
this.outstretchPageDictionary.put(layoutName, new OutstretchPageHeight(y, height, dontMoveModules));
}
public boolean hasOutstretchPage(String layoutName) {
public O... |
<vulnerable_code>package com.lorepo.icplayer.client.model;
public class OutstretchPageHeight {
private int y; //starting stretch point
private int height; //value of stretching
private boolean dontMoveModules; //should move elements
public OutstretchPageHeight(i... |
<vulnerable_code> private int pageWeight = 1;
private int pageCustomWeight = 1;
private String semiResponsiveLayoutID = "default";
public PageHeightModifications heightModifications = new PageHeightModifications();
private boolean randomizeInPrint = false;
}
public void setSemiResponsiveLayoutID(String newLayo... |
<vulnerable_code> private boolean isReadingOn = false;
private Content contentModel;
private GradualShowAnswersService gradualShowAnswersService;
private String previousLayoutName = "";
public PageController(IPlayerController playerController) {
this.playerController = playerController;
if (gradualShowAnswers... |
<vulnerable_code> @Override
public void load(Element node, String baseURL, String version) {
// TODO Auto-generated method stub
}
@Override
public void setSemiResponsiveLayoutID(String semiResponsiveLayoutID) {
// TODO Auto-generated method stub
}
@Override<commit_title>[PATCH 02/14] Revert "added page_id... |
<vulnerable_code> key: "reset",
value: function reset() {
this.deactivate();
this.activate();
this.setVisibility(this.model["Is Visible"]);
this._setEnableState(!this.model.isDisabled);
}, {
key: "resetRecording",
value: function resetRe... |
<vulnerable_code> }
private static String removeCommaAfterGap(String text) {
return text.startsWith(".") ? text.substring(1) : text;
}
private static int getGapEndIndex(String text, int gapIndex) {<commit_title>[PATCH 02/14] Revert "added page_id to paginated score (#824)" (#827)<commit_description>This reverts ... |
<vulnerable_code> }
};
presenter.getActivitiesCount = function () {
return 1;
}
presenter.enableEdit = function () {
let paragraph = presenter.$view.find(".paragraph-wrapper");
};
presenter.getActivitiesCount = function Paragraph_getActivitiesCount () {
return ... |
<vulnerable_code> })
})
}
})
suite('Arrays', function () {<commit_title>[PATCH] Test prototype pollution on unflatten<commit_description><fixed_code>
})
})
}
test('should not pollute prototype', function () {
unflatten({
'__proto__.polluted': true
});
unflatten({
... |
<vulnerable_code> self.assertInBody("Cannot edit user `invalid`: user doesn't exists")
def test_user_invalid_root(self):
# Delete all user's
for user in UserObject.query.all():
if user.username != self.USERNAME:
user.delete().commit()
# Change the user... |
<vulnerable_code>
"""Represent one rdiff-backup repository."""
def __init__(self, user_root, path, encoding):
if isinstance(user_root, str):
user_root = os.fsencode(user_root)
if isinstance(path, str):
path = os.fsencode(path)
assert isinstance(user_root, bytes)
... |
<vulnerable_code>
@orm.reconstructor
def __init_on_load__(self):
RdiffRepo.__init__(
self, self.user.user_root, self.repopath, encoding=self.encoding or RepoObject.DEFAULT_REPO_ENCODING
)
@property
def displayname(self):
# Repository displayName is the "repopath" too... |
<vulnerable_code> userobj.expire()
self.assertEqual([''], sorted([r.name for r in userobj.repo_objs]))
class UserObjectWithAdminPassword(rdiffweb.test.WebCase):
<commit_title>[PATCH] Block repository access when user_root directory is empty or<commit_description><fixed_code>
userobj.expire()
... |
<vulnerable_code> for chunk in args:
if not chunk:
continue
if hasattr(chunk, 'owner') and hasattr(chunk, 'path'):
# This is a RepoObject
path += "/"
path += chunk.owner
path += "/"
path += rdw_helpers.quote_url(chunk.path.strip(... |
<vulnerable_code>class MockRdiffRepo(RdiffRepo):
def __init__(self):
p = bytes(pkg_resources.resource_filename('rdiffweb.core', 'tests'), encoding='utf-8') # @UndefinedVariable
RdiffRepo.__init__(self, os.path.dirname(p), os.path.basename(p), encoding='utf-8')
self.root_path = MockDirEntry(... |
<vulnerable_code>package com.thoughtworks.go.spark;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
public static String errorPage(int code, String message) {
return Holder.INSTANCE.replaceAll(buildRegex("status_code"), valueOf(code))
.replace... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.