text stringlengths 79 3.72M |
|---|
<vulnerable_code> if (p && p->value.lfrac.den) {
tkw->pid_dur = p->value.lfrac;
if (tkw->pid_dur.num<0) tkw->pid_dur.num = -tkw->pid_dur.num;
if (max_dur.num * (s64) tkw->pid_dur.den < (s64) max_dur.den * tkw->pid_dur.num) {
max_dur.num = tkw->pid_dur.num;
max_dur.den = tkw->pid_dur.den;
}<commit_t... |
<vulnerable_code>
if (IS_ERR(device)) {
if (PTR_ERR(device) == -ENOENT &&
strcmp(device_path, "missing") == 0)
ret = BTRFS_ERROR_DEV_MISSING_NOT_FOUND;
else
ret = PTR_ERR(device);<commit_title>[PATCH] btrfs: fix NULL pointer dereference when deleting device by<commit_description><fixed_code>
if (IS_E... |
<vulnerable_code>
import re
WS = "[ \t]"
OWS = WS + "{0,}?"
RWS = WS + "{1,}?"
# ; visible (printing) characters
VCHAR = r"\x21-\x7e"
# header-field = field-name ":" OWS field-value OWS
# field-name = token
# field-value = *( field-content / obs-fold )
# Which allows the field value here to ... |
<vulnerable_code>import stat
import time
from .rfc7230 import OBS_TEXT, VCHAR
logger = logging.getLogger("waitress")
queue_logger = logging.getLogger("waitress.queue")
return retval
# RFC 5234 Appendix B.1 "Core Rules":
# VCHAR = %x21-7E
# ; visible (printing) characters
vchar_re = VCH... |
<vulnerable_code>
from waitress.buffers import OverflowableBuffer
from waitress.receiver import ChunkedReceiver, FixedStreamReceiver
from waitress.utilities import (
BadRequest,
RequestEntityTooLarge,
find_double_newline,
)
from .rfc7230 import HEADER_FIELD
def unquote_bytes_to_wsgi(bytestring):
retu... |
<vulnerable_code> else: # pragma: nocover
self.assertTrue(False)
def test_parse_header_multiple_content_length(self):
data = b"GET /foobar HTTP/8.4\r\ncontent-length: 10\r\ncontent-length: 20\r\n"
<commit_title>[PATCH 1/7] Add new regular expressions for Chunked Encoding<commit_descript... |
<vulnerable_code> self.assertFalse("transfer-encoding" in headers)
def test_chunking_request_with_content(self):
control_line = b"20;\r\n" # 20 hex = 32 dec
s = b"This string has 32 characters.\r\n"
expected = s * 12
header = b"GET / HTTP/1.1\r\nTransfer-Encoding: chunke... |
<vulnerable_code> b"Transfer-Encoding: chunked\r\n"
b"X-Foo: 1\r\n"
b"\r\n"
b"1d;\r\n"
b"This string has 29 characters\r\n"
b"0\r\n\r\n"
)<commit_title>[PATCH 1/7] Add new regular expressions for Chunked Encoding<commit_description>This also... |
<vulnerable_code>"""Data Chunk Receiver
"""
from waitress.utilities import BadRequest, find_double_newline
s = b""
else:
self.chunk_end = b""
if pos == 0:
# Chop off the terminating CR LF from the chunk
... |
<vulnerable_code> self.send_check_error(to_send)
self.assertRaises(ConnectionClosed, read_http, fp)
def test_broken_chunked_encoding_missing_chunk_end(self):
control_line = b"20\r\n" # 20 hex = 32 dec
s = b"This string has 32 characters.\r\n"<commit_title>[PATCH 1/7] Add new... |
<vulnerable_code>import unittest
class TestFixedStreamReceiver(unittest.TestCase):
def _makeOne(self, cl, buf):
self.assertEqual(inst.error, None)
class DummyBuffer:
def __init__(self, data=None):
if data is None:<commit_title>[PATCH 1/7] Add new regular expressions for Chunked Encoding<comm... |
<vulnerable_code> self.all_chunks_received = True
break
line = line[:semi]
try:
sz = int(line.strip(), 16) # hexadecimal
except ValueError: # garbage ... |
<vulnerable_code> assert result == len(data)
assert inst.error == None
class DummyBuffer:
def __init__(self, data=None):<commit_title>[PATCH 1/7] Add new regular expressions for Chunked Encoding<commit_description>This also moves some regular expressions for QUOTED_PAIR/QUOTED_STRING
into this modu... |
<vulnerable_code> line = s[:pos]
s = s[pos + 2 :]
self.control_line = b""
line = line.strip()
if line:
# Begin a new chunk.
line = line[:semi]
... |
<vulnerable_code> assert result == len(data)
assert inst.error == None
@pytest.mark.parametrize("invalid_size", [b"0x04", b"+0x04", b"x04", b"+04"])
def test_received_invalid_size(self, invalid_size):
from waitress.utilities import BadRequest
<commit_title>[PATCH 1/7] Add new regular exp... |
<vulnerable_code><commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
'use strict';
/**
* Module dependencies.
*/
var AbstractGrantType = require('./abstract-grant-type');
var InvalidArgumentError = require('../errors/invalid-argument-error');
var Promise = require('bluebird');
var uti... |
<vulnerable_code>var ServerError = require('../errors/server-error');
var UnauthorizedClientError = require('../errors/unauthorized-client-error');
var is = require('../validator/is');
var tokenUtil = require('../utils/token-util');
var url = require('url');
/**
throw new InvalidArgumentError('Invalid argument: au... |
<vulnerable_code> */
var InvalidArgumentError = require('../errors/invalid-argument-error');
var url = require('url');
/**
* Constructor.
*/
function CodeResponseType(code) {
if (!code) {
throw new InvalidArgumentError('Missing parameter: `code`');
}
this.code = code;
}
/**
* Build redirect uri.
*/
... |
<vulnerable_code> * Module dependencies.
*/
var ServerError = require('../errors/server-error');
/**
* Constructor.
*/
function TokenResponseType() {
throw new ServerError('Not implemented.');
}
/**
* Export constructor.
*/<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
* ... |
<vulnerable_code>OAuth2Server.prototype.authorize = function(request, response, options, callback) {
options = _.assign({
allowEmptyState: false,
authorizationCodeLifetime: 5 * 60 // 5 minutes.
}, this.options, options);
<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
OA... |
<vulnerable_code>
describe('AuthorizeHandler integration', function() {
describe('constructor()', function() {
it('should throw an error if `options.authorizationCodeLifetime` is missing', function() {
try {
new AuthorizeHandler();
should.fail();
} catch (e) {
e.should.be.an.i... |
<vulnerable_code>
var CodeResponseType = require('../../../lib/response-types/code-response-type');
var InvalidArgumentError = require('../../../lib/errors/invalid-argument-error');
var should = require('should');
var url = require('url');
/**
describe('CodeResponseType integration', function() {
describe('construc... |
<vulnerable_code> return server.authorize(request, response)
.then(function() {
this.allowEmptyState.should.be.false;
this.authorizationCodeLifetime.should.equal(300);
})
.catch(should.fail);
});<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><f... |
<vulnerable_code> .catch(should.fail);
});
});
describe('saveAuthorizationCode()', function() {
it('should call `model.saveAuthorizationCode()`', function() {
var model = {
getAccessToken: function() {},
getClient: function() {},
saveAuthorizationCode: sinon.stub().retu... |
<vulnerable_code> if (!redirectUri) {
throw new InvalidArgumentError('Missing parameter: `redirectUri`');
}
redirectUri.search = null;
return this.setRedirectUriParam(redirectUri, 'code', this.code);
};
<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
if (!redirectUri) {
... |
<vulnerable_code> throw new InvalidArgumentError('Missing parameter: `accessTokenLifetime`');
}
this.options = options;
this.accessToken = null;
this.accessTokenLifetime = options.accessTokenLifetime;
}
/**
var options = {
user: user,
scope: scope,
model: this.options.model,
accessTokenLi... |
<vulnerable_code> throw new UnsupportedResponseTypeError('Unsupported response type: `response_type` is not supported');
}
if (!_.contains(['code', 'token'], responseType)) {
throw new InvalidRequestError('Invalid parameter: `response_type`');
}
if (!_.contains(client.grants, 'implicit') && responseTyp... |
<vulnerable_code>
var responseTypes = {
code: require('../response-types/code-response-type'),
//token: require('../response-types/token-response-type')
};
/**
.spread(function(client, user) {
var scope;
var state;
var responseType = this.getResponseType(request, client);
var uri = this... |
<vulnerable_code> }
});
it('should throw an error if `response_type` is not `code`', function() {
var model = {
getAccessToken: function() {},
getClient: function() {},<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
}
});
it('should t... |
<vulnerable_code>ImplicitGrantType.prototype.saveToken = function(user, client, scope) {
var fns = [
this.validateScope(user, client, scope),
this.generateAccessToken(),
this.getAccessTokenExpiresAt()
];
<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
ImplicitGrantType... |
<vulnerable_code> .spread(function(client, user) {
var scope;
var state;
var ResponseType;
var responseType;
var uri = this.getRedirectUri(request, client);
scope = validScope;
state = this.getState(request);
ResponseType = this.getResponseType(request, ... |
<vulnerable_code><commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
'use strict';
/**
* Module dependencies.
*/
var ImplicitGrantType = require('../../../lib/grant-types/implicit-grant-type');
var Promise = require('bluebird');
var sinon = require('sinon');
var should = require('shou... |
<vulnerable_code>var AbstractGrantType = require('./abstract-grant-type');
var InvalidArgumentError = require('../errors/invalid-argument-error');
var Promise = require('bluebird');
var util = require('util');
/**
scope: scope
};
return this.model.saveToken(token, client, user);
});
};
<commit... |
<vulnerable_code><commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
'use strict';
/**
* Module dependencies.
*/
var ImplicitGrantType = require('../../../lib/grant-types/implicit-grant-type');
var InvalidArgumentError = require('../../../lib/errors/invalid-argument-error');
var Promi... |
<vulnerable_code> * Test `ImplicitGrantType` integration.
*/
describe.only('ImplicitGrantType integration', function() {
describe('constructor()', function() {
it('should throw an error if `model` is missing', function() {
try {<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_c... |
<vulnerable_code><commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
'use strict';
/**
* Module dependencies.
*/
var TokenResponseType = require('../../../lib/response-types/token-response-type');
var InvalidArgumentError = require('../../../lib/errors/invalid-argument-error');
var sh... |
<vulnerable_code> });
});
describe('generateAuthorizationCode()', function() {
it('should call `model.generateAuthorizationCode()`', function() {
var model = {
generateAuthorizationCode: sinon.stub().returns({}),
getAccessToken: function() {},
getClient: function() {},
... |
<vulnerable_code>
AuthorizeHandler.prototype.generateAuthorizationCode = function(client, user, scope) {
if (this.model.generateAuthorizationCode) {
return promisify(this.model.generateAuthorizationCode).call(this.model, client, user, scope);
}
return tokenUtil.generateRandomToken();
};<commit_title>[PATCH 02... |
<vulnerable_code>
function ServerError(message, properties) {
properties = _.assign({
code: 503,
name: 'server_error'
}, properties);
<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_code>
function ServerError(message, properties) {
properties = _.assign({
code: 500,
n... |
<vulnerable_code> .then(should.fail)
.catch(function() {
response.body.should.eql({ error: 'server_error', error_description: 'Unhandled exception' });
response.status.should.equal(503);
});
});
<commit_title>[PATCH 02/20] resolve merge conflict<commit_description><fixed_c... |
<vulnerable_code> else:
ansible_role = None
data = {}
data['uuid'] = result._task._uuid
data['session'] = self.session<commit_title>[PATCH] Callback: removing args from task_fields from Sumologic and<commit_description><fixed_code>
else:
ansible_role = Non... |
<vulnerable_code>
# Check bidi
RandAL = [stringprep.in_table_d1(x) for x in label]
for c in RandAL:
if c:
# There is a RandAL char in the string. Must perform further
# tests:
# 1) The characters in section 5.8 MUST be prohibited.
# This is table C.8, ... |
<vulnerable_code> self.assertEqual("pyth\xf6n.org".encode("idna"), b"xn--pythn-mua.org")
self.assertEqual("pyth\xf6n.org.".encode("idna"), b"xn--pythn-mua.org.")
def test_stream(self):
r = codecs.getreader("idna")(io.BytesIO(b"abc"))
r.read(3)<commit_title>[PATCH] gh-98433: Fix quadr... |
<vulnerable_code> {
count=ReadBlob(image,length,pixels);
if (count != length)
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
p=pixels;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (PixelPacket *) NULL)<commit_title>[PATCH] Fixed memory... |
<vulnerable_code>
Expression*
flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
struct Copier : public Visitor<Copier, Expression*> {
Module& wasm;
CustomCopier custom;
if (ret) {
return ret;
}
return Visitor<Copier, Expression*>::visit(curr);
}
Expres... |
<vulnerable_code> /* This is the buffer to store this entry in the hash table. */
pj_hash_entry_buf ht_entry;
/* List of dialog in this dialog set. */
struct dlg_set_head dlg_list;
};
* Create the dialog set and add this dialog to it.
*/
dlg_set = alloc_dlgset_node();
pj_list_init... |
<vulnerable_code> if old_invite_only_value and not stream.invite_only:
# We need to send stream creation event to users who can access the
# stream now but were not able to do so previously. So, we can exclude
# subscribers, users who were previously subscribed to the stream and
# rea... |
<vulnerable_code>from zerver.lib.sounds import get_available_notification_sounds
from zerver.lib.stream_subscription import handle_stream_notifications_compatibility
from zerver.lib.streams import do_get_streams, get_web_public_streams
from zerver.lib.subscription_info import gather_subscriptions_helper, get_web_public... |
<vulnerable_code>)
from zerver.lib.stream_traffic import get_average_weekly_stream_traffic, get_streams_traffic
from zerver.lib.streams import get_web_public_streams_queryset, subscribed_to_stream
from zerver.lib.timestamp import datetime_to_timestamp
from zerver.lib.types import (
NeverSubscribedStreamDict,
Ra... |
<vulnerable_code> sub_data = gather_subscriptions_helper(non_admin_user)
self.verify_sub_fields(sub_data)
unsubscribed_streams = sub_data.unsubscribed
self.assert_length(unsubscribed_streams, 1)
self.assertEqual(unsubscribed_streams[0]["subscribers"], [])
sub_data = gathe... |
<vulnerable_code> RsaKeyUtil rsaKeyUtil = new RsaKeyUtil();
PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey);
return (Claims) Jwts.parser().setSigningKey(publicKey).parse(token.replace("Bearer ", "")).getBody();
} catch (Exception e){
throw new A... |
<vulnerable_code> // offset = deposit function hash + address + address + uint256
uint16_t offset = 4 + (5 * 32);
int16_t len = msg->data_length - offset;
if (msg->has_data_length && len > 0) {
memcpy(buffer, msg->data_initial_chunk.bytes + offset, len);
// String length must be < 255 characters
retu... |
<vulnerable_code> confirm(ButtonRequestType_ButtonRequest_ConfirmOutput, arStr,
"Minimum %s", constr1);
snprintf(constr1, 32, "%lld", deadline);
confirm(ButtonRequestType_ButtonRequest_ConfirmOutput, arStr,
"Deadline %s", ctime((const time_t *)&deadline));
<commit_title... |
<vulnerable_code>#include "ecma-objects-general.h"
#include "ecma-objects.h"
#include "jrt-libc-includes.h"
#include "jrt.h"
#include "lit-char-helpers.h"
JERRY_ASSERT (holder_p);
JERRY_ASSERT (name_p);
/* 1. */
ecma_value_t value = ecma_op_object_get (holder_p, name_p);
<commit_title>[PATCH] Prevent stack-ov... |
<vulnerable_code><commit_title>[PATCH] Prevent stack-overflow in json internalize property<commit_description>This patch fixes #4848.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu<fixed_code>
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Ap... |
<vulnerable_code> {
char_u *tmp_ptr = ptr;
if (compl_status_adding())
{
tmp_ptr += compl_length;
// Skip if already inside a word.<commit_title>[PATCH] patch 9.0.0102: reading past end of line with insert mode<commit_description><fixed_code>
{
char_u *tmp_ptr = ptr;
if (compl_status_adding() && ... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
101,
/**/<commit_title>[PATCH] patch 9.0.0102: reading past end of line with insert mode<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
102,... |
<vulnerable_code> self._check_function(self.path.normcase)
if sys.platform == 'win32':
self.assertEqual(ntpath.normcase('\u03a9\u2126'), 'ωΩ')
def test_path_isabs(self):
self._check_function(self.path.isabs)<commit_title>[PATCH] gh-106844: Fix issues in _winapi.LCMapStringEx (GH-... |
<vulnerable_code> packet_size=4;
count=ReadBlob(image,packet_size*image->colors,dib_colormap);
if (count != (ssize_t) (packet_size*image->colors))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
p=dib_colormap;
for (i=0; i < (ssize_t) image->colors; i++)
... |
<vulnerable_code>from airflow.www.extensions.init_jinja_globals import init_jinja_globals
from airflow.www.extensions.init_manifest_files import configure_manifest_files
from airflow.www.extensions.init_robots import init_robots
from airflow.www.extensions.init_security import init_api_experimental_auth, init_xframe_pr... |
<vulnerable_code>import logging
from importlib import import_module
from airflow.configuration import conf
from airflow.exceptions import AirflowConfigException, AirflowException
except ImportError as err:
log.critical("Cannot import %s for API authentication due to: %s", backend, err)
... |
<vulnerable_code> new_session_cookie = get_session_cookie(user_client)
assert new_session_cookie is not None
assert old_session_cookie.value != new_session_cookie.value<commit_title>[PATCH] Check user is active<commit_description><fixed_code>
new_session_cookie = get_session_cookie(user_client)
asser... |
<vulnerable_code> if (image->compression == JPEGCompression)
method=GetJPEGMethod(image,tiff,photometric,bits_per_sample,
samples_per_pixel);
if (photometric == PHOTOMETRIC_LOGLUV)
method=ReadGenericMethod;
quantum_info->endian=LSBEndian;
quantum_type=RGBQuantum;
Convert str... |
<vulnerable_code>)
assert len(diff_policies) == 0, f"Missing privileges for root user are {diff_policies}"
assert "MANAGE_POLICIES" not in all_user_platform_policy_privileges
assert "MANAGE_USERS_AND_GROUPS" not in all_user_platform_policy_privileges
assert "MANAGE_SECRETS" not in all_user_platform_policy_privileges
a... |
<vulnerable_code> subprocess.call(command)
print("[prerun] Made user {0} a sysadmin".format(name))
if __name__ == "__main__":
<commit_title>[PATCH] 2.10 and 2.9 changes<commit_description><fixed_code>
subprocess.call(command)
print("[prerun] Made user {0} a sysadmin".format(name))
... |
<vulnerable_code>int unshare_userns(unsigned long unshare_flags, struct cred **new_cred)
{
struct cred *cred;
if (!(unshare_flags & CLONE_NEWUSER))
return 0;
cred = prepare_creds();
if (!cred)
return -ENOMEM;
*new_cred = cred;
return create_user_ns(cred);
}
void free_user_ns(struct user_namespace *ns)<com... |
<vulnerable_code>}
static void cliRefreshPrompt(void) {
int len;
if (config.eval_ldb) return;
if (config.hostsocket != NULL)
len = snprintf(config.prompt,sizeof(config.prompt),"redis %s",
config.hostsocket);
else
len = anetFormatAddr(config.prompt, sizeof(config.... |
<vulnerable_code> ZFP_ERROR_NULL(input);
ZFP_ERROR_NULL(output);
ZFP_ERROR_NULL(cparams);
double tol = (int8_t) meta;
int8_t ndim;
ZFP_ERROR_NULL(input);
ZFP_ERROR_NULL(output);
ZFP_ERROR_NULL(dparams);
BLOSC_UNUSED_PARAM(chunk);
blosc2_schunk *sc = dparams->schunk;
ZFP_ERROR_NULL(input);
ZFP_E... |
<vulnerable_code> * @param {Array<String>} permissions permissions that the user must have
*/
const checkPermissions = (ctx, permissions) =>
ctx.user && ctx.user.can(...permissions);
/**
* wrapCheckPermissions will wrap a specific field with a permission check.<commit_title>[PATCH] make checkPermissions return boo... |
<vulnerable_code> struct snd_kcontrol *kctl;
struct snd_kcontrol_volatile *vd;
unsigned int index_offset;
int result;
down_read(&card->controls_rwsem);
kctl = snd_ctl_find_id(card, &control->id);
if (kctl == NULL) {
result = -ENOENT;
} else {
index_offset = snd_ctl_get_ioff(kctl, &control->id);
vd = &kctl... |
<vulnerable_code>#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <kernel/elf.h>
#define SHOW_FILE_HEADER 0x0001
#define SHOW_SECTION_HEADERS 0x0002
break;
case 0x6ffffff9:
name = "(RELACOUNT)";
sprintf(extra, "%ld", dynEntry->d_un.d_val);
break;
default:
name = "(unknown)";... |
<vulnerable_code>/* Copyright (c) 2002-2006 Sam Trenholme
*
* TERMS
*
/* Variable length data (length determined by rdlength) */
else if(subtype == RRSUB_VARIABLE) {
len = rdlength - total;
if(len == 0) {
break;
}
... |
<vulnerable_code> while (!rc && (fx = rpmfiNext(fi)) >= 0) {
struct filedata_s *fp = &fdata[fx];
if (!fp->skip) {
/* Directories replacing something need early backup */
if (!fp->suffix) {
rc = fsmBackup(fi, fp->action);
}
if (!IS_DEV_LOG(fp->fpath))
rc... |
<vulnerable_code>var exec = require('child_process').exec;
var defaultInterface = 'ra0',
freqs = [ '2.412', '2.417', '2.422', '2.427', '2.432', '2.437', '2.442', '2.447', '2.452', '2.457', '2.462' ];
var wiscan = {};
wiscan.scan = function (intf, callback) {
var child;
if (typeof intf === 'function') {
... |
<vulnerable_code> virResetLastError();
virCheckDomainReturn(dom, -1);
if (dom->conn->driver->domainGetTime) {
int ret = dom->conn->driver->domainGetTime(dom, seconds,<commit_title>[PATCH] virDomainGetTime: Deny on RO connections<commit_description>We have a policy that if API may end up talking to ... |
<vulnerable_code>#!/usr/bin/env python
from PIL import Image
from .helper import PillowTestCase
repro = (
"Tests/images/sgi_overrun_expandrowF04.bin",
"Tests/images/sgi_crash.bin",
)
class TestSgiCrashes(PillowTestCase):
def test_crashes(self):
for path in repro:
with open(path, "rb"... |
<vulnerable_code>const ps = require('path');
const fs = require('fs');
const interfaceDiffPath = ps.join(__dirname, '../../interface-diff.txt');
let reportContent = fs.readFileSync(interfaceDiffPath, 'utf8');
if (reportContent.includes('@')) {
reportContent = reportContent.split('\n').slice(3).join('\n');
rep... |
<vulnerable_code> status=InjectImageBlob(image_info,image,image,"jpeg",exception);
if (status == MagickFalse)
{
(void) CloseBlob(image);
return(MagickFalse);
}
status=InjectImageBlob(image_info,image,image,"jp2",exception);
... |
<vulnerable_code> this.model = options.model;
this.refreshTokenLifetime = options.refreshTokenLifetime;
this.alwaysIssueNewRefreshToken = options.alwaysIssueNewRefreshToken;
this.PKCEEnabled = options.PKCEEnabled;
}
/**<commit_title>[PATCH] prevent empty code challenge and undo refactor<commit_description><fixe... |
<vulnerable_code> }
return promisify(this.model.getAuthorizationCode, 1).call(this.model, request.body.code)
.bind(this)
.then(function(code) {
if (!code) {
throw new InvalidGrantError('Invalid grant: authorization code is invalid');
throw new InvalidGrantError('Invalid grant: `redirec... |
<vulnerable_code> this.allowEmptyState = options.allowEmptyState;
this.authenticateHandler = options.authenticateHandler || new AuthenticateHandler(options);
this.authorizationCodeLifetime = options.authorizationCodeLifetime;
this.PKCEEnabled = options.PKCEEnabled;
this.model = options.model;
}
var scop... |
<vulnerable_code> revokeAuthorizationCode: function() {},
saveToken: function() {}
};
var grantType = new AuthorizationCodeGrantType({ accessTokenLifetime: 123, model: model, PKCEEnabled: true });
var request = new Request({ body: { code: 12345, code_verifier: 'foo' }, headers: {}, meth... |
<vulnerable_code> e.message.should.equal('Invalid client: `redirect_uri` does not match client value');
});
});
describe('with PKCEEnabled', function() {
it('should throw an error if `client.isPublic` is missing`', function() {
var model = {
getAccessToken: function() {}... |
<vulnerable_code> yearlyPrice.get('stripe_price_id').should.equal('price_d04baebb73');
yearlyPrice.get('stripe_product_id').should.equal('prod_d2c1708c21');
});
});
// The following tests will create a new clean database for every test<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20Fixed=20arbitrary=... |
<vulnerable_code> int flag = 0;
int index = 0;
int argerr = 0;
attrd_init_mainloop();
crm_log_preinit(NULL, argc, argv);
crm_log_init(T_ATTRD, LOG_INFO, TRUE, FALSE, argc, argv, FALSE);
crm_info("Starting up");
attributes = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL, free_att... |
<vulnerable_code> int index = 0;
int argerr = 0;
struct passwd *pwentry = NULL;
crm_log_preinit(NULL, argc, argv);
crm_set_options(NULL, "[options]",
long_options, "Daemon for storing and replicating the cluster configuration");
crm_peer_init();
mainloop_add_signal(SIGT... |
<vulnerable_code>/*
* Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
*
* This source code is licensed under the GNU General Public License version 2
* or later (GPLv2+) WITHOUT ANY WARRANTY.
int flag;
int index = 0;
int argerr = 0;
crmd_mainloop = g_main_loop_new(NULL, FALSE);
crm_log_... |
<vulnerable_code> int option_index = 0;
crm_cluster_t cluster;
const char *actions[] = { "reboot", "off", "on", "list", "monitor", "status" };
crm_log_preinit(NULL, argc, argv);
crm_set_options(NULL, "mode [options]", long_options,
}
crm_log_init(NULL, LOG_INFO, TRUE, FALSE, argc, argv, FAL... |
<vulnerable_code>
#define PEER_NAME(peer) ((peer)? ((peer)->uname? (peer)->uname : "<unknown>") : "<none>")
void
pcmk_cpg_membership(cpg_handle_t handle,
const struct cpg_name *groupName,
gboolean found = FALSE;
static int counter = 0;
uint32_t local_nodeid = get_local_nodeid(handle);
... |
<vulnerable_code> if (len) len--; // trailing separator
if (!strncmp(rock->namespace->prefix[NAMESPACE_USER], commonpat, MIN(len, prefixlen))) {
if (prefixlen < len) {
/* we match all users */
strlcpy(domainpat+domainlen, "user.", sizeof(domainpat)-domainlen);... |
<vulnerable_code> VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
uint8_t val;
k->get_config(vdev, vdev->config);
if (addr > (vdev->config_len - sizeof(val)))
return (uint32_t)-1;
val = ldub_p(vdev->config + addr);
return val;
VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vd... |
<vulnerable_code> {
*q++=(unsigned char) (GetPixelLuma(image,p) >= (QuantumRange/2.0) ?
'0' : '1');
*q++=' ';
if ((q-pixels+1) >= (ssize_t) sizeof(pixels))
{
*q++='\n';
(void) WriteBlob(image,q-pixels,pixels);
... |
<vulnerable_code>package org.eclipse.rdf4j.rio.helpers;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import org.eclipse.rdf4j.common.xml.XMLReaderFactory;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.rio.RioSetting;
import org.eclipse.rdf4j.rio.helpers.X... |
<vulnerable_code> }
$("#regenerate_api_key").on("click", (e) => {
channel.post({
url: "/json/users/me/api_key/regenerate",
success(data) {
$("#api_key_value").text(data.api_key);
},<commit_title>[PATCH] CVE-2021-3967: Only r... |
<vulnerable_code> for api_key in old_api_keys:
self.assertEqual(get_user_profile_by_api_key(api_key).email, email)
result = self.client_post("/json/users/me/api_key/regenerate")
self.assert_json_success(result)
new_api_key = result.json()["api_key"]
self.assertNotIn(n... |
<vulnerable_code> rest_path("user_groups/<int:user_group_id>", PATCH=edit_user_group, DELETE=delete_user_group),
rest_path("user_groups/<int:user_group_id>/members", POST=update_user_group_backend),
# users/me -> zerver.views.user_settings
rest_path("users/me/api_key/regenerate", POST=regenerate_api_key)... |
<vulnerable_code> if (conn->c_loopback
&& rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
}
/* FIXME we may overallocate here */<commit_title>[PATCH] rds: prevent BUG_ON triggering on congestion map updat... |
<vulnerable_code> unsigned int hdr_off, unsigned int sg,
unsigned int off)
{
/* Do not send cong updates to loopback */
if (rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
}
BUG_ON(hdr_off || sg || of... |
<vulnerable_code> pkiDebug("found kdcPkId in AS REQ\n");
is = d2i_PKCS7_ISSUER_AND_SERIAL(NULL, &p, (int)pkid_len);
if (is == NULL)
goto cleanup;
status = X509_NAME_cmp(X509_get_issuer_name(kdc_cert), is->issuer);
if (!status) {
}
retval = 0;
cleanup:
X509_NAME_free(is->issuer);... |
<vulnerable_code> *
* @param stringQuery
* @param filter
* @param colToSort
* @param sortingDirection
* @param uniqueCol Oracle needs to sort by a unique column for pagination to work correctly
* @param lowerSortColumn
* @param hasSpecialFilter must be set to true if the filters list contains a FilterTyp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.