text stringlengths 79 3.72M |
|---|
<vulnerable_code> if (null != window) {
String clientWindowId = Util.getClientWindowId(context);
writer.startUpdate(clientWindowId);
writer.write(window.getId());
writer.endUpdate();
}
}<commit_title>[PATCH] Fixes #4556 : HIGH-LEVEL VULNERABILITY WITHIN... |
<vulnerable_code> throw new Error('Invalid Pattern');
}
/**
* OR operator
* @param patterns
const res = (result) => {
let val = '';
if (!pattern || ((typeof pattern !== 'object') && (typeof pattern !== 'string') && typeof pattern !== 'function')) {
val = String(pattern)
} e... |
<vulnerable_code> t.ok(!validate(json, invalidPattern, { debug: true }), 'Invalid Case');
t.end();
});<commit_title>[PATCH] Fixed Validation Bypass Issue #10<commit_description><fixed_code>
t.ok(!validate(json, invalidPattern, { debug: true }), 'Invalid Case');
t.end();
});
// Corrupted Array Cases
con... |
<vulnerable_code>
const tap = require('tap');
const { validate, is, typeOf } = require('../index.js');
const json = {
key1: 'OK',
key2: 'Yes',
key3: 15,
};
const validPattern1 = {
key1: '{/OK/}',
key2: '!(string)',
key3: 15
}
// Valid Case
tap.test('Deprecated', function (t) {<commit_title>[P... |
<vulnerable_code>
const tap = require('tap');
const { validate, is, typeOf, exact } = require('../index.js');
const json = {
key1: 'OK',
key2: 'Yes',
key3: () => {
},
};
const validPattern1 = {
key3: '(function)'
};
// Valid Case
tap.test('Functional', function (t) {
t.ok(validate(json, vali... |
<vulnerable_code> url: '[url]'
},
key3: new RegExp('[0-9]+', 'i'),
key4: '[datetime]',
};
const pattern2 = {<commit_title>[PATCH] Fixed Validation Bypass Issue #10<commit_description><fixed_code>
url: '[url]'
},
key3: new RegExp('[0-9]+', 'i'),
key4: '[datetime]'
};
const patter... |
<vulnerable_code> number: 15,
bigint: BigInt(9007199254740991),
symbol: Symbol('A'),
function: () => {},
object: [],
};
const validShortTagPattern = {
bigint: '(bigint)',
symbol: '(symbol)',
function: '(function)',
object: '(object)',
};
const invalidShortTagPattern = {
string: '... |
<vulnerable_code>
const validPattern1 = {
key: and(typeOf('string'), is('length(2)'), 'OK'),
value: or(is('lt(100)'), and( not('1000'), is('lte(999)'), is('gt(900)'))),
};
const invalidPattern1 = {
key: and(typeOf('string'), is('length(2)'), 'OK'),
value: or(is('lt(100)'), and( not('1000'), is('lt(999)... |
<vulnerable_code> gte: is('gte(20)')
};
const j1 = {exist: null};
const s1 = {exist: '![exist]'};
const o1 = {exist: not(is('exist'))};
const j2 = {empty: 'yes'};
const s2 = {empty: '[empty]'};
const o2 = {empty: is('empty')};
const j3 = {empty: [1,2]};
const s3 = {empty: '[empty]'};
const o3 = {empty: is('empty'... |
<vulnerable_code>
const tap = require('tap');
const jpv = require('../index.js');
const {is} = jpv;
const json = {
key1: 'OK',
key2: NaN,
};
const pattern = {<commit_title>[PATCH] Fixed Validation Bypass Issue #10<commit_description><fixed_code>
const tap = require('tap');
const jpv = require('../index.js');... |
<vulnerable_code>
bool is_alpha(const char& chr)
{
return unsigned(chr - 'A') <= 'Z' - 'A' ||
unsigned(chr - 'a') <= 'z' - 'a';
}
bool is_space(const char& chr)
{
// adapted the technique from is_alpha
return chr == ' ' || unsigned(chr - '\t') <= '\r' - '\t';
}
... |
<vulnerable_code> link.icon = 'glyphicon glyphicon-cloud-download';
var html = "<span class='child_status'><span style='margin-right: 2px;color: #337ab7;' class='" + link.icon + "'></span></span>\n" +
"<span style='font-size: 16px; font-weight: bold;'><a href='" + link... |
<vulnerable_code> hdrlen = roundup2(hdrlen, 4);
if (ndo->ndo_Hflag && FC_TYPE(fc) == T_DATA &&
DATA_FRAME_IS_QOS(FC_SUBTYPE(fc))) {
meshdrlen = extract_mesh_header_length(p+hdrlen);
hdrlen += meshdrlen;
} else<commit_title>[PATCH] (for 4.9.3) CVE-2018-16227/IEEE 802.11: add a missing bounds<commit_descripti... |
<vulnerable_code> goto cleanup;
}
flash_img_init(&ctx.flash_ctx);
ctx.downloaded_size = 0;
<commit_title>[PATCH] lib: updatehub: Add flash_img_init return value check<commit_description>The flash_img_int return value is not checked for fail conditions.
This can result on useless download attempts once image will ... |
<vulnerable_code> StringPrototypeIncludes,
StringPrototypeToLowerCase,
StringPrototypeSplit,
Symbol,
SymbolAsyncIterator,
TypeError,
const upgrade = request.headers.get("upgrade");
const upgradeHasWebSocketOption = upgrade !== null &&
ArrayPrototypeSome(
StringPrototypeSplit(upgrade, /\s*,\s*/)... |
<vulnerable_code> [[0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 2, 3, 0, 0],
[0, 0, 4, 5, 6, 0, 0], [0, 0, 0, 0, 0, 0, 0]])
def testSymmetricMirrorPadGrad(self):
t = np.broadcast_to(np.arange(0, 7), (3, 2, 1, 7))
paddings = constant_op.constant([<commit_title>[PATCH] A... |
<vulnerable_code> y_resolution;
QuantumInfo
*quantum_info;
ssize_t
ping_rowbytes,
if (pixel_info != (MemoryInfo *) NULL)
pixel_info=RelinquishVirtualMemory(pixel_info);
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" exit ReadOne... |
<vulnerable_code> raise argparse.ArgumentTypeError(str(e))
return _url
def validate_url(url):
if os.path.exists(url):
with open(url, 'r') as opener:
content = opener.read()
else:
content = url
urls = []
for _url in content.splitlines():
if not _url:
... |
<vulnerable_code> @expose("/varimport", methods=["POST"])
@auth.has_access([(permissions.ACTION_CAN_CREATE, permissions.RESOURCE_VARIABLE)])
@action_logging(event=f"{permissions.RESOURCE_VARIABLE.lower()}.varimport")
def varimport(self):
"""Import variables."""
try:
variable_d... |
<vulnerable_code> _check_last_log(session, dag_id=None, event="variables.varimport", execution_date=None)
def test_import_variables_anon(session, app):
assert session.query(Variable).count() == 0
<commit_title>[PATCH] Fix updating variables during variable imports<commit_description>We should only create new v... |
<vulnerable_code> w = image->comps[0].w;
h = image->comps[0].h;
if(image->numcomps < 4) return;
max = w * h;
<commit_title>[PATCH] Fix Heap Buffer Overflow in function color_cmyk_to_rgb<commit_description>Fix uclouvain/openjpeg#774<fixed_code>
w = image->comps[0].w;
h = image->comps[0].h;
if (
(image->numc... |
<vulnerable_code> private static final boolean VARIANT_OBJECT_XML_SUPPORTED = Boolean
.getBoolean("org.restlet.engine.converter.DefaultConverter.VARIANT_OBJECT_XML_SUPPORTED");
@Override
public List<Class<?>> getObjectClasses(Variant source) {
List<Class<?>> result = null;
if (so... |
<vulnerable_code> * presentations from unstrusted sources can lead to malicious attacks. As
* pointed <a href=
* "http://blog.diniscruz.com/2013/08/using-xmldecoder-to-execute-server-side.html"
* >here</a> , the {@link XMLDecoder} is able to force the JVM to execute
* unwanted Java code described inside the XML fil... |
<vulnerable_code> */
var __htmlEscapeEntities = function ( d ) {
return typeof d === 'string' ?
d
.replace(/&/g, '&')<commit_title>[PATCH] e835ddc5b800c47f7e9e32a91cc522f8ca7ced5c Fix: If an array was<commit_description><fixed_code>
*/
var __htmlEscapeEntities = function ( d ) {
if (Array.isArra... |
<vulnerable_code>b){b=b.oLanguage.sDecimal;return tb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return Z(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);l.extend(... |
<vulnerable_code> headers = {'X-Vault-Token': vault_secret}
response = requests.get(vault_endpoint, headers=headers, verify=vault_endpoint_verify)
if response.status_code != 200:
logger.info(response.text)
raise ValueError(
'Could not get vault token, response code: {}'.format(
... |
<vulnerable_code> Assert.fail("Server should have disabled the checkbox again.");
}
Assert.assertEquals("Value 'foo' should have been re-selected", "[foo]",
infoLabel.getText());
Assert.assertTrue(<commit_title>[PATCH] fix: disabled items can now be part of a group's... |
<vulnerable_code>import com.vaadin.flow.data.selection.MultiSelect;
import com.vaadin.flow.data.selection.MultiSelectionEvent;
import com.vaadin.flow.data.selection.MultiSelectionListener;
import com.vaadin.flow.dom.PropertyChangeEvent;
import com.vaadin.flow.dom.PropertyChangeListener;
import com.vaadin.flow.function.... |
<vulnerable_code> group.getElement().getProperty("disabled"));
}
@Test
public void selectDisabledItem_noRedundantEvent() {
CheckboxGroup<String> group = new CheckboxGroup<>();
group.setItems("enabled", "disabled");
group.setItemEnabledProvider("enabled"::equals);
... |
<vulnerable_code> - utest__iotc_memory_calloc__max_num_minus_one__one_size
- utest__iotc_memory_calloc__overflow__half_max__size_two
- utest__iotc_memory_calloc__overflow__num_two__half_max_size
*/
IOTC_TT_TESTCASE(
utest__iotc_memory_calloc__num_0__size_8,
__iotc_free(ptr);
})
#ifndef __amd64... |
<vulnerable_code> // size * count > std::numeric_limits<uint64_t>::max()
// =>
// size > std::numeric_limits<uint64_t>::max() / count
if (size > std::numeric_limits<uint64_t>::max() / count)
... |
<vulnerable_code>/***** Local variables *****/
static const char *const filelist[] = {
"fdance03.dmo", // TwinTrack sample (skipped in playertest)
};
static const int filecount = sizeof(filelist) / sizeof(filelist[0]);<commit_title>[PATCH] Add regression test cases for issues #85 to #91<commit_description>While fuzz... |
<vulnerable_code>
setup_thread_stack(tsk, orig);
clear_user_return_notifier(tsk);
stackend = end_of_stack(tsk);
*stackend = STACK_END_MAGIC; /* for overflow detection */
<commit_title>[PATCH] Sched: fix skip_clock_update optimization<commit_description>idle_balance() drops/retakes rq->lock, leaving the previous tas... |
<vulnerable_code>
inline void update_rq_clock(struct rq *rq)
{
if (!rq->skip_clock_update) {
int cpu = cpu_of(rq);
u64 irq_time;
rq->clock = sched_clock_cpu(cpu);
irq_time = irq_time_cpu(cpu);
if (rq->clock - irq_time > rq->clock_task)
rq->clock_task = rq->clock - irq_time;
sched_irq_time_avg_update(r... |
<vulnerable_code> * Create a new command line object.
* Shell is autodetected from operating system
*
* @param toProcess
*/
public Commandline( String toProcess, Shell shell )
/**
* Create a new command line object.
* Shell is autodetected from operating system
*/
publ... |
<vulnerable_code> */
import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
public class BourneShell
extends Shell
{
private static final char[] BASH_QUOTING_TRIGGER_CHARS = {
' ',
'$',
';',
'&',
... |
<vulnerable_code>
private boolean quotedArgumentsEnabled = true;
private String executable;
private String workingDir;
private String argumentEscapePattern = "\\%s";
/**
* Set the command to execute the shell (eg. COMMAND.COM, /bin/bash,...)
*
return getRawCommandLine( executab... |
<vulnerable_code> * limitations under the License.
*/
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.shell.CmdShell;
import org.codehaus.plexus.util.cli.shell.Shell;
import java.io.File;
import java.io.FileW... |
<vulnerable_code> * limitations under the License.
*/
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.Commandline;
import java.util.Arrays;
import java.util.List;
import junit.framework.TestCase;
public class BourneShellTest
extends TestCase
{
String executable = Strin... |
<vulnerable_code> return ret;
}
int hugepage_madvise(struct vm_area_struct *vma,
unsigned long *vm_flags, int advice)
{
/*
* Be somewhat over-protective like KSM for now!
*/
if (*vm_flags & (VM_HUGEPAGE |
VM_SHARED | VM_MAYSHARE |
VM_PFNMAP | VM_IO | VM_DONTEXPAND |
VM_RESERV... |
<vulnerable_code><commit_title>[PATCH] fix: Remove code from database<commit_description><fixed_code>
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
from django.core.management import execute_from_command_line
execu... |
<vulnerable_code> # as that is done during validation of the login form
# and validation should not have any side effects.
# It is the responsibility of the view/form to delete the token
# as soon as the login was successfull.
user.login_code = LoginCode.object... |
<vulnerable_code> else:
site_name = domain = domain_override
url = '{}://{}{}?code={}'.format(
'https' if request.is_secure() else 'http',
domain,
resolve_url(login_code_url),
login_code.code,
)
class LoginCodeForm(forms.Form):
c... |
<vulnerable_code><commit_title>[PATCH] fix: Remove code from database<commit_description><fixed_code>
# Generated by Django 2.2 on 2019-04-06 13:22
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nopassword', '0001_initial'),
]
oper... |
<vulnerable_code># -*- coding: utf-8 -*-
import hashlib
import os
from django.conf import settings
from django.db import models
class LoginCode(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='login_codes',
editable=False, verbose_name=_('user'), on_del... |
<vulnerable_code> context=self.get_serializer_context(),
)
data = token_serializer.data
data['next'] = self.serializer.validated_data['code'].next
return Response(data, status=status.HTTP_200_OK)
def post(self, request, *args, **kwargs):<commit_title>[PATCH] fix: Remove c... |
<vulnerable_code>from django.db import models
try:
from django.contrib.auth.models import AbstractUser
except ImportError:
from django.db.models import Model as AbstractUser
<commit_title>[PATCH] fix: Remove code from database<commit_description><fixed_code>
from django.db import models
try:
from django.c... |
<vulnerable_code># -*- coding: utf8 -*-
import django
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'rest_framework',
'rest_framewo... |
<vulnerable_code> self.inactive_user = get_user_model().objects.create(username='inactive', is_active=False)
self.code = LoginCode.create_code_for_user(self.user)
def test_login_backend(self):
self.assertEqual(len(self.code.code), 64)
self.assertIsNotNone(authenticate(username=self.u... |
<vulnerable_code> self.assertEqual(login_code.next, '/private/')
self.assertEqual(len(mail.outbox), 1)
self.assertIn(
'http://testserver/accounts/login/code/?code={}'.format(login_code.code),
mail.outbox[0].body,
)
})
def test_login(self):
log... |
<vulnerable_code> self.assertEqual(login_code.next, '/private/')
self.assertEqual(len(mail.outbox), 1)
self.assertIn(
'http://testserver/accounts/login/code/?code={}'.format(login_code.code),
mail.outbox[0].body,
)
})
def test_login_post(self):
... |
<vulnerable_code># -*- coding: utf8 -*-
from django.conf.urls import include, url
urlpatterns = [
url(r'^accounts/', include('nopassword.urls')),
url(r'^accounts-rest/', include('nopassword.rest.urls')),
]<commit_title>[PATCH] fix: Remove code from database<commit_description><fixed_code>
# -*- coding: utf8 -*... |
<vulnerable_code> // [databind#2704]: xalan2
s.add("com.sun.org.apache.xalan.internal.lib.sql.JNDIConnectionPool");
// [databind#2478]: comons-dbcp, p6spy
s.add("org.apache.commons.dbcp.datasources.PerUserPoolDataSource");
s.add("org.apache.commons.dbcp.datasources.SharedPoolData... |
<vulnerable_code> }
auto it = offset_seg_.lower_bound(offset);
if (it->first == offset || it == it_begin) {
return it->second;
}
const auto it_end = offset_seg_.crbegin();<commit_title>[PATCH] Fix #784<commit_description><fixed_code>
}
auto it = offset_seg_.lower_bound(offset);
if (it != std::end(... |
<vulnerable_code>}
END_TEST
/* Test syntax error is caught at parse resumption */
START_TEST(test_resume_entity_with_syntax_error) {
const char *text = "<!DOCTYPE doc [\n"
tcase_add_test(tc_basic, test_partial_char_in_epilog);
tcase_add_test(tc_basic, test_hash_collision);
tcase_add_test__ifdef_xml_dtd(tc_basi... |
<vulnerable_code> TIFFUnmapBlob);
if (tiff == (TIFF *) NULL)
return(MagickFalse);
(void) DeleteImageProfile(image,"tiff:37724");
scene=0;
debug=IsEventLogging();<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/1532<commit_description><fixed_code>
TIFFUnmapBlob);
if (tiff == (... |
<vulnerable_code>
static int do_tkill(pid_t tgid, pid_t pid, int sig)
{
struct siginfo info;
info.si_signo = sig;
info.si_errno = 0;<commit_title>[PATCH] kernel/signal.c: stop info leak via the tkill and the tgkill<commit_description><fixed_code>
static int do_tkill(pid_t tgid, pid_t pid, int sig)
{
struct siginf... |
<vulnerable_code>import { Messages } from '../../../../app/models/client';
import VerticalBar from '../../../components/basic/VerticalBar';
import { useTranslation } from '../../../contexts/TranslationContext';
import RawText from '../../../components/basic/RawText';
import { useUserId } from '../../../contexts/UserCon... |
<vulnerable_code>
import VerticalBar from '../../../components/basic/VerticalBar';
import { useTranslation } from '../../../contexts/TranslationContext';
import RawText from '../../../components/basic/RawText';
import { useRoute, useCurrentRoute } from '../../../contexts/RouterContext';
import { call, renderMessageBody... |
<vulnerable_code>import React from 'react';
import Page from './Page';
import RawText from './RawText';
function VerticalBar({ children, ...props }) {
const mobile = useDebouncedValue(useMediaQuery('(max-width: 500px)'), 50);
</VerticalBar>;
}
function VerticalBarText({ children, ...props }) {
return <Box flexShr... |
<vulnerable_code> struct sock *sk = sock->sk;
lock_sock(sk);
if (sk->sk_state != TCP_LISTEN) {
memset(&nr_sk(sk)->user_addr, 0, AX25_ADDR_LEN);
sk->sk_max_ack_backlog = backlog;<commit_title>[PATCH] netrom: Fix use-after-free caused by accept on already<commit_description><fixed_code>
struct sock *sk = sock->sk... |
<vulnerable_code> * @return lista de notícias ordenadas
*/
public List<News> newsMoreRecentThan(String date){
Query query = em.createQuery("SELECT n FROM News n WHERE n.date > :d ORDER BY date DESC");
query.setParameter("d", date);
@SuppressWarnings("unchecked")
List<News> news = que... |
<vulnerable_code>
parser = lxml.etree.XMLParser(ns_clean=True,
recover=True,
encoding='utf-8')
xml = lxml.etree.fromstring(text, parser=parser)
<commit_title>[PATCH] Disable entities while parsing XML<commit_description><fixed_code>
parse... |
<vulnerable_code> return -EFAULT;
len = namelen;
if (namelen > 32)
len = 32;
down_read(&uts_sem);
down_read(&uts_sem);
res = sysinfo_table[offset];
len = strlen(res)+1;
if (len > count)
len = count;
if (copy_to_user(buf, res, len))
err = -EFAULT;
return 1;
case GSI_GET_HWRPB:
if (nbytes < sizeof(... |
<vulnerable_code> },
{
source: '/overridden',
destination: 'https://example.com',
},
],
}<commit_title>[PATCH] Update failing tests from upstream resource (#34110)<commit_description>Seems these were failing from https://example.com randomly 404ing
x-ref: https://gi... |
<vulnerable_code>let app
const runTests = (isDev = false) => {
it('should handle external beforeFiles rewrite correctly', async () => {
const res = await fetchViaHTTP(appPort, '/overridden')
expect(res.status).toBe(200)
expect(await res.text()).toContain('Example Domain')
const browser = await webdr... |
<vulnerable_code> ) {
const isExternal = url.searchParams.get('override') === 'external'
return NextResponse.rewrite(
isExternal ? 'https://example.com' : '/rewrites/a'
)
}
<commit_title>[PATCH] Update failing tests from upstream resource (#34110)<commit_description>Seems these were failing from ht... |
<vulnerable_code> it('should override with rewrite internally correctly', async () => {
const res = await fetchViaHTTP(
context.appPort,
'/rewrites/about',
{ override: 'internal' },
{ redirect: 'manual' }
)
it('should override with rewrite externally correctly', async () => {
cons... |
<vulnerable_code> * extend the write to cover the entire page in order to avoid fragmentation
* inefficiencies.
*
* If the file is opened for synchronous writes or if we have a write delegation
* from the server then we can just skip the rest of the checks.
*/
static int nfs_can_extend_write(struct file *file, str... |
<vulnerable_code> for (var name in source) {
var tval = target[name],
sval = source[name];
if (tval !== sval) {
if (shouldDeepCopy(sval)) {
if (Object.prototype.toString.call(sval) === '[object Date]') { // use this date test to handle crossing frame boundaries
target[name] = new Date(sva... |
<vulnerable_code> assert.equal(object1.banana.purchased.getTime(), new Date(2017, 0, 1).getTime());
},
'deepCopy with FormData': function(){
if (has('native-formdata')) {
var formData = new FormData();<commit_title>[PATCH] Merge pull request from GHSA-jxfh-8wgv-vfr2<commit_description><fixed_code>
asse... |
<vulnerable_code> mpgviddmx_enqueue_or_dispatch(ctx, dst_pck, GF_FALSE, GF_FALSE);
}
//parse headers
//we have a start code loaded, eg the data packet does not have a full start code at the beginning
if (sc_type_forced) {
gf_bs_reassign_buffer(ctx->bs, start + hdr_offset, remain - hdr_offset);<commit_tit... |
<vulnerable_code> });
Prism.hooks.add('before-tokenize', function (env) {
var erbPattern = /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s[\s\S]*?^=end)+?%>/gm;
Prism.languages['markup-templating'].buildPlaceholders(env, 'erb', erbPattern);
});
<commit_title>[PATCH] ERB: Fixed another case of exp backtracking<co... |
<vulnerable_code>!function(n){n.languages.erb=n.languages.extend("ruby",{}),n.languages.insertBefore("erb","comment",{delimiter:{pattern:/^<%=?|%>$/,alias:"punctuation"}}),n.hooks.add("before-tokenize",function(e){n.languages["markup-templating"].buildPlaceholders(e,"erb",/<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s... |
<vulnerable_code> nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
reflinkSearch: 'reflink|nolink(?!\\()',
emStrong: {
lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^(?:_+(?:([punct*])|([^\s_])))/,
// (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and ... |
<vulnerable_code> stream_t stream;
strbuffer_t saved_text;
size_t flags;
int token;
union {
struct {
{
json_t *json;
switch(lex->token) {
case TOKEN_STRING: {
const char *value = lex->value.string.val;
if(!json)
return NULL;
return json;
}
{
... |
<vulnerable_code>import { showError, showSuccess } from '@nextcloud/dialogs'
const config = new Config()
const passwordSet = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789'
/**
}
}
// generate password of 10 length based on passwordSet
return Array(10).fill(0)
.reduce((prev, curr) => {
prev += passw... |
<vulnerable_code>/*! For license information please see files_sharing-files_sharing_tab.js.LICENSE.txt */
!function(){"use strict";var e,n={68101:function(e,n,r){var i=r(20144),a=r(72268),s=r.n(a),o=r(31352),c=r(1794),l=r(79753),u=r(75925),h=r.n(u),d=r(4820),f=r(79954);function p(e){return p="function"==typeof Symbol&&... |
<vulnerable_code> (r"\)$", ")"), # round brackets
(r"\[$", "["),
(r"\]$", "]"), # square brackets
(r"^-?[0-9]+(.[0-9]+)?$", "CD"), # cardinal numbers
(r"(The|the|A|a|An|an)$", "DT"), # articles
(r"(He|he|She|she|It|it|I|me|Me|You|you)$", "PRP"),... |
<vulnerable_code>
regexp_tagger = RegexpTagger(
[
(r"^-?[0-9]+(.[0-9]+)?$", "CD"), # cardinal numbers
(r"(The|the|A|a|An|an)$", "AT"), # articles
(r".*able$", "JJ"), # adjectives
(r".*ness$", "NN"), # nouns formed from adjectives<co... |
<vulnerable_code> )
print(
"TRAIN ({tokencount:7d} tokens) initial {initialerrors:5d} {initialacc:.4f} "
"final: {finalerrors:5d} {finalacc:.4f} ".format(**train_stats)
)
head = "#ID | Score (train) | #Rules | Template"
prin... |
<vulnerable_code> # Training
def train(self, train_sents, max_rules=200, min_score=2, min_acc=None):
"""
Trains the Brill tagger on the corpus *train_sents*,
producing at most *max_rules* transformations, each of which
reduces the net number of errors in the corpus by at least
... |
<vulnerable_code> >>> test_sent = brown.sents(categories='news')[0]
>>> unigram_tagger = UnigramTagger(brown.tagged_sents(categories='news')[:500])
>>> for tok, tag in unigram_tagger.tag(test_sent):
... print("({}, {}), ".format(tok, tag))
(The, AT), (Fulton, NP-TL), (County, ... |
<vulnerable_code> plt.savefig(learning_curve_output)
NN_CD_TAGGER = RegexpTagger([(r"^-?[0-9]+(.[0-9]+)?$", "CD"), (r".*", "NN")])
REGEXP_TAGGER = RegexpTagger(
[
(r"^-?[0-9]+(.[0-9]+)?$", "CD"), # cardinal numbers
(r"(The|the|A|a|An|an)$", "AT"), # articles
(r".*able$", "JJ"), # ad... |
<vulnerable_code> refentrytitle = manpage
filename = "%s/man%s/%s.%s" % (subdirectory, manvolnum, manpage, manvolnum)
if manpage != refentrytitle:
manpagetext = ".so %s.%s\n" % (refentrytitle, manvolnum)
writefile(filename, manpagetext)
... |
<vulnerable_code># Executing the interpreter in a subprocess
@support.requires_subprocess()
def run_python_until_end(*args, **env_vars):
env_required = interpreter_requires_environment()
cwd = env_vars.pop('__cwd', None)
if '__isolated' in env_vars:
isolated = env_vars.pop('__isolated')
else:
... |
<vulnerable_code> self.assertIsInstance(subprocess.Popen[bytes], types.GenericAlias)
self.assertIsInstance(subprocess.CompletedProcess[str], types.GenericAlias)
@unittest.skipIf(not sysconfig.get_config_var("HAVE_VFORK"),
"vfork() not enabled by configure.")
@mock.patch("sub... |
<vulnerable_code> sizeof(struct vc4_shader_state)) ||
temp_size < exec_size) {
DRM_ERROR("overflow in exec arguments\n");
goto fail;
}
<commit_title>[PATCH] drm/vc4: Return -EINVAL on the overflow checks failing.<commit_description>By failing to set the errno, we'd continue on to trying to set up the
RC... |
<vulnerable_code> return NULL;
}
if (pdu->securityStateRef &&
pdu->command == SNMP_MSG_TRAP2) {
netsnmp_assert(pdu->securityModel == SNMP_DEFAULT_SECMODEL);
ret = usm_clone_usmStateReference((struct usmStateReference *) pdu->securityStateRef,
(struct usmStateRefe... |
<vulnerable_code>netsnmp_feature_require(usm_support)
struct usmStateReference {
char *usr_name;
size_t usr_name_length;
u_char *usr_engine_id;
static struct usmStateReference *
usm_malloc_usmStateReference(void)
{
struct usmStateReference *retval = (struct usmStateReference ... |
<vulnerable_code> }
}
let listOfValidators = Vtiger_Base_Validator_Js.getValidator(field);
for (let i = 0; i < listOfValidators.length; i++) {
let validatorList = listOfValidators[i],
validatorName = validatorList.name,
validatorInstance = new validatorName(),
}
if (fieldData.hasOwnPrope... |
<vulnerable_code> return false;
}
const maximumLength = typeof fieldData.fieldinfo !== 'undefined' ? fieldData.fieldinfo.maximumlength : null;
if (maximumLength && strippedValue > parseFloat(maximumLength)) {
errorInfo = app.vtranslate('JS_ERROR_MAX_VALUE');
this.setError(errorInfo);
return fals... |
<vulnerable_code> reconnectionDelay: config.reconnectionDelay,
transports: config.socketioTransports,
path: config.relative_path + '/socket.io',
};
window.socket = io(config.websocketAddress, ioParams);<commit_title>[PATCH] poc: use csrf_token in ws handshake (#11573)<commit_description><fixed_code>
reconnect... |
<vulnerable_code>const {
generateToken,
csrfSynchronisedProtection,
} = csrfSync({
getTokenFromRequest: (req) => {
if (req.headers['x-csrf-token']) {
return req.headers['x-csrf-token'];
} else if (req.body.csrf_token) {
return req.body.csrf_token;
}
},
size: 64,
module.exports = {
generateToken,
csrf... |
<vulnerable_code> }
}
io.use(authorize);
io.on('connection', onConnection);
const opts = {
transports: nconf.get('socket.io:transports') || ['polling', 'websocket'],
cookie: false,
};
/*
* Restrict socket.io listener to cookie domain. If none is set, infer based on url.
};
function onConnection(socket)... |
<vulnerable_code> });
};
helpers.connectSocketIO = function (res, callback) {
const io = require('socket.io-client');
let cookies = res.headers['set-cookie'];
cookies = cookies.filter(c => /express.sid=[^;]+;/.test(c));
Origin: nconf.get('url'),
Cookie: cookie,
},
});
socket.on('connect', () => {<commit_... |
<vulnerable_code> }, (err, res) => {
assert.ifError(err);
helpers.connectSocketIO(res, (err, _io) => {
io = _io;
assert.ifError(err);
<commit_title>[PATCH] poc: use csrf_token in ws handshake (#11573)<commit_description><fixed_code>
}, (err, res) => {
assert.ifError(err);
helpers.connec... |
<vulnerable_code>*
* Copyright (C) 2018 http://alvarotrigo.com/fullPage - A project by Alvaro Trigo
*/
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).fullpage=t()}(this,(function... |
<vulnerable_code> }; //public functions
FP.version = '4.0.1';
FP.test = Object.assign(FP.test, {
top: '0px',
translate3d: 'translate3d(0px, 0px, 0px)',<commit_title>[PATCH] - Fixed bug: jquery adaptor didnt work<commit_description><fixed_code>
}; //public functions
FP.ve... |
<vulnerable_code>*
* Copyright (C) 2018 http://alvarotrigo.com/fullPage - A project by Alvaro Trigo
*/
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).fullpage=t()}(this,(function... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.