text stringlengths 79 3.72M |
|---|
<vulnerable_code> patternLength *= pen.widthF();
if (qFuzzyIsNull(patternLength)) {
pen.setStyle(Qt::NoPen);
} else if (extent / patternLength > 10000) {
// approximate stream of tiny dashes with semi-transparent solid line
pen.setStyle(Qt::SolidLine);
... |
<vulnerable_code> ZYAN_ASSERT(user_buffer);
ZYAN_ASSERT(length);
buffer->is_token_list = ZYAN_FALSE;
buffer->string.flags = ZYAN_STRING_HAS_FIXED_CAPACITY;
buffer->string.vector.allocator = ZYAN_NULL;
buffer->string.vector.element_size = sizeof(char);
buffer->st... |
<vulnerable_code> assert level in ['info', 'error', 'warning', 'success']
if 'flash' not in cherrypy.session: # @UndefinedVariable
cherrypy.session['flash'] = [] # @UndefinedVariable
flash_message = FlashMessage(message, level)
cherrypy.session['flash'].append(flash_message)
<commit_title>[PAT... |
<vulnerable_code> def populate_obj(self, userobj):
# Save password if defined
if self.password.data:
userobj.set_password(self.password.data, old_password=None)
userobj.role = self.role.data
userobj.fullname = self.fullname.data or ''
userobj.email = self.email.dat... |
<vulnerable_code>from rdiffweb.core.model import UserObject
from rdiffweb.tools.i18n import gettext_lazy as _
class UserProfileForm(CherryForm):
action = HiddenField(default='set_profile_info')
return super().is_submitted() and self.action.data == 'set_password'
def populate_obj(self, user):
... |
<vulnerable_code>
def test_change_password_with_wrong_password(self):
self._set_password("oups", "pr3j5Dwi", "pr3j5Dwi")
self.assertInBody("Wrong password")
def test_change_password_with_too_short(self):
self._set_password(self.PASSWORD, "short", "short")
self._set_password(self... |
<vulnerable_code>from cherrypy.process.plugins import SimplePlugin
from rdiffweb.core.model import UserObject
from rdiffweb.core.passwd import check_password
logger = logging.getLogger(__name__)
Only verify the user's credentials using the database store.
"""
user = UserObject.query.filter_by... |
<vulnerable_code> def is_maintainer(self):
return self.role <= self.MAINTAINER_ROLE
def set_password(self, password, old_password=None):
"""
Change the user's password. Raise a ValueError if the username or
the password are invalid.
"""
assert isinstance(password,... |
<vulnerable_code> # Check if listener called
self.listener.user_password_changed.assert_called_once_with(userobj)
def test_set_password_with_old_password(self):
# Given a user in drabase with a password
userobj = UserObject.add_user('john', 'password')
self.listener.user_pass... |
<vulnerable_code>
var columnNames = [];
$('select[name="chartXAxis"] option').each(function () {
columnNames.push($(this).text());
});
try {
currentChart = PMA_queryChart(chart_data, columnNames, currentSettings);<commit_title>[PATCH] Fixed rendering of chart of columns with HTML inside<... |
<vulnerable_code> int peeked, off = 0;
int err;
int is_udplite = IS_UDPLITE(sk);
bool slow;
if (flags & MSG_ERRQUEUE)
*/
if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
if (udp_lib_checksum_complete(skb))
goto csum_copy_err;
}
if (skb_csum_unnecessary(skb))
err = skb_copy_datagram_msg(skb, sizeo... |
<vulnerable_code>from petl.test.helpers import ieq
from petl.util import nrows, look
from petl.io.xml import fromxml
from petl.compat import urlopen
def test_fromxml():
assert nrows(actual) > 0
expect = fromxml('.pydevproject', 'pydev_property', {'name': ( '.', 'name'), 'prop': '.'})
ieq(expec... |
<vulnerable_code> darray_append(expr->keysym_list.symsNumEntries, numEntries);
darray_concat(expr->keysym_list.syms, append->keysym_list.syms);
FreeStmt((ParseCommon *) &append);
return expr;
}<commit_title>[PATCH] xkbcomp: fix pointer value for FreeStmt<commit_description>Signed-off-by: Peter Hutterer... |
<vulnerable_code> /* when trimming the very last payload, avoid trailing ws */
if (cur == lmp->u.value + lmp->len) {
tmp = found.s;
while (*(--tmp) == ' ') {
found.s--;
found.len++;
}<commit_title>[PATCH] [sipmsgops] fix codec_delete_XX() parsing<commit_description>Issue discove... |
<vulnerable_code> len -= sizeof(*io) * nid;
io = (struct id_off *)(id + 1);
cp = (char *)(io + nid);
if (!ND_TTEST2(cp, len)) {
ND_PRINT((ndo, "\""));
fn_print(ndo, (u_char *)cp, (u_char *)cp + len);
ND_PRINT((ndo, "\""));
}
n = EXTRACT_32BITS(&prep->pp_n);
ps = (const struct pgstate *)(prep + 1);
while (-... |
<vulnerable_code> method=ReadTileMethod;
quantum_info->endian=LSBEndian;
quantum_type=RGBQuantum;
tiff_pixels=(unsigned char *) AcquireMagickMemory(TIFFScanlineSize(tiff)+
sizeof(uint32));
if (tiff_pixels == (unsigned char *) NULL)
{
TIFFClose(tiff);<commit_title>[PATCH]<commit_... |
<vulnerable_code> )
except asyncio.CancelledError:
# not supposed to be possible, yet here we are
await connection.disconnect(nowait=True)
raise
finally:
await self.reset()<commit_title>[PATCH] fixing variable in cancel<commit_description><fixed... |
<vulnerable_code> if (!c->synth_tile || !c->jpeg_tile ||
c->old_tile_w < c->tile_width ||
c->old_tile_h < c->tile_height) {
c->tile_stride = FFALIGN(c->tile_width * 3, 16);
aligned_height = FFALIGN(c->tile_height, 16);
av_free(c->synth_tile);
av_free(c->jpeg_tile);<... |
<vulnerable_code> tty_kref_put(tty);
reset_open_count:
port->port.count = 0;
usb_autopm_put_interface(serial->interface);
error_get_interface:
usb_serial_put(serial);<commit_title>[PATCH] USB: serial: console: fix use-after-free after failed setup<commit_description>Make sure to reset the USB-console port pointer ... |
<vulnerable_code>
# queries must always be server side
data.query = None
return data
<commit_title>[PATCH] fix(search): Reduce restrictions on field contents<commit_description><fixed_code>
# queries must always be server side
data.query = None
data.strict = None
return data
|
<vulnerable_code> order_by=order_by,
ignore_permissions=ignore_permissions,
reference_doctype=reference_doctype,
as_list=not as_dict)
if doctype in UNTRANSLATED_DOCTYPES:
values = tuple([v for v in list(values) if re.search(txt+".*", (_(v.name) if as_dict else _(v[0])), re.IGNORECASE)])<commit_ti... |
<vulnerable_code> ignore_permissions=False, user=None, with_comment_count=False,
join='left join', distinct=False, start=None, page_length=None, limit=None,
ignore_ifnull=False, save_user_settings=False, save_user_settings_fields=False,
update=None, add_total_row=None, user_settings=None, reference_doctype=None)... |
<vulnerable_code>import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.servlet.ServletContextPool;
import com.liferay.portal.kernel.util.BasePortalLifecycle;
import com.liferay.portal.kernel.util.HttpUtil;
import com.liferay.portal.kernel.util.Po... |
<vulnerable_code>import com.liferay.portal.kernel.template.TemplateException;
import com.liferay.portal.kernel.template.TemplateManager;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.template.RestrictedTemplate;
import com.liferay.portal.template.TemplateContextHelper;
import com.liferay.p... |
<vulnerable_code>
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.utility.ObjectConstructor;
import java.util.Map;
import java.util.Set;
// Object util
helperUtilities.put("objectUtil", new ObjectConstructor());
// Portlet preferences
<commit_title>[PATCH] LPS-27741 Add security by plug... |
<vulnerable_code><commit_title>[PATCH] LPS-27741 Add security by plugin context execution to<commit_description><fixed_code>
/**
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public... |
<vulnerable_code><commit_title>[PATCH] LPS-27741 Add security by plugin context execution to<commit_description><fixed_code>
/**
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public... |
<vulnerable_code><commit_title>[PATCH] LPS-27741 Add security by plugin context execution to<commit_description><fixed_code>
/**
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public... |
<vulnerable_code>import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.language.UnicodeLanguageUtil;
import com.liferay.portal.kernel.servlet.BrowserSnifferUtil;
import com.liferay.portal.kernel.templateparser.TemplateContext;
imp... |
<vulnerable_code>
public static final int FREEMARKER_ENGINE_MODIFICATION_CHECK_INTERVAL = GetterUtil.getInteger(PropsUtil.get(PropsKeys.FREEMARKER_ENGINE_MODIFICATION_CHECK_INTERVAL));
public static final String FREEMARKER_ENGINE_TEMPLATE_EXCEPTION_HANDLER = PropsUtil.get(PropsKeys.FREEMARKER_ENGINE_TEMPLATE_EXCEPTI... |
<vulnerable_code><commit_title>[PATCH] LPS-27741 Add security by plugin context execution to<commit_description><fixed_code>
/**
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public... |
<vulnerable_code>import com.liferay.portal.kernel.template.TemplateException;
import com.liferay.portal.kernel.template.TemplateManager;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.template.RestrictedTemplate;
import com.liferay.portal.template.TemplateContextHelper;
import com.liferay.po... |
<vulnerable_code>
package com.liferay.portal.velocity;
import com.liferay.portal.kernel.templateparser.TemplateContext;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.SetUtil;
// Permissions
velocityContext.put(
"rolePermission", RolePermissionUtil.getRolePermission())... |
<vulnerable_code>
public void destroy();
public Template getTemplate(
String templateId, String templateContent, String errorTemplateId,
String errorTemplateContent, TemplateContextType templateContextType);<commit_title>[PATCH] LPS-27741 Add security by plugin context execution to<commit_description><fixed_code... |
<vulnerable_code> templateManagers.clear();
}
public static Template getTemplate(
String templateManagerName, String templateId,
String templateContent, String errorTemplateId,<commit_title>[PATCH] LPS-27741 Add security by plugin context execution to<commit_description><fixed_code>
templateManagers.clear()... |
<vulnerable_code>
public static final String FREEMARKER_ENGINE_MODIFICATION_CHECK_INTERVAL = "freemarker.engine.modification.check.interval";
public static final String FREEMARKER_ENGINE_TEMPLATE_EXCEPTION_HANDLER = "freemarker.engine.template.exception.handler";
public static final String FREEMARKER_ENGINE_TEMPLA... |
<vulnerable_code> }
/* @Bean
public FilterRegistrationBean<XssFilter> croseSiteFilter(){
FilterRegistrationBean<XssFilter> registrationBean
= new FilterRegistrationBean<>();
registrationBean.addUrlPatterns("/*");
return registrationBean;
}*/
@Override
public void... |
<vulnerable_code>import org.springframework.stereotype.Component;
//@Component
//@Order(5) //after other defined filters
public class XssFilter implements Filter {
/**
LOGGER.debug("(XssFilter) initialize");
}
/* @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain ... |
<vulnerable_code>package com.salesmanager.shop.filter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
public XssHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
... |
<vulnerable_code>import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.busines... |
<vulnerable_code>} Header;
static int getnum (const char **fmt, int df) {
if (!isdigit(**fmt)) /* no number? */
return df; /* return default value */
else {
int a = 0;
do {
a = a*10 + *((*fmt)++) - '0';
} while (isdigit(**fmt));
return a;
case 'f': return sizeof(float);
case '... |
<vulnerable_code> return 0;
}
static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb)
{
int i, j, v;
if (get_bits1(gb)) {
/* intra_quantiser_matrix */
for (i = 0; i < 64; i++) {
v = get_bits(gb, 8);
}
if (get_bits1(gb)) {
/* non_intra_quantiser_m... |
<vulnerable_code> depth;
(void) SeekBlob(image,0,SEEK_SET);
while (EOFBlob(image) != MagickFalse)
{
else
InsertComplexFloatRow(image,(float *) pixels,y,0,0,exception);
}
quantum_info=DestroyQuantumInfo(quantum_info);
rotate_image=RotateImage(image,90.0,exception);
if (rota... |
<vulnerable_code> get_continuous_fn,
)
set_documentation_group("blocks")
if TYPE_CHECKING: # Only import for type checking (is False at runtime).
self.total_runs = 0
self.inputs_as_dict = inputs_as_dict
self.name = getattr(fn, "__name__", "fn") if fn is not None else None
def __str__(... |
<vulnerable_code> return is_ipython
def readme_to_html(article: str) -> str:
try:
response = requests.get(article, timeout=3)<commit_title>[PATCH] PySpaces integration (#4389)<commit_description>* PySpaces import and auto-wrap
* Only auto-wrap on Spaces runtime
* Display a message if PySpaces auto-wr... |
<vulnerable_code> * Grab our output buffer.
*/
nl = orig_nl = get_result_buffer(param, param_size, &len);
if (len < needed) {
param->flags |= DM_BUFFER_FULL_FLAG;
goto out;
}<commit_title>[PATCH] dm ioctl: fix out of bounds array access when no devices<commit_description>If there are not any dm devices, we ne... |
<vulnerable_code> for (; pfilegen_token != NULL; pfilegen_token = pfilegen_token->link) {
filegen_string = keyword(pfilegen_token->i);
filegen = filegen_get(filegen_string);
DPRINTF(4, ("enabling filegen for %s statistics '%s%s'\n",
filegen_string, filegen->prefix,
filegen->basename));
for (; my_n... |
<vulnerable_code># define MAXPATHLEN 256
#endif
#ifdef DEBUG_TIMING
static FILEGEN timingstats;
#endif
#ifdef AUTOKEY
static FILEGEN cryptostats;
#endif /* AUTOKEY */
static char statsdir[MAXPATHLEN] = NTP_VAR;
static FILEGEN peerstats;
static FILEGEN rawstats;
static FILEGEN sysstats;
static FILEGEN protostats;
/*
... |
<vulnerable_code> while ((c = *tmp++))
len++;
len += 16;
d = dest = malloc (len);
while (*wstr++)
{
const int off = d - dest;
if (off >= len - 8)
len += 16;
dest = realloc (dest, len);
d = dest + off;
}
switch (*wstr)
{
{
... |
<vulnerable_code> return nfserr;
}
int
nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
{
rqstp->rq_vers, rqstp->rq_proc);
proc = rqstp->rq_procinfo;
/*
* Give the xdr decoder a chance to change this if it wants
* (necessary in the NFSv4.0 compound case)<commit_title>[PATCH] nfsd: check for oversized NF... |
<vulnerable_code> if (impls == null) {
impls = Collections.emptyList();
}
if (impls.size() > 1) {
throw new IllegalStateException(
SEVERAL_IMPLS + serviceType.getSimpleName() + SPI + impls
+ ONE_IMPL_REQUIRED);
}
... |
<vulnerable_code>import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@Test(expected = IllegalStateException.class)
public void ensureService_severalServicesPro... |
<vulnerable_code> public void serviceContainsStreamRequestHandler()
throws ServiceException, ServletException {
ServletConfig servletConfig = new MockServletConfig();
servletConfig.getServletContext().setAttribute(Lookup.class.getName(),
Mockito.mock(Lookup.class));
... |
<vulnerable_code>// Returns `true` if the path can be completely resolved, `false` otherwise.
//
var exists = module.exports.exists = function exists(object, path) {
if (typeof path === "string") {
path = path.split(".");
}
} else {
return exists(object[key], path);
}
};
//
// These arguments are the ... |
<vulnerable_code>var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows.describe("exists").addBatch({
"A simple path": {
"as a string": {
topic: dotty.exists({"a": "b"}, "a"),
"should return true": function(res) {
assert.isTrue(res);
},
... |
<vulnerable_code>var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows.describe("get").addBatch({
"A simple path": {
"as a string": {
topic: dotty.get({"a": "b"}, "a"),
"should return the correct value": function(res) {
assert.equal(res, "b");
... |
<vulnerable_code>var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows.describe("put").addBatch({
"A simple path": {
"as a string": {
topic: (function() { var x = {}; dotty.put(x, "a", "b"); return x; }()),
"should set the correct value": function(res) ... |
<vulnerable_code>var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows.describe("remove").addBatch({
"A simple path": {
"as a string": {
topic: (function() { var x = {a: 1}; dotty.remove(x, "a"); return x; }()),
"should remove the property": function(re... |
<vulnerable_code>var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows.describe("search").addBatch({
"A simple path": {
"as a string": {
topic: dotty.removeSearch({"a": "b"}, "a"),
"should return an object with no keys": function(res) {
assert.i... |
<vulnerable_code>var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows.describe("search").addBatch({
"A simple path": {
"as a string": {
topic: dotty.search({"a": "b"}, "a"),
"should return an array": function(res) {
assert.isArray(res);
}... |
<vulnerable_code><commit_title>[PATCH] Fix prototype pollution (#26)<commit_description><fixed_code>
var dotty = require("../lib/index"),
vows = require("vows"),
assert = require("assert");
vows
.describe("security")
.addBatch({
"When we attempt to update the prototype": {
topic() {
var obj =... |
<vulnerable_code> var d = date.match(/Date\((.*?)\)/)[1];
return "new Date(" + parseInt(d) + ")";
}
else { // ISO Date 2007-12-31T23:59:59Z
var matches = date.split(/[-,:,T,Z]/);
if (matches.length == 7) {
matches[1] = (parseInt(matches[1], 0) - 1).toString();
... |
<vulnerable_code>import com.google.crypto.tink.proto.KeyStatusType;
import com.google.crypto.tink.proto.Keyset;
import com.google.crypto.tink.proto.OutputPrefixType;
import java.nio.charset.Charset;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Arrays;
* @since 1.0.0
*/
p... |
<vulnerable_code>
import static com.google.common.truth.Truth.assertThat;
import static com.google.crypto.tink.testing.TestUtil.assertExceptionContains;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import com.google.crypto.tink.proto... |
<vulnerable_code> advance = sizeof(struct ip6_hdr);
nh = ip6->ip6_nxt;
while (cp < ndo->ndo_snapend && advance > 0) {
cp += advance;
len -= advance;
* mobility header.
*/
advance = mobility_print(ndo, cp, (const u_char *)ip6);
nh = *cp;
return;
case IPPROTO_ROUTING:
advance = rt6_print(ndo,... |
<vulnerable_code>
trunc:
ND_PRINT((ndo, "%s", tstr));
return(mhlen);
}<commit_title>[PATCH] CVE-2017-12985/IPv6: Check for print routines returning -1<commit_description><fixed_code>
trunc:
ND_PRINT((ndo, "%s", tstr));
return(-1);
} |
<vulnerable_code>
if (add==NULL) add = "(null)";
addlen=strlen(add); /* only compute once */
if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK)
return SASL_NOMEM;
<commit_title>[PATCH] Fix #587<commit_description>Off by one error in common.c, CVE-2019-19906.
Thanks to Stephan Zeisberg for reporting<f... |
<vulnerable_code> else if (strcasecmp (arg, "%u") == 0)
g_string_append_printf (new_exec, " @@u %s @@", arg);
else if (g_str_has_prefix (arg, "@@"))
g_print (_("Skipping invalid Exec argument %s\n"), arg);
else
g_string_append_prin... |
<vulnerable_code>roles.push(item)}}
container.add(KB.dom('select').attr('aria-label',getAriaLabelValue()).change(onChange).for('option',roles).build());if(isLoading){container.text(' ');container.add(KB.dom('i').attr('class','fa fa-spinner fa-pulse fa-fw').build())}else if(isSuccess){container.text(' ');container.add(K... |
<vulnerable_code>KB.component('screenshot', function (containerElement) {
var pasteCatcher = null;
var inputElement = null;
function onFileLoaded(e) {
}
function onPaste(e) {
// Firefox doesn't have the property e.clipboardData.items (only Chrome)
if (e.clipboardData && e.clipboard... |
<vulnerable_code> _zgfx->cBitsCurrent -= _nbits;
_zgfx->bits = _zgfx->BitsCurrent >> _zgfx->cBitsCurrent;
_zgfx->BitsCurrent &= ((1 << _zgfx->cBitsCurrent) - 1);
}
static void zgfx_history_buffer_ring_write(ZGFX_CONTEXT* zgfx, const BYTE* src, size_t count)
UINT32 count;
UINT32 distance;
BYTE* pbSegment;
size_t ... |
<vulnerable_code> self.assertInBody('Traceback (most recent call last):')
else:
self.assertNotInBody('Traceback (most recent call last):')<commit_title>[PATCH] Clean-up invalid path on error page<commit_description><fixed_code>
self.assertInBody('Traceback (most recent call la... |
<vulnerable_code> 'error page: %s %s\n%s' % (kwargs.get('status', ''), kwargs.get('message', ''), kwargs.get('traceback', ''))
)
# Check expected response type.
mtype = cherrypy.tools.accept.callable(['text/html', 'text/plain']) # @UndefinedVariable
if mtype == 'text/plain':... |
<vulnerable_code>
/* Walk this report and pull out the info we need */
while (i < length) {
prefix = report[i];
/* Skip over prefix */
i++;
/* Determine data size and save the data in the proper variable */
size = PREF_SIZE(prefix);
switch (size) {
case 1:
data = report[i];
case 2:
data16 = g... |
<vulnerable_code>
/*
** Does a young collection. First, mark 'OLD1' objects. (Only survival
** and "recent old" lists can contain 'OLD1' objects. New lists cannot
** contain 'OLD1' objects, at most 'OLD0' objects that were already
** visited when marked old.) Then does the atomic step. Then,
** sweep all lists and ad... |
<vulnerable_code> def __init__(self):
super(_Rsa15, self).__init__(padding.PKCS1v15())
class _RsaOaep(_RSA, JWAAlgorithm):
<commit_title>[PATCH] CVE-2016-6298: Million Messages Attack mitigation<commit_description>RFC 3218 describes an oracle attack called Million Messages Attack
against RSA with PKCS1 v1.... |
<vulnerable_code> else:
if tool_opts.username:
# Hint user for which username they need to enter pswd
loggerinst.info("Username: %s", username)
password = ""
while not password:
password = utils.prompt... |
<vulnerable_code> if (org.apache.commons.lang.StringUtils.isNotBlank(returnLabel)) {
return ui.message(returnLabel);
} else {
return ui.escapeJs(ui.format(patient));
}
}<commit_title>[PATCH] RA-1424: escapeJs vulnerable to XSS<commit_description><fixed_code>
if (org.apache.commons.lang.StringUtils.isNo... |
<vulnerable_code> * @param encounter
* @param visit
* @param returnUrl
* @param automaticValidation defaults to true. If you don't want HFE's automatic validation, set it
* to false
* @param model
* @param httpSession
* @throws Exception
*/
public void controller(FragmentConfiguration confi... |
<vulnerable_code> @FragmentParam(value = "definitionUiResource", required = false) String definitionUiResource,
HttpSession httpSession, UiUtils ui, UiSessionContext sessionContext, FragmentModel model) throws Exception {
VisitDomainWrapper visitWrapper = encounter.getVisit() == null ? null
... |
<vulnerable_code>
public class BaseEditHtmlFormPageController {
public void get(@RequestParam("encounterId") Encounter encounter, @RequestParam("patientId") Patient patient, // explicitly require this instead of inferring from encounter because this sets up the global context
@RequestParam(value = "returnUr... |
<vulnerable_code> /**
* @return an HtmlForm that is represented by the given resource in the web project
*/
protected HtmlForm getHtmlFormFromResource(String resource, ResourceFactory rf, FormService fs,
HtmlFormEntryService hfs) {
try {
// TODO figure out how flowsheets might work with: https://issu... |
<vulnerable_code> @RequestParam(value = "formName") String formName, @RequestParam(value = "editMode") Boolean editMode,
@RequestParam(value = "encounter", required = false) Encounter encounter,
@RequestParam(value = "returnUrl", required = false) String returnUrl,
@RequestParam(value... |
<vulnerable_code> SimpleObject.create("patientId", patient.getId()));
}
if (StringUtils.isEmpty(returnLabel)) {
returnLabel = ui.escapeJs(ui.format(patient.getPatient()));
}
model.addAttribute("patient", patient);<commit_title>[PATCH] RA-1424: escapeJs vulnerable to XSS<commit_description><fixed_cod... |
<vulnerable_code> FragmentModel model = new FragmentModel();
Patient patient = new Patient();
String resourcePath = "emr:htmlforms/featureTogglesTest.xml";
when(resourceFactory.getResourceAsString("emr", "htmlforms/featureTogglesTest.xml"))
.thenReturn(FEATURE_TOGGLE_TEST_FORM_DEFINITION);
// over... |
<vulnerable_code>
if(segments_left == 0) {
/* We are the final destination, do nothing */
} else {
uint8_t i = path_len - segments_left; /* The index of the next address to be visited */
uint8_t *addr_ptr = ((uint8_t *)rh_header) + RPL_RH_LEN + RPL_SRH_LEN + (i * (16 - cmpri));<commit_title>[P... |
<vulnerable_code>const HasOne = require('./associations/has-one');
const { BelongsToMany } = require('./associations/belongs-to-many');
const { HasMany } = require('./associations/has-many');
/**
* This is the main class, the entry point to sequelize.
}
if (options.replacements) {
if (Array.isArray(opt... |
<vulnerable_code>}
exports.pluralize = pluralize;
function format(arr, dialect) {
const timeZone = null;
// Make a clone of the array beacuse format modifies the passed args
}
exports.format = format;
function formatNamedParameters(sql, parameters, dialect) {
const timeZone = null;
return SqlString.formatName... |
<vulnerable_code>
it('reject when key is missing in the passed object', async function() {
await this.sequelize.query('select :one as foo, :two as bar, :three as baz', { raw: true, replacements: { one: 1, two: 2 } })
.should.be.rejectedWith(Error, /Named parameter ":\w+" has no value in the give... |
<vulnerable_code> if (query instanceof Error) {
expect(query.message).to.equal(expectation.message);
} else {
expect(query.query || query).to.equal(expectation);
}
if (assertions.bind) {
minifySql(sql) {
// replace all consecutive whitespaces with a single plain space character
ret... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const { DataTypes } = require('sequelize');
const sinon = require('sinon');
const { expectsql, sequelize } = require('../../support');
const { stubQueryRun } = require('./stub-query-run');
descr... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const { DataTypes } = require('sequelize');
const sinon = require('sinon');
const { expectsql, sequelize } = require('../../support');
const { stubQueryRun } = require('./stub-query-run');
descr... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const { DataTypes } = require('sequelize');
const sinon = require('sinon');
const { expectsql, sequelize } = require('../../support');
const { stubQueryRun } = require('./stub-query-run');
descr... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const { DataTypes } = require('sequelize');
const sinon = require('sinon');
const { expectsql, sequelize } = require('../../support');
const { stubQueryRun } = require('./stub-query-run');
descr... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const { DataTypes } = require('sequelize');
const sinon = require('sinon');
const { expectsql, sequelize } = require('../../support');
const { stubQueryRun } = require('./stub-query-run');
descr... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const sinon = require('sinon');
const { sequelize } = require('../../support');
module.exports.stubQueryRun = function stubQueryRun() {
let lastExecutedSql;
class FakeQuery {
run(sql) {... |
<vulnerable_code><commit_title>[PATCH] fix: do not replace `:replacements` inside of strings<commit_description><fixed_code>
const { injectReplacements } = require('sequelize/lib/utils/sql');
const { expect } = require('chai');
const { expectsql, sequelize } = require('../../support');
const dialect = sequelize.dialec... |
<vulnerable_code> * FOR A PARTICULAR PURPOSE.
*
* Original code by Hannes Gredler (hannes@gredler.at)
* Support for LMP service discovery extensions (defined by UNI 1.0) added
* by Manu Pathak (mapathak@cisco.com), May 2005
*/
/* \summary: Link Management Protocol (LMP) printer */
/* specification: RFC 4204 */
... |
<vulnerable_code> if 'Authorization' in headers:
# If we get redirected to a new host, we should strip out any
# authentication headers.
original_parsed = urlparse(response.request.url)
redirect_parsed = urlparse(url)
if (original_parsed.hostname != re... |
<vulnerable_code> assert r.history[0].request.headers['Authorization']
assert not r.request.headers.get('Authorization', '')
def test_auth_is_retained_for_redirect_on_host(self, httpbin):
r = requests.get(httpbin('redirect/1'), auth=('user', 'pass'))
h1 = r.history[0].request.headers... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.