text stringlengths 79 3.72M |
|---|
<vulnerable_code> /* Write a C string (guaranteed to have a zero terminator). */
strptr = va_arg (argptr, char *) ;
size = strlen (strptr) + 1 ;
size += (size & 1) ;
if (psf->header.indx + (sf_count_t) size >= psf->header.len && psf_bump_header_allocation (psf, 16))
return count ;
i... |
<vulnerable_code> with self.assertRaises(ZeroDivisionError):
WorseStruct().__setstate__({}, b'foo')
################################################################
if __name__ == '__main__':<commit_title>[PATCH] closes bpo-42938: Replace snprintf with Python unicode<commit_description><fixed_code>... |
<vulnerable_code>static PyObject *
PyCArg_repr(PyCArgObject *self)
{
char buffer[256];
switch(self->tag) {
case 'b':
case 'B':
sprintf(buffer, "<cparam '%c' (%d)>",
self->tag, self->value.b);
break;
case 'h':
case 'H':
sprintf(buffer, "<cparam '%c' (%d)>",
... |
<vulnerable_code> self.accessibility.liveRegion = {
$region: "",
speak: function (msg) {
var $msg = $("<div>" + msg + "</div>");
this.$region.html($msg);
},
domListener: function () {<commit_title>[PATCH 1/2] Escape message<commit_description>Why:
* If the text message contains a message l... |
<vulnerable_code> if (exec_control & CPU_BASED_TPR_SHADOW) {
vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, -1ull);
vmcs_write32(TPR_THRESHOLD, vmcs12->tpr_threshold);
}
/*<commit_title>[PATCH] kvm: nVMX: Don't allow L2 to access the hardware CR8<commit_description>If L1 does not specify the "use TPR shadow" VM-execution ... |
<vulnerable_code> const unsigned char *p, const unsigned char *end)
{
struct iso9660 *iso9660;
iso9660 = (struct iso9660 *)(a->format->data);
}
p += p[2];
}
return (ARCHIVE_OK);
}
static int<commit_title>[PATCH] iso9660: Fail when expected Rockridge extensions is missing<commit_description>A corrupted or... |
<vulnerable_code> return -1;
}
/**
* srpt_rx_mgmt_fn_tag() - Process a task management function by tag.
* @ch: RDMA channel of the task management request.
* @fn: Task management function to perform.
* @req_tag: Tag of the SRP task management request.
* @mgmt_ioctx: I/O context of the task management request.
*
... |
<vulnerable_code> struct cred *new;
int ret;
if (
#ifdef CONFIG_KEYS
!p->cred->thread_keyring &&<commit_title>[PATCH] cred: copy_process() should clear<commit_description><fixed_code>
struct cred *new;
int ret;
p->replacement_session_keyring = NULL;
if (
#ifdef CONFIG_KEYS
!p->cred->thread_keyring && |
<vulnerable_code> else if (g_utf8_validate (host_header, -1, NULL) == FALSE)
return 1;
bracket_index = -1;
colon_index = -1;
for (char_index = strlen (host_header) - 1;
if (bracket_index != -1 && host_header[0] == '['
&& (colon_index == bracket_index + 1 || colon_index < bracket_index))
{
... |
<vulnerable_code> .where({ id: 1 })
.execute();
expect(end[0].key).toEqual('strapi_content_types_schema');
});
test('rollback successfully', async () => {
.where({ id: 1 })
.execute();
expect(end[0].key).toEqual('strapi_content_types_schema');
});
});
});<comm... |
<vulnerable_code> global.strapi = {
getModel() {
return {
privateAttributes: [],
attributes: {
title: {
type: 'text',<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_description>+ Fixes a flaky test (transactions.test.ap... |
<vulnerable_code>
const { cloneDeep } = require('lodash/fp');
const _ = require('lodash');
const { hasDraftAndPublish, getPrivateAttributes } = require('@strapi/utils').contentTypes;
const {
CREATED_AT_ATTRIBUTE,
UPDATED_AT_ATTRIBUTE,
);
}
Object.defineProperty(schema, 'privateAttributes', {
get() {
... |
<vulnerable_code> uid: 'api::test.test',
kind: 'singleType',
modelName: 'test-model',
privateAttributes: [],
attributes: {
attr: { type: 'string' },
},<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_description>+ Fixes a flaky test (transa... |
<vulnerable_code>
const fakeStrapi = {
getModel: jest.fn(() => {
return { kind: 'singleType', privateAttributes: [] };
}),
};
uid: entityUID,
kind: 'contentType',
modelName: 'test-model',
privateAttributes: [],
options: {},
... |
<vulnerable_code> kind: 'contentType',
modelName: 'test-model',
uid: 'test-uid',
privateAttributes: [],
options: {},
attributes: {
attrBigIntegerUnique: { type: 'biginteger', unique: true },<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_d... |
<vulnerable_code> kind: 'contentType',
modelName: 'test-model',
uid: 'test-uid',
privateAttributes: [],
options: {},
attributes: {
attrDateUnique: { type: 'date', unique: true },<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_description>+... |
<vulnerable_code> kind: 'contentType',
uid: 'test-uid',
modelName: 'test-model',
privateAttributes: [],
options: {},
attributes: {
attrFloatUnique: { type: 'float', unique: true },<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_description... |
<vulnerable_code> kind: 'contentType',
uid: 'test-uid',
modelName: 'test-model',
privateAttributes: [],
options: {},
attributes: {
attrIntegerUnique: { type: 'integer', unique: true },<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_descrip... |
<vulnerable_code> kind: 'contentType',
modelName: 'test-model',
uid: 'test-uid',
privateAttributes: [],
options: {},
attributes: {
attrStringUnique: { type: 'string', unique: true },<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_descripti... |
<vulnerable_code> test('Attribute is private in the model attributes', () => {
const model = createModelWithPrivates();
global.strapi = { config: createConfig() };
Object.assign(model, { privateAttributes: getPrivateAttributes(model) });
expect(isPrivateAttribute(model, 'foo')).toBeTruthy();... |
<vulnerable_code>'use strict';
const _ = require('lodash');
const { has } = require('lodash/fp');
const SINGLE_TYPE = 'singleType';
const COLLECTION_TYPE = 'collectionType';
const isCollectionType = ({ kind = COLLECTION_TYPE }) => kind === COLLECTION_TYPE;
const isKind = (kind) => (model) => model.kind === kind;
con... |
<vulnerable_code> return;
}
const isPrivate = isPrivateAttribute(schema, key) || attribute.private === true;
if (isPrivate) {
remove(key);<commit_title>[PATCH] fix(content-types): remove getter for private attributes<commit_description>+ Fixes a flaky test (transactions.test.api.js)<fixed_code>
retur... |
<vulnerable_code> extra=None,
)
)
db.merge_conn(
Connection(
conn_id="invalid_port_conn",
conn_type="mssql",
schema="schema",
host="rmdbs",
port="5050?query_param1=value1",
... |
<vulnerable_code> time.sleep(1)
if isusermode and not trigger.group(2) and selfsafe:
bot.write(['MODE', trigger.sender, mode, trigger.nick])
elif isusermode and trigger.account in chanops:
bot.write(['MODE', trigger.sender, mode, trigger.group(2)])
elif isbqmod... |
<vulnerable_code>// ----------------------------------------------------------------------------------
// const exec = require('child_process').exec;
const execFile = require('child_process').execFile;
const util = require('./util');
let _platform = process.platform;
let result = null;
try {
... |
<vulnerable_code> *policy |= (pol->flags & MPOL_MODE_FLAGS);
}
if (vma) {
up_read(¤t->mm->mmap_sem);
vma = NULL;
}
err = 0;
if (nmask) {
if (mpol_store_user_nodemask(pol)) {<commit_title>[PATCH] mm/mempolicy: fix use after free when calling get_mempolicy<commit_description>I hit a use after free iss... |
<vulnerable_code> return PTR_ERR(chain);
if (nft_is_base_chain(chain))
return -EOPNOTSUPP;
if (desc->flags & NFT_DATA_DESC_SETELEM &&
chain->flags & NFT_CHAIN_BINDING)
return -EINVAL;<commit_title>[PATCH] netfilter: nf_tables: disallow binding to already bound chain<commit_description>Update nft_data_... |
<vulnerable_code> CANONICALJSON_MIN_INT,
validate_canonicaljson,
)
from synapse.federation.federation_server import server_matches_acl_event
from synapse.http.servlet import validate_json_object
from synapse.rest.models import RequestBodyModel
from synapse.types import EventID, JsonDict, RoomID, StrCollection, U... |
<vulnerable_code> List,
Mapping,
Optional,
Tuple,
Union,
)
from matrix_common.regex import glob_to_regex
from prometheus_client import Counter, Gauge, Histogram
_INBOUND_EVENT_HANDLING_LOCK_NAME = "federation_inbound_pdu"
class FederationServer(FederationBase):
def __init__(self, hs: "HomeSer... |
<vulnerable_code>from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
from synapse.config.server import DEFAULT_ROOM_VERSION
from synapse.events import EventBase, make_event_from_dict
from synapse.federation.federation_server import server_matches_acl_event
from synapse.rest import admin
from synapse.rest.client i... |
<vulnerable_code> VIsual_mode = c;
VIsual_active = TRUE;
VIsual_reselect = TRUE;
trigger_modechanged();
// Corner case: the 0 position in a tab may change when going into
// virtualedit. Recalculate curwin->w_cursor to avoid bad highlighting.
foldAdjustVisual();
#endif
setmouse();
#ifd... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3609,
/**/<commit_title>[PATCH] patch 8.2.3610: crash when ModeChanged triggered too early<commit_description>Problem: Crash when ModeChanged triggered too early.
Solution: Trigger ModeChanged after setting VI... |
<vulnerable_code>import org.gradle.util.CollectionUtils;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
@Override
public Collection<Authentication> getConfiguredAuthentication() {
return delegate.getConfiguredAuthentication();
}
List<String> getAuthenti... |
<vulnerable_code> int res;
struct sha1_ctx ctx;
mpz_init(m);
rsa_compute_root(key, m, gibberish);
int res;
struct sha256_ctx ctx;
mpz_init(m);
rsa_compute_root(key, m, gibberish);
<commit_title>[PATCH] Fix rsa oaep key length check before decryption<commit_description><fixed_code>
int res;
struct ... |
<vulnerable_code> StringInfo
*profile;
profile=BlobToStringInfo((const unsigned char *) NULL,
dpx.file.user_size-sizeof(dpx.user.id));
if (profile == (StringInfo *) NULL)<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/523<commit_descriptio... |
<vulnerable_code> if(addr) {
if(addr->ss.sa_family == AF_INET) {
const uint8_t *u = ((const uint8_t*)&(addr->s4.sin_addr));
return (u[0] == 127);
} else if(addr->ss.sa_family == AF_INET6) {
const uint8_t *u = ((const uint8_t*)&(addr->s6.sin6_addr));
if(u[7] == 1) {<commit_title>[PATCH 1/8] ioa_addr_is_l... |
<vulnerable_code> return (u[0] == 127 || u[0] == 0);
} else if(addr->ss.sa_family == AF_INET6) {
const uint8_t *u = ((const uint8_t*)&(addr->s6.sin6_addr));
if(u[7] == 1) {
int i;
for(i=0;i<7;++i) {
if(u[i])
return 0;
}<commit_title>[PATCH 1/8] ioa_addr_is_loopback now covers 0.0.0.0/8<... |
<vulnerable_code> return (u[0] == 127 || u[0] == 0);
} else if(addr->ss.sa_family == AF_INET6) {
const uint8_t *u = ((const uint8_t*)&(addr->s6.sin6_addr));
if(u[15] == 1) {
int i;
for(i=0;i<15;++i) {
if(u[i])<commit_title>[PATCH 1/8] ioa_addr_is_loopback now covers 0.0.0.0/8<commit_description><... |
<vulnerable_code> if(addr) {
if(addr->ss.sa_family == AF_INET) {
const uint8_t *u = ((const uint8_t*)&(addr->s4.sin_addr));
return (u[0] == 127 || u[0] == 0);
} else if(addr->ss.sa_family == AF_INET6) {
const uint8_t *u = ((const uint8_t*)&(addr->s6.sin6_addr));
if(u[15] == 1 || u[15] == 0) {
int i;... |
<vulnerable_code> if(server && peer_addr) {
if(*(server->no_multicast_peers) && ioa_addr_is_multicast(peer_addr))
return 0;
if( !*(server->allow_loopback_peers) && ioa_addr_is_loopback(peer_addr))
return 0;
{<commit_title>[PATCH 1/8] ioa_addr_is_loopback now covers 0.0.0.0/8<commit_description><fixed_code>... |
<vulnerable_code> if(server && peer_addr) {
if(*(server->no_multicast_peers) && ioa_addr_is_multicast(peer_addr))
return 0;
if( !*(server->allow_loopback_peers) && ioa_addr_is_loopback(peer_addr) && ioa_addr_is_zero(peer_addr))
return 0;
{<commit_title>[PATCH 1/8] ioa_addr_is_loopback now covers 0.0.0.0/8<... |
<vulnerable_code> if(server && peer_addr) {
if(*(server->no_multicast_peers) && ioa_addr_is_multicast(peer_addr))
return 0;
if( !*(server->allow_loopback_peers) && (ioa_addr_is_loopback(peer_addr) || ioa_addr_is_zero(peer_addr)))
return 0;
{<commit_title>[PATCH 1/8] ioa_addr_is_loopback now covers 0.0.0.0/... |
<vulnerable_code> return 0;
}
int ioa_addr_is_zero(ioa_addr *addr)
{
if(addr) {<commit_title>[PATCH 1/8] ioa_addr_is_loopback now covers 0.0.0.0/8<commit_description><fixed_code>
return 0;
}
/*
To avoid a vulnerability this function checks whether the addr is in 0.0.0.0/8 or ::/128.
Source from (INADDR_ANY) 0.0.0.0... |
<vulnerable_code> return (u[0] == 0);
} else if(addr->ss.sa_family == AF_INET6) {
const uint8_t *u = ((const uint8_t*)&(addr->s6.sin6_addr));
if(u[15] == 0) {
int i;
for(i=0;i<15;++i) {
if(u[i])
return 0;
}
return 1;
}
}
}
return 0;<commit_title>[PATCH 1/8] ioa_addr_is_loopba... |
<vulnerable_code> gf_filter_pid_set_property(pid, GF_PROP_PID_MUX_INDEX, &PROP_UINT(i+1));
for (j=0; j<(u32) stream->nb_side_data; j++) {
ffdmx_parse_side_data(&stream->side_data[i], pid);
}
if (ctx->demuxer->nb_chapters) {<commit_title>[PATCH] ffdmx: fix loop index mismatch on side data parsing (fixes<comm... |
<vulnerable_code> $(".merge-user").click(function() {
// Update the path of save button
$("#merge-save-access").attr("data-path", $(this).data("path"))
let userInfo = $(this).data("info")
$("#merge-to").html("<span>" + userInfo.name + "</span>" + "<span class='text-muted d-block'>... |
<vulnerable_code> return FALSE;
WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results PDU");
Stream_Read_UINT32(s, rdp->autodetect->bandwidthMeasureTimeDelta); /* timeDelta (4 bytes) */
Stream_Read_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (4 bytes) */
<commit_title>[PATCH] Fixed #... |
<vulnerable_code> schema: SchemaController.SchemaController | any,
className: string,
protectedFields: null | Array<any>,
object: any,
query: any = {}
) => {
if (!isMaster && !Array.isArray(protectedFields)) {
protectedFields = new DatabaseController().addProtectedFields(
schema,
className,
... |
<vulnerable_code> maybeRunAfterEventTrigger,
} from '../triggers';
import { getAuthForSessionToken, Auth } from '../Auth';
import { getCacheController } from '../Controllers';
import LRU from 'lru-cache';
import UserRouter from '../Routers/UsersRouter';
import DatabaseController from '../Controllers/DatabaseController... |
<vulnerable_code> with self.cached_session():
for dtype in [dtypes.int32, dtypes.int64]:
with self.assertRaisesRegex(errors.InvalidArgumentError,
"index is out of bound as with dims"):
indices = constant_op.constant([2, 5, 7], dtype=dtype)
dims = ... |
<vulnerable_code> }
strFileName = m_common->trans2uft8(statBuffer.name, m_mapFileCode[index]); // 解压文件名(压缩包中)
if(strFileName.contains(QLatin1Char('\\')))
strFileName = strFileName.replace(QLatin1Char('\\'), QDir::separator());
QString strOriginName = strFileName;<commit_title>[PATCH] fix: Zip... |
<vulnerable_code> cat_enum.align_timelines = align_timelines;
cat_enum.allow_add_in_command = allow_add_in_command;
strcpy(cat_enum.szPath, fileName);
sep = strrchr(cat_enum.szPath, GF_PATH_SEPARATOR);
if (!sep) sep = strrchr(cat_enum.szPath, '/');
if (!sep) {
strcpy(cat_enum.szPath, ".");
strcpy(cat_enum.szR... |
<vulnerable_code> break;
case GF_EVENT_NAVIGATE:
if (gf_term_is_supported_url(term, evt->navigate.to_url, 1, no_mime_check)) {
strcpy(the_url, evt->navigate.to_url);
fprintf(stderr, "Navigating to URL %s\n", the_url);
gf_term_navigate_to(term, evt->navigate.to_url);
return 1;
}
{
const size_t sepIdx... |
<vulnerable_code> AVFormatContext *ctx;
AVOutputFormat *fmt_out;
Bool ret = GF_FALSE;
char *ext, szName[1000], szExt[20];
const char *szExtList;
FFDemux *ffd;
if (!plug || !url)
ffd = (FFDemux*)plug->priv;
strcpy(szName, url);
ext = strrchr(szName, '#');
if (ext) ext[0] = 0;
ext = strrchr(szName, '.');
if... |
<vulnerable_code> ext[0] = '.';
ext = anext;
}
strcpy(szExt, &ext[1]);
strlwr(szExt);
if (strstr(szExt, "bt")) load->type = GF_SM_LOAD_BT;<commit_title>[PATCH] fix some overflows due to strcpy<commit_description>fixes #1184, #1186, #1187 among other things<fixed_code>
ext[0] = '.';
ext = anex... |
<vulnerable_code> get_size_of_type,
parse_type,
)
from vyper.utils import fourbytes_to_int, keccak256
# Function argument
def internal_function_label(self):
assert self.internal, "why are you doing this"
def mkalphanum(s):
return "".join([c if c.isalnumeric() else "_"] for c in... |
<vulnerable_code> # function, as there is no guarantee there is a user-provided return
# statement (which would generate the jump)
if sig.output_type is None:
stop_func = [["jump", "pass"]]
else:
# unreachable at runtime
stop_func = [["invalid"]]
body = parse_body(c, context) ... |
<vulnerable_code>
def get_nonreentrant_lock(func_type):
nonreentrant_pre = [["pass"]]
nonreentrant_post = [["pass"]]
if func_type.nonreentrant:
nkey = func_type.reentrancy_key_position.position
nonreentrant_pre = [["seq", ["assert", ["iszero", ["sload", nkey]]], ["sstore", nkey, 1]]]
... |
<vulnerable_code> def __init__(self, maxlen):
self.size_in_bytes = maxlen
def _allocate_return_buffer(context: Context) -> int:
maxlen = abi_type_of(context.return_type).size_bound()
return context.new_internal_variable(FakeType(maxlen=maxlen))
# Generate return code for stmt
def make_return_stmt(l... |
<vulnerable_code> return fourbytes_to_int(keccak256(bytes(method_sig, "utf-8"))[:4])
# Converts string to bytes
def string_to_bytes(str):
bytez = b""<commit_title>[PATCH] wip handle return None cases<commit_description>use a single exit sequence for every function<fixed_code>
return fourbytes_to_int(keccak... |
<vulnerable_code> }
]
},
{
"name": "modoboa",
"values": [<commit_title>[PATCH 1/2] Added fail2ban setup<commit_description><fixed_code>
}
]
},
{
"name": "fail2ban",
"values": [
{
"option": "enabled",
... |
<vulnerable_code>
PRIMARY_APPS = [
"amavis",
"modoboa",
"automx",
"radicale",<commit_title>[PATCH 1/2] Added fail2ban setup<commit_description><fixed_code>
PRIMARY_APPS = [
"amavis",
"fail2ban",
"modoboa",
"automx",
"radicale", |
<vulnerable_code><commit_title>[PATCH 1/2] Added fail2ban setup<commit_description><fixed_code>
"""fail2ban related functions."""
from . import base
class Fail2ban(base.Installer):
"""Fail2ban installer."""
appname = "fail2ban"
packages = {
"deb": ["fail2ban"],
"rpm": ["fail2ban"]
}
... |
<vulnerable_code> */
public static File createTempDir(final String prefix, final String suffix) {
try {
final File tmp = File.createTempFile(prefix, suffix);
if (!tmp.delete()) {
throw new SAMException("Could not delete temporary file " + tmp);
}
... |
<vulnerable_code>
logger.debug("Placing URL parameters in map.");
urlParameters.put("ticket", ticket);
urlParameters.put("service", encodeUrl(serviceUrl));
if (this.renew) {
urlParameters.put("renew", "true");
buffer.append(i++ == 0 ? "?" : "&");
... |
<vulnerable_code> * @param urlParameters the Map containing the existing parameters to send to the server.
*/
protected final void populateUrlAttributeMap(final Map<String, String> urlParameters) {
urlParameters.put("pgtUrl", encodeUrl(this.proxyCallbackUrl));
}
protected String getUrlSuff... |
<vulnerable_code> */
package org.jasig.cas.client.validation;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.io.UnsupportedEncodingException;
import org.jasig.cas.client.PublicTestHttpServer;
import org.junit.Before;
// expected
}
}
}<commit_title>... |
<vulnerable_code> break;
buf = (char_u *)ga.ga_data;
buf[ga.ga_len++] = NUL;
}
else
{
if (fgets((char *)buf + ga.ga_len, ga.ga_maxlen - ga.ga_len,
sp->fp) == NULL)
break;
}
len = ga.ga_len + (int)STRLEN(buf + ga.ga_len);
#ifdef USE_CRNL
// Ignore a trailing CTRL-Z, when in Dos mode. Only reco... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4973,
/**/<commit_title>[PATCH] patch 8.2.4974: ":so" command may read after end of buffer<commit_description>Problem: ":so" command may read after end of buffer.
Solution: Compute length of text properly.<fix... |
<vulnerable_code> Strcat(tmp, getLinkNumberStr(0));
Strcat_char(tmp, '(');
}
Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=%s "
"name=\"%s\" width=%d maxlength=%d value=\"%s\"",
cur_hseq++, cur_form_id, p, html_quote(r), w, i, qq));
if (x)
Strcat_charp(tmp, " checked");
if (y)
... |
<vulnerable_code>public class MultiPartFormInputStream
{
private static final Logger LOG = Log.getLogger(MultiPartFormInputStream.class);
private static final MultiMap<Part> EMPTY_MAP = new MultiMap<>(Collections.emptyMap());
private final MultiMap<Part> _parts;
private final EnumSet<NonCompliance> _non... |
<vulnerable_code>
public MultiPartsHttpParser(InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir, Request request) throws IOException
{
_httpParser = new MultiPartFormInputStream(in, contentType, config, contextTmpDir);
_context = request.getCon... |
<vulnerable_code> if (config == null)
throw new IllegalStateException("No multipart config for servlet");
_multiParts = newMultiParts(config);
setAttribute(MULTIPARTS, _multiParts);
Collection<Part> parts = _multiParts.getParts();
else
... |
<vulnerable_code>import org.eclipse.jetty.client.util.BytesContentProvider;
import org.eclipse.jetty.client.util.InputStreamResponseListener;
import org.eclipse.jetty.client.util.MultiPartContentProvider;
import org.eclipse.jetty.client.util.StringContentProvider;
import org.eclipse.jetty.http.HttpFields;
import org.ec... |
<vulnerable_code>public class MultiPartInputStreamParser
{
private static final Logger LOG = Log.getLogger(MultiPartInputStreamParser.class);
public static final MultipartConfigElement __DEFAULT_MULTIPART_CONFIG = new MultipartConfigElement(System.getProperty("java.io.tmpdir"));
public static final MultiMap... |
<vulnerable_code> == "max-age=0, no-cache, no-store, must-revalidate, private"
)
@control_silo_test(stable=True)
class ApiTokensCreateTest(APITestCase):<commit_title>[PATCH] add test<commit_description><fixed_code>
== "max-age=0, no-cache, no-store, must-revalidate, private"
)
... |
<vulnerable_code>{
kref_put(&ubufs->kref, vhost_net_zerocopy_done_signal);
wait_event(ubufs->wait, !atomic_read(&ubufs->kref.refcount));
kfree(ubufs);
}
mutex_unlock(&vq->mutex);
if (oldubufs) {
vhost_net_ubuf_put_and_wait(oldubufs);
mutex_lock(&vq->mutex);
vhost_zerocopy_signal_used(n, vq);
mutex_unlock... |
<vulnerable_code> apr_uri_unparse(r->pool, &uri, 0), c_host);
oidc_error(r, "%s: %s", *err_str, *err_desc);
return FALSE;
} else if (strstr(url, "/") != url) {
*err_str = apr_pstrdup(r->pool, "Malformed URL");
*err_desc =
apr_psprintf(r->pool,<commit_title>[PATCH] 2.4.0.2 oops<commit_description>Signe... |
<vulnerable_code>
private_data_dir = kwargs.get('private_data_dir')
if private_data_dir is None:
private_data_dir = tempfile.TemporaryDirectory().name
self.private_data_dir = private_data_dir
self.status = "unstarted"
private_data_dir = kwargs.get('private_data_dir'... |
<vulnerable_code> self.sha1_validate(self.unresolved_ref)
except ValueError:
# The ref is a head/tag and we resolve it using `git ls-remote`
command = ["git", "ls-remote", self.repo, self.unresolved_ref]
result = subprocess.run(command, universal_newlines=True, std... |
<vulnerable_code> const wpaDetails = wpaConnectionLinux(ifaceSanitized);
const ssid = nmiDetails.ssid || wpaDetails.ssid;
const network = networkList.filter(nw => nw.ssid === ssid);
const nmiConnection = nmiConnectionLinux(ssid);
const channel = network && network.length... |
<vulnerable_code> deactivation status before logging in.
This exists purely for appservice's configured sender_localpart
which deosn't have an associated user in the database.
Returns:
Dictionary of account information after successful login.<commit_t... |
<vulnerable_code> u_int16_t read = 0;
u_int16_t oldread;
u_int32_t c;
/* ip address must be X.X.X.X with each X between 0 and 255 */
oldread = read;
c = ndpi_bytestream_to_number(str, max_chars_to_read, &read);
if(c > 255 || oldread == read || max_chars_to_read == read || str[read] != '.')
return(0);
... |
<vulnerable_code> @Override
public void render(HtmlRenderer renderer) {
if (isArtifactsDeleted || isEmpty()) {
HtmlElement element = p().content("Artifacts for this job instance are unavailable as they may have been <a href='" +
CurrentGoCDVersion.docsUrl("configuration/de... |
<vulnerable_code> return HtmlElement.li().content(
HtmlElement.span(HtmlAttribute.cssClass("artifact")).content(
HtmlElement.a(HtmlAttribute.href(getUrl()))
.content(getFileName())
)
);
<commit_title>[PATCH] #000 - Escape filenames in artifa... |
<vulnerable_code> HtmlElement.div(cssClass("dir-container")).content(
HtmlElement.span(cssClass("directory")).content(
HtmlElement.a(onclick("BuildDetail.tree_navigator(this)"))
.content(getFileName())
)
... |
<vulnerable_code>import java.util.List;
import com.thoughtworks.go.server.presentation.models.HtmlRenderer;
public class HtmlElement implements HtmlRenderable {
public static HtmlElement div(HtmlAttribute... attributes) { return new HtmlElement("div", attributes); }
this.attributes = attributes;
}
... |
<vulnerable_code><commit_title>[PATCH] #000 - Escape filenames in artifact tab<commit_description><fixed_code>
/*
* Copyright 2021 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the... |
<vulnerable_code> */
package com.thoughtworks.go.domain;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.MatcherAssert.assertThat;
public class FolderDirectoryEntryTest {
@Test
entry.addFile("file", "path");
assertThat(subDirectory, hasIt... |
<vulnerable_code> error_msg = "foo is deprecated and will be removed in PyPDF2 3.0.0."
assert exc.value.args[0] == error_msg
@pytest.mark.parametrize(
("left", "up", "upleft", "expected"),
[<commit_title>[PATCH] flake 8<commit_description><fixed_code>
error_msg = "foo is deprecated and will be rem... |
<vulnerable_code># under the License.
from __future__ import annotations
from functools import wraps
from typing import Callable, Sequence, TypeVar, cast
T = TypeVar("T", bound=Callable)
def get_access_denied_message():
return conf.get("webserver", "access_denied_message")
appbuilder = current_app... |
<vulnerable_code><commit_title>[PATCH] Check that dag_ids passed in request are consistent<commit_description>There are several ways to pass dag_ids in the request - via args
via kwargs, or via form requests or via json. If you pass several
of those, they should all be the same.<fixed_code>
# Licensed to the Apache Sof... |
<vulnerable_code>import random
import string
import hashlib
import requests
class passeo:
def generate(length, numbers=False, symbols=False, uppercase=False, lowercase=False, space=False, save=False):
password = ''
if numbers:
password += string.digits
if s... |
<vulnerable_code>__version__ = "1.12.0"<commit_title>[PATCH] Version bump to v1.13.0<commit_description><fixed_code>
__version__ = "1.13.0" |
<vulnerable_code> }
}
private static String hex(String origName, String candidate) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] sum = md.digest(candidate.getBytes(UTF_8));
//convert the byte to hex format method 2<commit_title>... |
<vulnerable_code> // (inline loading with "jar:..!/..." path will not work
// with standard classloader methods)
String extractedJarLocation = localFile + ".nested/" + je.getName();
... |
<vulnerable_code>
}
}<commit_title>[PATCH] Nested jar, if by relative path point up, is stored as hashed<commit_description><fixed_code>
}
@Test
public void testRelativePathInNestedJars() throws Exception {
CacheUtil.clearCache();
int port = ServerAccess.findFreePort();
File d... |
<vulnerable_code> throw new IOException("bt socket acept failed");
}
as.mSocket = new LocalSocket(fds[0]);
try {
as.mSocket.closeExternalFd();
} catch (IOException e) {<commit_title>[PATCH] FPII-2473: Denial of service vulnerability in Bluetooth<commit_description>... |
<vulnerable_code> bool mask_to_left;
};
static int sanitize_ptr_alu(struct bpf_verifier_env *env,
struct bpf_insn *insn,
const struct bpf_reg_state *ptr_reg,
tmp = *dst_reg;
*dst_reg = *ptr_reg;
}
ret = push_stack(env, env->insn_idx + 1, env->insn_idx, true);
if (!ptr_is_dst_reg && ret)
*dst_reg... |
<vulnerable_code> # Validate only if action is set_profile_info
return super().is_submitted() and self.action.data == 'set_password'
def populate_obj(self, user):
# Check if current password is "valid" if Not, rate limit the
# number of attempts and logout user after too many invalid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.