text stringlengths 79 3.72M |
|---|
<vulnerable_code>}
void
mrb_proc_copy(struct RProc *a, struct RProc *b)
{
if (a->body.irep) {
/* already initialized proc */
}
a->flags = b->flags;
a->body = b->body;
if (!MRB_PROC_CFUNC_P(a) && a->body.irep) {
mrb_irep_incref(NULL, (mrb_irep*)a->body.irep);
}
a->upper = b->upper;
a->e.env = b-... |
<vulnerable_code>from _ast import *
def parse(source, filename='<unknown>', mode='exec'):
"""
Parse the source into an AST node.
Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
"""
return compile(source, filename, mode, PyCF_ONLY_AST)
def literal_eval(node_or_string):<commit_title>... |
<vulnerable_code>encoding_decl = 341
yield_expr = 342
yield_arg = 343
#--end constants--
sym_name = {}<commit_title>[PATCH] bpo-35766: Merge typed_ast back into CPython (GH-11645)<commit_description><fixed_code>
encoding_decl = 341
yield_expr = 342
yield_arg = 343
func_body_suite = 344
func_type_input = 345
func_type ... |
<vulnerable_code>
v = CustomVisitor()
v.visit(self.types['mod'])
self.assertEqual(v.names_with_seq, ['Module', 'Interactive', 'Suite'])
if __name__ == '__main__':<commit_title>[PATCH] bpo-35766: Merge typed_ast back into CPython (GH-11645)<commit_description><fixed_code>
v = CustomVis... |
<vulnerable_code>
def test_module(self):
body = [ast.Num(42)]
x = ast.Module(body)
self.assertEqual(x.body, body)
def test_nodeclasses(self):
def test_invalid_sum(self):
pos = dict(lineno=2, col_offset=3)
m = ast.Module([ast.Expr(ast.expr(**pos), **pos)])
wi... |
<vulnerable_code><commit_title>[PATCH] bpo-35766: Merge typed_ast back into CPython (GH-11645)<commit_description><fixed_code>
import ast
import unittest
funcdef = """\
def foo():
# type: () -> int
pass
def bar(): # type: () -> None
pass
"""
asyncdef = """\
async def foo():
# type: () -> int
re... |
<vulnerable_code>ELLIPSIS = 52
COLONEQUAL = 53
OP = 54
# These aren't used by the C tokenizer but are needed for tokenize.py
ERRORTOKEN = 55
COMMENT = 56
NL = 57
ENCODING = 58
N_TOKENS = 59
# Special definitions for cooperation with parser
NT_OFFSET = 256
<commit_title>[PATCH] bpo-35766: Merge typed_ast back into CPyth... |
<vulnerable_code> for (pos = 0; pos < nch; ++pos) {
node *ch = CHILD(tree, pos);
int ch_type = TYPE(ch);
for (arc = 0; arc < dfa_state->s_narcs; ++arc) {
short a_label = dfa_state->s_arc[arc].a_lbl;
assert(a_label < _PyParser_Grammar.g_ll.ll_nlabels);<commit_title>[PAT... |
<vulnerable_code> return obj2ast_object(obj, out, arena);
}
static int obj2ast_int(PyObject* obj, int* out, PyArena* arena)
{
int i;
self.emit('if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;', 1)
self.emit('if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)', 1)
... |
<vulnerable_code>#include "node.h"
#include "parser.h"
#include "errcode.h"
#ifdef Py_DEBUG
/* Push non-terminal */
int nt = (x >> 8) + NT_OFFSET;
int arrow = x & ((1<<7)-1);
dfa *d1 = PyGrammar_FindDFA(
ps->p_gram... |
<vulnerable_code>static node *parsetok(struct tok_state *, grammar *, int, perrdetail *, int *);
static int initerr(perrdetail *err_ret, PyObject * filename);
/* Parse input coming from a string. Return error code, print some errors. */
node *
PyParser_ParseString(const char *s, grammar *g, int start, perrdetail *err... |
<vulnerable_code> "ELLIPSIS",
"COLONEQUAL",
"OP",
"<ERRORTOKEN>",
"<COMMENT>",
"<NL>",<commit_title>[PATCH] bpo-35766: Merge typed_ast back into CPython (GH-11645)<commit_description><fixed_code>
"ELLIPSIS",
"COLONEQUAL",
"OP",
"TYPE_IGNORE",
"TYPE_COMMENT",
"<ERRORTOKEN>"... |
<vulnerable_code>static void tok_backup(struct tok_state *tok, int c);
/* Create and initialize a new tok_state structure */
static struct tok_state *
tok->decoding_readline = NULL;
tok->decoding_buffer = NULL;
#endif
return tok;
}
/* Set start of current token */
tok->start = tok->cur - 1;
... |
<vulnerable_code>static PyObject* ast2obj_mod(void*);
static PyTypeObject *Module_type;
_Py_IDENTIFIER(body);
static char *Module_fields[]={
"body",
};
static PyTypeObject *Interactive_type;
static char *Interactive_fields[]={
static char *Expression_fields[]={
"body",
};
static PyTypeObject *Suite_type;
static... |
<vulnerable_code> small_stmt elements is returned.
*/
static int
num_stmts(const node *n)
{
case simple_stmt:
return NCH(n) / 2; /* Divide by 2 to remove count of semi-colons */
case suite:
if (NCH(n) == 1)
return num_stmts(CHILD(n, 0));
else {
... |
<vulnerable_code> int compile_mode = -1;
int is_ast;
PyCompilerFlags cf;
int start[] = {Py_file_input, Py_eval_input, Py_single_input};
PyObject *result;
cf.cf_flags = flags | PyCF_SOURCE_IS_UTF8;
if (flags &
~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_DONT_IMPLY_DEDENT | PyCF_ONLY_AST)... |
<vulnerable_code>static arc arcs_7_4[1] = {
{26, 6},
};
static arc arcs_7_5[1] = {
{28, 7},
};
static arc arcs_7_6[1] = {
{27, 5},
};
static arc arcs_7_7[1] = {
{0, 7},
};
static state states_7[8] = {
{1, arcs_7_0},
{1, arcs_7_1},
{1, arcs_7_2},
{2, arcs_7_3},
{1, arcs_7_4},
{1, ... |
<vulnerable_code> parser_flags |= PyPARSE_IGNORE_COOKIE;
if (flags->cf_flags & CO_FUTURE_BARRY_AS_BDFL)
parser_flags |= PyPARSE_BARRY_AS_BDFL;
return parser_flags;
}
<commit_title>[PATCH] bpo-35766: Merge typed_ast back into CPython (GH-11645)<commit_description><fixed_code>
parser_flags ... |
<vulnerable_code>int
ssl_needs_ins_cast (state_slot_t * ssl, dbe_column_t * col)
{
if (DV_WIDE == col->col_sqt.sqt_dtp && (DV_ANY == ssl->ssl_dc_dtp && DV_WIDE == ssl->ssl_sqt.sqt_dtp))
return 0;
if (DV_STRING == col->col_sqt.sqt_dtp && (DV_ANY == ssl->ssl_dc_dtp && DV_STRING == ssl->ssl_sqt.sqt_dtp))<commit_ti... |
<vulnerable_code>{
#define WriteRunlengthPacket(image,pixel,length,p) \
{ \
if ((image->matte != MagickFalse) && \
(GetPixelOpacity(p) == (Quantum) TransparentOpacity)) \
{ \
q=PopHexPixel(hex_digits,0xff,q); \<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/561<commit_descripti... |
<vulnerable_code> commands = ["$exiv2 $filename"]
stdout = [""]
stderr = ["""Exiv2 exception in print action for file $filename:
corrupted image metadata
"""
]
retval = [1]<commit_title>[PATCH] Update tests/bugfixes/github/test_issue_791.py<commit_description>Co-Authored-By: kevinbackhouse <kev@semmle.co... |
<vulnerable_code> } catch (e) {
const newErr = new Error(String(e.message));
newErr.stack = String(e.stack);
newErr.comment = comment;
errors.push(newErr);
}
}<commit_title>[PATCH] fix: type error<commit_description><fixed_code>
} catch (e) {
const newErr = new Error(String(e.mess... |
<vulnerable_code> status;
register Image
*p;
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (*write_info->magick == '\0')
(void) CopyMagickString(write_info->magick,images->magick,MaxTextExtent);
p=images;
for ( ; GetNextImageInList(p) != (I... |
<vulnerable_code>
setup(
name='xblock-drag-and-drop-v2',
version='2.4.1',
description='XBlock - Drag-and-Drop v2',
packages=['drag_and_drop_v2'],
install_requires=[<commit_title>[PATCH] chore: bump version<commit_description><fixed_code>
setup(
name='xblock-drag-and-drop-v2',
version='2.4.2... |
<vulnerable_code> self.ip_range_blacklist.update(["0.0.0.0", "::"])
# The federation_ip_range_blacklist is used for backwards-compatibility
# and only applies ot federation and identity servers. If it is not given,
# default to ip_range_blacklist.
federation_ip_range_blacklist = ... |
<vulnerable_code>var version = "4.6";
var elements = document.getElementsByClassName('version');
for (var i = 0; i < elements.length; i++){
elements[i].innerHTML = version;<commit_title>[PATCH] OHRM-948:Update OrangeHRM version to 4.6.0.1<commit_description><fixed_code>
var version = "4.6.0.1";
var elements = document... |
<vulnerable_code>}
EXPORT_SYMBOL(iov_iter_copy_from_user_atomic);
static void pipe_advance(struct iov_iter *i, size_t size)
{
struct pipe_inode_info *pipe = i->pipe;
struct pipe_buffer *buf;
int idx = i->idx;
size_t off = i->iov_offset, orig_sz;
if (unlikely(i->count < size))
size = i->count;
orig_sz = size;... |
<vulnerable_code> /*
Convert stripped TIFF image.
*/
extent=2*TIFFStripSize(tiff);
#if defined(TIFF_VERSION_BIG)
extent+=image->columns*sizeof(uint64);
#else<commit_title>[PATCH] eliminate heap buffer overflow vulnerability, thanks to<commit_description><fixed_code>
/*
... |
<vulnerable_code> image->columns=(size_t) width;
image->rows=(size_t) height;
image->depth=(size_t) bits_per_sample;
status=SetImageExtent(image,image->columns,image->rows);
if (status == MagickFalse)
{
InheritException(exception,&image->exception);
return(DestroyImageList(image... |
<vulnerable_code> validators.length(max=256, message=_('Username too long.')),
],
)
fullname = StringField(_('Fullname'), validators=[validators.optional()])
email = EmailField(
_('Email'),
validators=[<commit_title>[PATCH] Limit user's fullname and Token name field length... |
<vulnerable_code>import cherrypy
from wtforms.fields import HiddenField, PasswordField, StringField, SubmitField
from wtforms.fields.html5 import EmailField
from wtforms.validators import DataRequired, EqualTo, InputRequired, Length, Regexp
from rdiffweb.controller import Controller, flash
from rdiffweb.controller.for... |
<vulnerable_code>
import cherrypy
from wtforms.fields import DateField, HiddenField, StringField, SubmitField
from wtforms.validators import DataRequired, Optional
from rdiffweb.controller import Controller, flash
from rdiffweb.controller.filter_authorization import is_maintainer
description=_(
'Us... |
<vulnerable_code> def _load_quota(self, userobj):
return self._quota.get(userobj.username, 0)
def _add_user(self, username=None, email=None, password=None, user_root=None, role=None, mfa=None):
b = {}
b['action'] = 'add'
if username is not None:
b['role'] = str(role)
... |
<vulnerable_code> user = UserObject.query.filter(UserObject.username == self.USERNAME).first()
self.assertEqual("", user.fullname)
def test_change_email(self):
self._set_profile_info("test@test.com")
self.assertStatus(200)<commit_title>[PATCH] Limit user's fullname and Token name fie... |
<vulnerable_code> # Then access token is not created
self.assertEqual(0, Token.query.filter(Token.userid == userobj.userid, Token.name == 'test-token-name').count())
def test_delete_access_token(self):
# Given an existing user with access_token
userobj = UserObject.get_user(self.USER... |
<vulnerable_code> /*
Convert stripped TIFF image.
*/
extent=4*MagickMax(image->columns*(samples_per_pixel+extra_samples)*
(image->depth+7)/8,(size_t) TIFFStripSize(tiff));
strip_pixels=(unsigned char *) AcquireQuantumMemory(extent,
sizeof(*strip_pixels));
... |
<vulnerable_code> })
}
messagesController.getConversation = function (req, res) {
const cid = req.params.convoid
if (_.isUndefined(cid)) return handleError(res, 'Invalid Conversation ID!')
}
const c = convo.toObject()
messageSchema.getConversationWithObject(
{ cid: c._i... |
<vulnerable_code>
"""
import tarfile
if working_directory is None:
working_directory = tempfile.mkdtemp()
# All files are in a subdirectory.
try:
with tarfile.open(model_file, mode="r:gz") as tar:
tar.extractall(working_directory)
logger.debug(f"Extracted mo... |
<vulnerable_code>import logging
import os
import shutil
import tarfile
from typing import Optional, Text, Tuple, TYPE_CHECKING
import rasa.shared.utils.common
@staticmethod
def _decompress(compressed_path: Text, target_path: Text) -> None:
with tarfile.open(compressed_path, "r:gz") as tar:
... |
<vulnerable_code>import os
import pickle
import tarfile
import tempfile
import warnings
import zipfile
Tries to use tar first to unpack, if that fails, zip will be used."""
try:
tar = tarfile.open(fileobj=IOReader(byte_array))
tar.extractall(directory)
tar.close()
return directo... |
<vulnerable_code> if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" layer data is empty");
continue;
}
<commit_title>[PATCH] Fixed memory leak.<commit_description><fixed_code>
if (image->debug != MagickF... |
<vulnerable_code> $(this).parents('.input-group-btn').find('.dropdown-toggle').html(selText + ' <span class="caret"></span> ');
});
function reloadLoLRegister(message) {
alert("in reload");
$.ajax({
url: '/LoLRep/add_esport/register_LoL',
type: "post",
data: {},
success: fun... |
<vulnerable_code>
char *memory;
size_t size;
char *location;
res = resource->data.result;
if (res == CURLE_OK) {
response = ogs_sbi_response_new();
ogs_assert(response);
response->h.uri = ogs_strdup(url);
ogs_assert(... |
<vulnerable_code>
int32_t stream_id;
ogs_sbi_request_t *request;
ogs_sbi_session_t *session;
} ogs_sbi_stream_t;
case NGHTTP2_DATA:
/* HEADERS or DATA frame with +END_STREAM flag */
if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
ogs_debug("[%s]... |
<vulnerable_code>
/**
* This property is no longer used by the driver and will be ignored.
* @deprecated Configure via java.util.logging
*/
@Deprecated
/**
* This property is no longer used by the driver and will be ignored.
* @deprecated Configure via java.util.logging
*/
@Deprecated
/**
... |
<vulnerable_code> alias: 'comment'
},
'table': {
pattern: /^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,
inside: {
'specifiers': {
pattern: /(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,<commit_title>[PATCH] Fixed more exp backtracking again.<commit_de... |
<vulnerable_code>!function(t){var n={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},... |
<vulnerable_code> alias: 'number'
},
'string': {
pattern: /(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/,
inside: {
'comment': {
pattern: /(&(?:\r\n?|\n)\s*)!.*/,<commit_title>[PATCH] Fixed more exp backtracking again.<commit_description><fixed_code>
alias: 'number'
},
... |
<vulnerable_code>Prism.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:{pattern:/!.*/,greedy:!0},boolean:/\.(?:T... |
<vulnerable_code> lookbehind: true
},
'feature': {
pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţi... |
<vulnerable_code>!function(a){var n="(?:\r?\n|\r)[ \t]*\\|.+\\|.*";Prism.languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},tag:{pattern:/(^[ \t]*)@\S*/m,lookbehind:!0},feature:{pattern:/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Be... |
<vulnerable_code> },
'tag': {
// Allows for one nested group of braces
pattern: /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/,
lookbehind: true,
inside: {
'attributes': [
{
// Lookbehind tries to prevent interpolations from breaking it... |
<vulnerable_code>!function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ]+.+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ]+.+)/,lookbehin... |
<vulnerable_code> /"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/,
],
'string': {
pattern: /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,
greedy: true,
inside: {
'interpolation': {<commit_title>[PATCH] Fixed more exp backtracking again.<commit_description><fixed_code>
/"(?:... |
<vulnerable_code>Prism.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+)[\s\S]*?^\s*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:resource|data)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehi... |
<vulnerable_code> greedy: true
},
'literal': {
pattern: /(^|[[{(=:,\s])(?:[^#"\',:=[\]{}()\s`-]|[:-][^"\',=[\]{}()\s])(?:[^,:=\]})(\s]+|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,
lookbehind: true,
alias: 'string',
},<commit_title>[PATCH] Fixed more exp backtracking again.<commit_description><fixed_code>
gree... |
<vulnerable_code>Prism.languages.neon={comment:{pattern:/#.*/,greedy:!0},datetime:{pattern:/(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,lookbehind:!0,alias:"number"},key:{pattern:/(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,loo... |
<vulnerable_code> inside: {
'interpolation': {
// The lookbehind ensures the ${} is not preceded by \ or ''
pattern: /(^|(?:^|(?!'').)[^\\])\$\{(?:[^}]|\{[^}]*\})*}/,
lookbehind: true,
inside: {
'antiquotation': {
'punctuation': /[{}()[\].,:;]/
};
Prism.languages.nix.string.inside.interpolati... |
<vulnerable_code>Prism.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^}]|\{[^}]*\})*}/,lookbehind:!0,inside:{antiquotation:{pattern:/^\$(?=\{)/,alias:"variable"}}}}},url... |
<vulnerable_code> 'heredoc': [
// Matches the content of a quoted heredoc string (subject to interpolation)
{
pattern: /(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r))*?[ \t]*\|?[ \t]*-?[ \t]*\2/,
lookbehind: true,
alias: 'string',
inside: {
},
// Matches the conte... |
<vulnerable_code>!function(e){e.languages.puppet={heredoc:[{pattern:/(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r))*?[ \t]*\|?[ \t]*-?[ \t]*\2/,lookbehind:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/(@\(([^"\r\n\/):]+)(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\... |
<vulnerable_code> // If a / is not matched by a \, the multiline comment is unterminated and continues to end of file.
// The / and \ must be the first char on the line, but may be followed by any amount of whitespace.
{
pattern: /(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?(?:\\(?=[\t ]*(?:\r?\n|\r)... |
<vulnerable_code>Prism.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0,greedy:!0},{pattern:/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,greedy:!0},{pattern:/^#... |
<vulnerable_code> // what's left should be selectors
Prism.languages.insertBefore('sass', 'punctuation', {
'selector': {
pattern: /([ \t]*)\S(?:,?[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,?[^,\r\n]+)*)*/,
lookbehind: true
}
});
}(Prism));<commit_title>[PATCH] Fixed more exp backtracking again.<commit_descri... |
<vulnerable_code>!function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var t=/... |
<vulnerable_code> }
},
'property': {
pattern: /(?:[\w-]|\$[-\w]+|#\{\$[-\w]+\})+(?=\s*:)/,
inside: {
'variable': /\$[-\w]+|#\{\$[-\w]+\}/
}<commit_title>[PATCH] Fixed more exp backtracking again.<commit_description><fixed_code>
}
},
'property': {
pattern: /(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,
... |
<vulnerable_code>Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()]|#\{\$[-\w]+\})+(?=\s... |
<vulnerable_code> // It can span multiple lines.
// It must end with a comma or an accolade or have indented content.
'selector': {
pattern: /(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)))*... |
<vulnerable_code>!function(e){var n={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},r={pattern:/(^|[^\w.-])-?\d*\.?\d+/,lookbehind:!0},i={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/url\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,gr... |
<vulnerable_code>// issues: nested multiline comments
Prism.languages.swift = Prism.languages.extend('clike', {
'string': {
pattern: /("|')(?:\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true,
inside: {
'interpolation': {<commit_title>[PATCH] Fixed more exp backtracking again.<comm... |
<vulnerable_code>Prism.languages.swift=Prism.languages.extend("clike",{string:{pattern:/("|')(?:\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(?:as|associativit... |
<vulnerable_code>
private boolean inline;
private BlockAsyncRendererDecorator decorator;
private Set<EntityReference> references;
this.inline = inline;
}
/**
* @return the decorator
*/<commit_title>[PATCH] XWIKI-20234: It's possible to execute anything with<commit_description><f... |
<vulnerable_code> private Block tranform(XDOM xdom, Block block) throws RenderingException
{
TransformationContext transformationContext =
new TransformationContext(xdom, this.configuration.getDefaultSyntax(), false);
transformationContext.setTargetSyntax(this.configuration.getTargetS... |
<vulnerable_code> // Set the transformation id
configuration.setTransformationId(context.getTransformationContext().getId());
return configuration;
}
}<commit_title>[PATCH] XWIKI-20234: It's possible to execute anything with<commit_description><fixed_code>
// Set the transformation i... |
<vulnerable_code><commit_title>[PATCH] XWIKI-20234: It's possible to execute anything with<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 the ... |
<vulnerable_code> * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.rendering.macro.box;
import java.util.List;
import org.xwiki.model.reference.EntityReference;
import org.xwiki.observation.ObservationManager;
import... |
<vulnerable_code>
@Test
void executeOk() throws Exception
{
MacroBlock macroBlock = new MacroBlock("context", Collections.<String, String>emptyMap(), false);
MetaData metadata = new MetaData();
macroContext.setSyntax(Syntax.XWIKI_2_0);
macroContext.setCurrentMacroBlock(macroB... |
<vulnerable_code> }
if (json_data.done) {
mw.restore.get_progress(100);
mw.restore.get_log_check('stop');
//mw.spinner({element: ".button-start", size: 30, color: 'white'}).hide()
});
},
get_log_check: function(action = 'start') {
var importLogInterval = setInterval(function() {<commit_title>[... |
<vulnerable_code> }
});
}
mw.temp_reload_module_queue_holder = [];
<commit_title>[PATCH] update<commit_description><fixed_code>
}
});
}
mw.temp_reload_module_queue_holder = [];
|
<vulnerable_code> // temporarily disable them all
enabledExtensions = [];
for (let uuid in ExtensionUtils.extensions)
reloadExtension(ExtensionUtils.extensions[uuid]);
enabledExtensions = getEnabledExtensions();
if (Main.sessionMode.allowExtensions) {
enabledExtensions.forEach(functi... |
<vulnerable_code> if (options->pubkey_authentication == -1)
options->pubkey_authentication = 1;
if(options->pubkey_disable_pk_check == -1)
options->pubkey_disable_pk_check = 1;
if (options->pubkey_auth_options == -1)
options->pubkey_auth_options = 0;
if (options->kerberos_authentication == -1)<commit_title>[PA... |
<vulnerable_code><commit_title>[PATCH] Refactor: refactor aria alerts adding a component to manage<commit_description><fixed_code>
import { Meteor } from 'meteor/meteor';
const ScreenReaderAlertCollection = new Mongo.Collection('Screenreader-alert', { connection: null });
export default ScreenReaderAlertCollection; |
<vulnerable_code><commit_title>[PATCH] Refactor: refactor aria alerts adding a component to manage<commit_description><fixed_code>
import _ from 'lodash';
import ScreenReaderAlertCollection from './collection';
export const addNewAlert = (text) => {
const payload = {
id: _.uniqueId('alert-'),
insertedTime: D... |
<vulnerable_code> title.text = data.join(' - ');
};
export const alertScreenReader = (s = '') => {
const app = document.getElementById('app');
const ariaAlert = document.createElement("div");
ariaAlert.setAttribute("id", "aria-alert");
ariaAlert.setAttribute("role", "alert");
ariaAlert.setAtt... |
<vulnerable_code> return ret;
}
static void probe_cb(char *metadata)
{
struct coap_packet reply;
char tmp[MAX_PAYLOAD_SIZE];
int rcvd = -1;
wait_fds();
rcvd = recv(ctx.sock, metadata, MAX_PAYLOAD_SIZE, MSG_DONTWAIT);
if (rcvd <= 0) {
LOG_ERR("Could not receive data");
ctx.code_status = UPDATEHUB_NETWORKING... |
<vulnerable_code> if (c == '?' || c == '/') {
char c0 = (char)c;
c = fCurrentEntity.read();
if (c == '>') {
break;
}
fStringBuffer.append(c0);<commit_tit... |
<vulnerable_code> (void) RelinquishUniqueFileResource(blob_info->filename);
blob_info=DestroyImageInfo(blob_info);
if ((picon == (Image *) NULL) || (affinity_image == (Image *) NULL))
return(MagickFalse);
quantize_info=AcquireQuantizeInfo(image_info);
status=RemapImage(quantize_info,picon,affinity_image,ex... |
<vulnerable_code> goto out;
}
}
mlx4_dbg(dev, "Free MAC index is %d\n", free);
if (table->total == table->max) {
}
}
if (table->total == table->max) {
/* No free vlan entries */
err = -ENOSPC;<commit_title>[PATCH] mlx4_en: Fix out of bounds array access<commit_description>When searching for a free entr... |
<vulnerable_code> 'save_url': post_url,
'save_args': transforms.dumps(post_args),
'exit_button_caption': exit_button_caption,
'exit_url': jinja2.Markup(exit_url), # suppress & -> & in url
'required_modules': COMMON_REQUIRED_MODULES + required_modules,
... |
<vulnerable_code> 'tab': 'data_pump'})})
response = self.get(url)
self.assertIn(
'cb_global.exit_url = \'dashboard?action=analytics&tab=data_pump\'',
response.body)<commit_title>[PATCH] Fix XSS vulnerability in which unescaped template values were<commit_descriptio... |
<vulnerable_code> raise tornado.gen.Return('retry')
else:
raise SaltClientError('Attempt to authenticate with the salt master failed with timeout error')
if 'load' in payload:
if 'ret' in payload['load']:
if not payload['load']['ret']:<commi... |
<vulnerable_code> 'payload and load must be a dict', header=header))
raise tornado.gen.Return()
# intercept the "_auth" commands, since the main daemon shouldn't know
# anything about our key auth
if payload['enc'] == 'clear' and payload.get('load'... |
<vulnerable_code> stream.send(self.serial.dumps('payload and load must be a dict'))
raise tornado.gen.Return()
# intercept the "_auth" commands, since the main daemon shouldn't know
# anything about our key auth
if payload['enc'] == 'clear' and payload.get('load', {}).get... |
<vulnerable_code>__version__ = "0.56"
__version_info__ = tuple(__version__.split("."))<commit_title>[PATCH] Release 0.56.1<commit_description>Refs #1360<fixed_code>
__version__ = "0.56.1"
__version_info__ = tuple(__version__.split(".")) |
<vulnerable_code> tr.id = "tr_" + this.__uuidv4();
for (var col of row) {
var td = document.createElement('td');
td.innerHTML = col;
tr.appendChild(td);
}
this.__add_action_button(tr);<commit_title>[PATCH] fix: [security] XSS through network history nam... |
<vulnerable_code> * NOTE(ww): Ideally we'd use a capture with the C++ lambda here, but C++ lambdas can't be
* used within C callbacks unless they're captureless.
*/
impl::SectionList sections;
peparse::IterSec(
pe,
[](void *cbd,
[[maybe_unused]] const std::string §ionName,
... |
<vulnerable_code> {
png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
size_t row_factor =
(png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1)
+ 1 + (png_ptr->interlaced? 6: 0));
if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
idat_limit=PNG_UINT_31_MAX;
... |
<vulnerable_code> * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
* For conditions of distribution and use, see the accompany... |
<vulnerable_code> AutoTimerRemoveAutoTimerResource, AutoTimerSettingsResource, \
AutoTimerSimulateResource
except ImportError:
print "AT plugin not found"
return
self.putChild('parse', AutoTimerDoParseResource())
self.putChild('remove', AutoTimerRemoveAutoTimerResource())
from Plugins.Extensions.Aut... |
<vulnerable_code> try:
week = int(request.args["week"][0])
wadd = week * 7
except Exception, e:
pass
if "day" in request.args.keys():
try:
if day > 0 or wadd > 0:
now = localtime()
begintime = mktime( (now.tm_year, now.tm_mon, now.tm_mday+day + wadd, 0, 0, 0, -1, -1, -1) )
except ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.