text stringlengths 79 3.72M |
|---|
<vulnerable_code>import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.dataelement.DataElementOperand;
import org.hi... |
<vulnerable_code> */
package org.hisp.dhis.commons.collection;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
set1.retainAll( new HashSet<>( c2 ) );
return set1;
}
/**
* ... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-52vp-f7hj-cj92<commit_description><fixed_code>
/*
* Copyright (c) 2004-2022, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following... |
<vulnerable_code>public class SqlUtils
{
public static final String QUOTE = "\"";
public static final String SEPARATOR = ".";
return alias + SEPARATOR + quote( relation );
}
/**
* Returns a string set for the given result set and column. Assumes that<commit_title>[PATCH] Merge pull requ... |
<vulnerable_code> return -1;
}
ret = 0;
if (fwrite(s->s, 1, s->n, f) != s->n || fflush(f) != 0) {
warn("write %s:", name);
ret = -1;
}<commit_title>[PATCH] util: Check for NULL string in writefile<commit_description>This check was there previously, but was removed in f549b757 with
the addition of a check durin... |
<vulnerable_code>NtpdShmDriver::NtpdShmDriver(const rclcpp::NodeOptions & options)
: Node("shm_driver", options),
shm_unit_("shm_unit", 2),
fixup_date_("fixup_date", false),
time_ref_topic_("time_ref_topic", "time_ref")
{
this->declare_parameter("shm_unit", shm_unit_.get_parameter_value());
this->declare_para... |
<vulnerable_code> if (n < 0)
return n;
npages = PAGE_ALIGN(off + n);
if (WARN_ON(npages == 0))
return -EINVAL;
<commit_title>[PATCH] crypto: fix af_alg_make_sg() conversion to iov_iter<commit_description>Commit 1d10eb2f156f ("crypto: switch af_alg_make_sg() to iov_iter")
broke af_alg_make_sg() and skcipher_recvm... |
<vulnerable_code> while (!sg->length)
sg++;
used = ctx->used;
if (!used) {
err = skcipher_wait_for_data(sk, flags);
if (err)
goto unlock;
}
used = min_t(unsigned long, used, iov_iter_count(&msg->msg_iter));
used = af_alg_make_sg(&ctx->rsgl, &msg->msg_iter, used);
err = used;<commit_title>[P... |
<vulnerable_code> cmdmod_T *cmod,
int skip_only)
{
char_u *cmd_start = NULL;
char_u *p;
int starts_with_colon = FALSE;
int vim9script = in_vim9script();
&& curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
{
eap->cmd = (char_u *)"+";
if (!skip_only)
ex_pressedreturn =... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4762,
/**/<commit_title>[PATCH] patch 8.2.4763: using invalid pointer with "V:" in Ex mode<commit_description>Problem: Using invalid pointer with "V:" in Ex mode.
Solution: Correctly handle the command being c... |
<vulnerable_code> 'scatter_update')
def test_scatter_ops_even_partition(self, op):
v = variables_lib.Variable(array_ops.zeros((30, 1)))
sparse_delta = ops.IndexedSlices(
values=constant_op.constant([[0.], [1.], [2.], [3.], [4.]]),
indices=constant_op.constant([0, 10,... |
<vulnerable_code>
private static final String PROXY_PASSWORD = "proxyPassword";
private final Logger LOGGER = Logger.getLogger(this.getClass().getName());
private Transformer transformer;
protected void executeBusinessLogic() throws ConnectorException {
configureProxy();
final String ... |
<vulnerable_code>
from subprocess import check_output, PIPE, run
from lib389 import DirSrv
from lib389.idm.user import UserAccounts
import pytest
from lib389.tasks import *
from lib389.utils import *
"""Test the failing bind does not return information about the entry
:id: 5cd9b083-eea6-426b-84ca-83c26fc49a6f
... |
<vulnerable_code> case LDAP_AUTH_SIMPLE: {
Slapi_Value cv;
if (slapi_entry_attr_find(e->ep_entry, "userpassword", &attr) != 0) {
slapi_send_ldap_result(pb, LDAP_INAPPROPRIATE_AUTH, NULL,
NULL, 0, NULL);
CACHE_RETURN(&inst->inst_cache, &e);
... |
<vulnerable_code>
ec = dse_get_entry_copy(pdse, sdn, DSE_USE_LOCK);
if (ec == NULL) {
slapi_send_ldap_result(pb, LDAP_NO_SUCH_OBJECT, NULL, NULL, 0, NULL);
return (SLAPI_BIND_FAIL);
}
case LDAP_AUTH_SIMPLE: {
Slapi_Value cv;
if (slapi_entry_attr_find(ec, "userpassword", ... |
<vulnerable_code> msr.host_initiated = false;
svm->next_rip = kvm_rip_read(&svm->vcpu) + 2;
if (svm_set_msr(&svm->vcpu, &msr)) {
trace_kvm_msr_write_ex(ecx, data);
kvm_inject_gp(&svm->vcpu, 0);
} else {<commit_title>[PATCH] KVM: x86: Check non-canonical addresses upon WRMSR<commit_description>Upon WRMSR, the CP... |
<vulnerable_code> msr.data = data;
msr.index = ecx;
msr.host_initiated = false;
if (vmx_set_msr(vcpu, &msr) != 0) {
trace_kvm_msr_write_ex(ecx, data);
kvm_inject_gp(vcpu, 0);
return 1;<commit_title>[PATCH] KVM: x86: Check non-canonical addresses upon WRMSR<commit_description>Upon WRMSR, the CPU should inject #... |
<vulnerable_code> /* +1 for EOS */
memmove(&str[i + 1],
&str[j],
len - shift + 1);
len -= shift;
shift = 0U;
}<commit_title>[PATCH] shell: utils: Fix buffer overrun in shell_spaces_trim<commit_description>The third argument in memmove can possible be greater than remaining
buffer size... |
<vulnerable_code> if (fc == NULL)
return FAIL;
// Shortcut to call a compiled function without overhead.
r = call_def_function(partial->pt_func, argc, argv,
DEF_USE_PT_ARGV, partial, fc, rettv);
remove_funccal();
if (next != NULL)
{
*getnext = TRUE;
return skipwhite(next);
}
... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
551,
/**/<commit_title>[PATCH] patch 9.0.0552: crash when using NUL in buffer that uses<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
552,
... |
<vulnerable_code> ND_PRINT((ndo, "(altcoa: trunc)"));
goto trunc;
}
ND_PRINT((ndo, "(alt-CoA: %s)", ip6addr_string(ndo, &bp[i+2])));
break;
case IP6MOPT_NONCEID:<commit_title>[PATCH] CVE-2017-13025/IPv6 mobility: Add a bounds check before<commit_description><fixed_code>
ND_PRINT((ndo, "(altcoa: tr... |
<vulnerable_code> struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *dst = dctx->buffer;
if (dctx->bytes) {
int n = min(srclen, dctx->bytes);
u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *buf = dctx->buffer;
ghash_flush(ctx, dctx);
memcpy(ds... |
<vulnerable_code> loc: loc
});
}
return obj[name];
},
lookupProperty: function(parent, propertyName) {
let result = parent[propertyName];<commit_title>[PATCH] fix: check prototype property access in strict-mode (#1736)<commit_description><fixed_code>
loc: loc
... |
<vulnerable_code> checkProtoPropertyAccess({ compat: true });
});
function checkProtoPropertyAccess(compileOptions) {
it('should be prohibited by default and log a warning', function() {
var spy = sinon.spy(console, 'error');<commit_title>[PATCH] fix: check prototype property acces... |
<vulnerable_code> msh = tp->tso_props.hdr_len + tp->tso_props.mss;
do {
bytes = split_size;
if (tp->size + bytes > msh)
bytes = msh - tp->size;
tp->size += split_size;
}
if (!(txd_lower & E1000_TXD_CMD_EOP))
return;
if (!(tp->cptse && ... |
<vulnerable_code>__license__ = release.license
__version__ = release.version
version_info = release.version_info
def embed_kernel(module=None, local_ns=None, **kwargs):
"""Embed and start an IPython kernel in a given scope.<commit_title>[PATCH 1/3] FIX CVE-2022-21699<commit_description>See https://github.com/ipy... |
<vulnerable_code> config_file_paths = List(Unicode())
@default('config_file_paths')
def _config_file_paths_default(self):
return [os.getcwd()]
extra_config_file = Unicode(
help="""Path to an extra config file to load.<commit_title>[PATCH 1/3] FIX CVE-2022-21699<commit_description>See https:/... |
<vulnerable_code> profiles = list_profiles_in(os.getcwd())
if profiles:
print()
print("Available profiles in current directory (%s):" % os.getcwd())
self._print_profiles(profiles)
print()
print("To use any of the above profiles, start IPython w... |
<vulnerable_code> is not found, a :class:`ProfileDirError` exception will be raised.
The search path algorithm is:
1. ``os.getcwd()``
2. ``ipython_dir``
Parameters
will be "profile_<profile>".
"""
dirname = u'profile_' + name
paths = [os.getcw... |
<vulnerable_code><commit_title>[PATCH 1/3] FIX CVE-2022-21699<commit_description>See https://github.com/ipython/ipython/security/advisories/GHSA-pq7m-3gw7-gq5x<fixed_code>
"""
Test that CVEs stay fixed.
"""
from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory
from pathlib import Path
import... |
<vulnerable_code> List,
Optional,
Sequence,
Tuple,
Union,
cast,
except Exception:
pass
d__ = cast(
"DictionaryObject",
self._reference_clone(self.__class__(), pdf_dest, force_duplicate),
if ignore_fields is None:
ignore_fiel... |
<vulnerable_code>
keylen = 2 + tsk_getu16(hfs->fs_info.endian, key->key_len);
if (keylen > nodesize - rec_off) {
tsk_error_set_errno(TSK_ERR_FS_GENFS);
tsk_error_set_errstr
("hfs_cat_traverse: length of key %... |
<vulnerable_code> EMSG(_(e_nesting));
return;
}
if (ignore_script)
/* Not reading from script, also don't open one. Warning message? */
return;<commit_title>[PATCH] vim-patch:8.1.1365: source command doesn't check for the<commit_description><fixed_code>
EMSG(_(e_nesting));
return;
}
// ... |
<vulnerable_code> if (*size == PB_SIZE_MAX)
PB_RETURN_ERROR(stream, "too many array entries");
(*size)++;
if (!allocate_field(stream, iter->pData, iter->pos->data_size, *size))
return false;
... |
<vulnerable_code>
size_t avro_buffer_size = in_size * 3;
char *out_buff = flb_malloc(avro_buffer_size);
avro_writer_t awriter;
flb_debug("in flb_msgpack_raw_to_avro_sds\n");<commit_title>[PATCH] Add additional check returned from flb_malloc<commit_description>This PR tries to address the issue raised i... |
<vulnerable_code> }
context.put("tdoc", tdoc2);
try {
tdoc2.readFromTemplate(peform, context);
} catch (XWikiException e) {
if (e.getCode() == XWikiException.ERROR_XWIKI_APP_DOCUMENT_NOT_EMPTY) {
context.put("exception", ... |
<vulnerable_code> String parent) throws XWikiException
{
XWiki xwiki = context.getWiki();
DocumentReferenceResolver<String> resolver = getCurrentMixedDocumentReferenceResolver();
// Set the locale and default locale, considering that we're creating the original version of the documen... |
<vulnerable_code> EditForm editForm = (EditForm) context.getForm();
// Update the edited document based on the template specified on the request.
editedDocument.readFromTemplate(editForm, context);
// The default values from the template can be overwritten by additional request paramete... |
<vulnerable_code> doc2.setDefaultLanguage(context.getWiki().getLanguagePreference(context));
}
try {
doc2.readFromTemplate(peform, context);
} catch (XWikiException e) {
if (e.getCode() == XWikiException.ERROR_XWIKI_APP_DOCUMENT_NOT_EMPT... |
<vulnerable_code> }
try {
tdoc.readFromTemplate(form.getTemplate(), context);
} catch (XWikiException e) {
if (e.getCode() == XWikiException.ERROR_XWIKI_APP_DOCUMENT_NOT_EMPTY) {
context.put("exception", e);
private Job startCreateJob(EntityReference ... |
<vulnerable_code>import java.util.Vector;
import javax.inject.Inject;
import javax.script.ScriptContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import org.xwiki.resource.entity.EntityResourceReference;
import org.xwiki.resource.internal.DefaultResourceReferenceHandlerChain... |
<vulnerable_code>
import javax.inject.Provider;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.model.reference.EntityReference;
import org.xwiki.model.reference.SpaceReference;
import org.xwiki.query.QueryManager;
import org.x... |
<vulnerable_code>
import javax.inject.Named;
import org.apache.commons.lang.time.DateUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.suigeneris.jrcs.rcs.Version;
import org.xwiki.configuration.ConfigurationSource;
import org.xwiki.context.Execution;
import org.xwiki.model.... |
<vulnerable_code>/* $OpenBSD: smtp_session.c,v 1.421 2020/01/08 00:05:38 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
memmove(maddr->user, p, strlen(p) + 1);
}
if (!valid_localpart(maddr->user) ||
!valid_domainpart(maddr->domain)) {
/* accept empty return-path in MAIL FROM, re... |
<vulnerable_code> if not self._is_dir(ftp, list_dir):
return []
artifact_files = ftp.nlst(list_dir)
artifact_files = list(filter(lambda x: x != "." and x != "..", artifact_files))
# Make sure artifact_files is a list of file names because ftp.nlst
... |
<vulnerable_code> assert artifacts[1].file_size is None
def test_list_artifacts_when_ftp_nlst_returns_absolute_paths(ftp_mock):
artifact_root_path = "/experiment_id/run_id/"
repo = FTPArtifactRepository("ftp://test_ftp" + artifact_root_path)<commit_title>[PATCH] Apply `os.path.basename` before `.` or `..` ... |
<vulnerable_code> 'python-keystoneclient==3.17.0',
'python-heatclient==1.6.1',
'python-novaclient==7.1.2',
'paramiko==2.1.5',
'apscheduler==3.5.1',
],
entry_points={<commit_title>[PATCH] Bump paramiko version<commit_description>The server-side vulnerability in Paramiko 2.1... |
<vulnerable_code> /* cmd is a copy instruction; copy from the base. */
size_t off = 0, len = 0;
if (cmd & 0x01) off = *delta++;
if (cmd & 0x02) off |= *delta++ << 8UL;
if (cmd & 0x04) off |= *delta++ << 16UL;
if (cmd & 0x08) off |= ((unsigned) *delta++ << 24UL);
if (cmd & 0x10) len = *delta++;
... |
<vulnerable_code>
cl_git_fail(git_delta_apply(&out, &outlen, base, sizeof(base), delta, sizeof(delta)));
}<commit_title>[PATCH] delta: fix out-of-bounds read of delta<commit_description>When computing the offset and length of the delta base, we repeatedly
increment the `delta` pointer without checking whether we have ... |
<vulnerable_code> struct kvm_lapic_irq irq;
int ret, vector;
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
<commit_title>[PATCH] KVM: x86: Check lapic_in_kernel() before attempting to set a<commit_description><fixed_code>
struct kvm_lapic_irq irq;
int ret, vector;
if (KVM_BUG_ON(!lapic_in_kernel(vcpu), ... |
<vulnerable_code>!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.Macy=n()}(this,function(){"use strict";function t(t,n){var e=void 0;return function(){e&&clearTimeout(e),e=setTimeout(t,n)}}function n(t,n){for(var e=t.length,o=e,r=[... |
<vulnerable_code> duplex: 'half',
method: request.method,
headers: /** @type {Record<string, string>} */ (request.headers),
body: get_raw_body(request, bodySizeLimit)
});
}
<commit_title>[PATCH] fix: ignore bodies sent with non-PUT/PATCH/POST requests<commit_description><fixed_code>
duplex: 'half',
method: ... |
<vulnerable_code> minfo.fport = inc->i_hdr.h_dport;
}
rds_info_copy(iter, &minfo, sizeof(minfo));
}<commit_title>[PATCH] rds: fix an infoleak in rds_inc_info_copy<commit_description>The last field "flags" of object "minfo" is not initialized.
Copying this object out may leak kernel stack data.
Assign 0 to it to avo... |
<vulnerable_code> 'is_url', 'url_to_path', 'path_to_url',
'is_archive_file', 'unpack_vcs_link',
'unpack_file_url', 'is_vcs_url', 'is_file_url',
'unpack_http_url', 'unpack_url']
logger = logging.getLogger(__name__)
write_delete_marker_file(location)
def _download_ht... |
<vulnerable_code>import pip
from pip._internal.download import (
CI_ENVIRONMENT_VARIABLES, MultiDomainBasicAuth, PipSession, SafeFileCache,
unpack_file_url, unpack_http_url, url_to_path,
)
from pip._internal.exceptions import HashMismatch
rmtree(download_dir)
@pytest.mark.parametrize("url,win_expected... |
<vulnerable_code> register u_int i, l;
register const u_char *rp = NULL;
register int compress = 0;
int chars_processed;
int elt;
int data_size = ndo->ndo_snapend - bp;
if ((l = labellen(ndo, cp)) == (u_int)-1)
return(NULL);
if (!ND_TTEST2(*cp, 1))
return(NULL);
chars_processed = 1;
if (((i = *cp++) & IND... |
<vulnerable_code><commit_title>[PATCH] Sanitize HTML to prevent XSS attacks<commit_description><fixed_code>
/*! @license DOMPurify 2.3.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.10/LICENSE */
function _typeof(obj)... |
<vulnerable_code>_WM_ParseNewHmi(uint8_t *hmi_data, uint32_t hmi_size) {
uint32_t hmi_tmp = 0;
uint8_t *hmi_base = hmi_data;
uint16_t hmi_bpm = 0;
uint16_t hmi_division = 0;
// uint32_t hmi_duration_secs = 0;
uint32_t hmi_track_cnt = 0;
uint32_t *hmi_track_offset = NULL;
uint32_t i = 0;
... |
<vulnerable_code>
// goto start of next chunk
hmp_data = hmp_chunk[i] + chunk_length[i];
hmp_chunk[i] += chunk_ofs[i]++;
chunk_end[i] = 0;
}
// Reserved for loop markers
// TODO: still deciding what to do about these
hmp_chu... |
<vulnerable_code>
uint32_t tmp_val;
uint32_t midi_type;
uint32_t track_size;
uint8_t **tracks;
uint32_t end_of_tracks = 0;
uint32_t no_tracks;
uint32_t i;
float sample_count_f = 0.0;
float sample_remainder = 0.0;
uint8_t *sysex_store = NULL;
// uint32_t sysex_store_len = 0;
... |
<vulnerable_code> float tempo_f = 0.0;
uint16_t mus_freq = 0;
float samples_per_tick_f = 0.0;
uint8_t mus_event[] = { 0, 0, 0, 0 };
uint8_t mus_event_size = 0;
uint8_t mus_prev_vol[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint32_t setup_ret = 0;
break;
}... |
<vulnerable_code> setup_ret = 6;
goto _XMI_Next_Event;
}
if ((setup_ret = _WM_SetupMidiEvent(xmi_mdi,xmi_data,0)) == 0) {
goto _xmi_end;
}
<commit_title>[PATCH] Fix ... |
<vulnerable_code> free(mdi);
}
uint32_t _WM_SetupMidiEvent(struct _mdi *mdi, uint8_t * event_data, uint8_t running_event) {
/*
Only add standard MIDI and Sysex events in here.
Non-standard events need to be handled by calling function
uint8_t data_2 = 0;
char *text = NULL;
if (event_data[... |
<vulnerable_code>/*
* Copyright (c) 2018, 2019 O.S.Systems
*
* SPDX-License-Identifier: Apache-2.0
*/
int image_size;
} update_info;
static void wait_fds(void)
{
if (poll(ctx.fds, ctx.nfds, NETWORK_TIMEOUT) < 0) {
static void prepare_fds(void)
{
ctx.fds[ctx.nfds].fd = ctx.sock;
ctx.fds[ctx.nfds].events = 1;
c... |
<vulnerable_code>/*
* Copyright (c) 2018 O.S.Systems
*
* SPDX-License-Identifier: Apache-2.0
*/
bool updatehub_get_device_identity(char *id, int id_max_len)
{
int i, id_len = 0, buf_len = 0;
char buf[3];
u8_t hwinfo_id[id_max_len];
size_t length;<commit_title>[PATCH] lib: updatehub: Fix build warnings<commit_d... |
<vulnerable_code>import userJoin from './userJoin';
import pendingAuthenticationsStore from '../store/pendingAuthentications';
import createDummyUser from '../modifiers/createDummyUser';
import ClientConnections from '/imports/startup/server/ClientConnections';
import upsertValidationState from '/imports/api/auth-toke... |
<vulnerable_code><commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default function updateUserConnectionId(meetingId, userId, connectionId) {
... |
<vulnerable_code> const modifier = {
$set: {
currentConnectionId: connectionId,
},
};
<commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
const modifier = {
$set: {
currentConnectionId: connectionId,
connectionIdUpdateTime: new Date().getTime(),
... |
<vulnerable_code> initAnnotationsStreamListener();
clearTimeout(validationTimeout);
this.connectionID = authenticationTokenValidation.connectionId;
Session.set('userWillAuth', false);
setTimeout(() => resolve(true), 100);
break;<commit_title>[PATCH ... |
<vulnerable_code>import { fontSizeLarge } from '/imports/ui/stylesheets/styled-components/typography';
import { mediumUp } from '/imports/ui/stylesheets/styled-components/breakpoints';
const Option = styled.div`
line-height: 1;
margin-right: 1.65rem;
`;
export default {
Option,
CloseButton,
IconRight,<commi... |
<vulnerable_code> }
}
.MuiPaper-root {
background-color: ${dropdownBg};
border-radius: ${borderRadius};<commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
}
}
.MuiList-padding {
padding: 0 !important;
}
.MuiPaper-root {
background-color: ${dropd... |
<vulnerable_code>import logger from '/imports/startup/client/logger';
import WhiteboardService from '/imports/ui/components/whiteboard/service';
import { Session } from 'meteor/session';
const CHAT_CONFIG = Meteor.settings.public.chat;
const PUBLIC_CHAT_ID = CHAT_CONFIG.public_id;
const link = document.createElement... |
<vulnerable_code>export const capitalizeFirstLetter = (s = '') => s.charAt(0).toUpperCase() + s.slice(1);
export default { capitalizeFirstLetter };<commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
export const capitalizeFirstLetter = (s = '') => s.charAt(0).toUpperCase() + s.slic... |
<vulnerable_code>import styled from 'styled-components';
import {
colorGray,
} from '/imports/ui/stylesheets/styled-components/palette';
const Wrapper = styled.div`
const Iframe = styled.iframe`
border-width: 0;
width: 100%;
`;
export default {<commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_desc... |
<vulnerable_code>import styled, { css, keyframes } from 'styled-components';
import {
systemMessageBorderColor,
mdPaddingX,
borderSize,
listItemBgHover, borderSizeSmall,
colorPrimary,
colorGray,
colorDanger,
colorGrayDark,
userListBg,
colorWhite,
colorGrayLighter,
height: 100%;
`;
const HeaderB... |
<vulnerable_code>import styled from 'styled-components';
import {
colorWhite,
colorGrayDark,
} from '/imports/ui/stylesheets/styled-components/palette';
import {
mdPaddingX,
mdPaddingY,
pollHeaderOffset,
toastContentWidth,
borderSize,
borderSizeLarge,
} from '/imports/ui/stylesheets/styled-components/ge... |
<vulnerable_code>import styled from 'styled-components';
import {
colorWhite,
colorGrayDark,
} from '/imports/ui/stylesheets/styled-components/palette';
import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints';
import Button from '/imports/ui/components/common/button/component';
import {
... |
<vulnerable_code> }
}
.buttonWrapper:hover & {
opacity: .75;
}
`;
margin: 0 ${btnSpacing} 0 0;
}
}
&:hover {
opacity: .5;
}
border: ${borderSizeLarge} solid transparent;
&:focus,
&:focus:not([aria-disabled="true"]) & {
color: ${btnDefaultColor};
background-col... |
<vulnerable_code><commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
import styled from 'styled-components';
import Button from '/imports/ui/components/common/button/component';
import { fontSizeBase } from '/imports/ui/stylesheets/styled-components/typography';
const HideButton = ... |
<vulnerable_code><commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
import styled from 'styled-components';
import Button from '/imports/ui/components/common/button/component';
import { fontSizeBase } from '/imports/ui/stylesheets/styled-components/typography';
import { colorWhite ... |
<vulnerable_code><commit_title>[PATCH 2/8] prevent disconnect in same tab<commit_description><fixed_code>
import styled from 'styled-components';
import { jumboPaddingY } from '/imports/ui/stylesheets/styled-components/general';
const Header = styled.header`
display: flex;
justify-content: space-between;
align-i... |
<vulnerable_code>import {
mdPaddingX,
mdPaddingY,
pollHeaderOffset,
toastContentWidth,
borderSizeLarge,
borderSize,
} from '/imports/ui/stylesheets/styled-components/general';
import {
colorWhite,
colorGrayDark,
} from '/imports/ui/stylesheets/styled-components/palette';
import { smallOnly } from '/impo... |
<vulnerable_code> smPaddingY,
lgPaddingX,
borderRadius,
mdPaddingY,
borderSize,
borderSizeLarge,
pollInputHeight,
pollSmMargin,
pollMdMargin,
pollHeaderOffset,
} from '/imports/ui/stylesheets/styled-components/general';
import {
colorText,
height: 200px !important;
`;
const Header = styled.heade... |
<vulnerable_code> itemFocusBorder,
colorGray,
colorWhite,
colorGrayDark,
colorGrayLightest,
colorOffWhite,
} from '/imports/ui/stylesheets/styled-components/palette';
import {
borderSize,
borderSizeLarge,
mdPaddingX,
mdPaddingY,
pollHeaderOffset,
toastContentWidth,
} from '/imports/ui/stylesheets... |
<vulnerable_code> NPT_FileInfo file_info;
// prevent hackers from accessing files outside of our root
if ((file_path.Find("/..") >= 0) || (file_path.Find("\\..") >= 0) ||
NPT_FAILED(NPT_File::GetInfo(file_path, &file_info))) {
return NPT_ERROR_NO_SUCH_ITEM;
}<commit_title... |
<vulnerable_code> if ((quantum != 0) && (length != 0))
{
if (length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,
"InsufficientImageDataInFile");
if (~length >= 1)
data=(unsigned char *) AcquireQuantumMemo... |
<vulnerable_code>import com.distrimind.upnp_igd.support.model.PortMapping;
import com.distrimind.upnp_igd.support.model.PortMapping.Protocol;
import com.distrimind.upnp_igd.transport.RouterException;
import com.distrimind.upnp_igd.transport.impl.NetworkAddressFactoryImpl;
import com.distrimind.upnp_igd.transport.spi.*;... |
<vulnerable_code> pass
else:
self._permissions = int(member.get("permissions", 0))
if guild:
cache_flag = self._state.member_cache_flags.interaction
self.user = guild._get_and_update_member(member, int(member["user"]["id"... |
<vulnerable_code> bmp_free_dwg (&dwg);
return -3;
}
fh = fopen (bmpfile, "w");
if (!fh)<commit_title>[PATCH] dwgbmp: protect against BMP size overflow<commit_description>do the same dwgbmp checks as in decode.
"Invalid thumbnail data" on overflow.
Fixes Case 2, id 203 of GH #188<fixed_code>
bm... |
<vulnerable_code> )
pod_name_template = Unicode(
'jupyter-{username}{servername}',
config=True,
help="""
Template to use to form the name of user's pods.
`{username}` is expanded to the escaped, dns-label safe username.
This must be unique within the namespace t... |
<vulnerable_code> source, destination, must_not_equal=True
)
try:
shutil.copy2(source_data["fullpath"], destination_data["fullpath"])
except Exception as e:
source, destination
)
# only a display rename? Update that and bail early
if s... |
<vulnerable_code>from watchdog.observers.polling import PollingObserver
from werkzeug.exceptions import HTTPException
import octoprint.util
import octoprint.util.net
from octoprint.server import util
)
}
valid_timelapse = lambda path: not octoprint.util.is_hidden_path(path) and (
... |
<vulnerable_code> if not (is_file or is_folder):
abort(400, description=f"Neither file nor folder, can't {command}")
if command == "copy":
# destination already there? error...
if _verifyFileExists(target, destination) or _verifyFolderExists(
... |
<vulnerable_code> return ret;
}
/**
* efi_capsule_flush - called by file close or file flush
* @file: file pointer
* @id: not used
*
* If a capsule is being partially uploaded then calling this function
* will be treated as upload termination and will free those completed
* buffer pages and -ECANCELED will be r... |
<vulnerable_code> map_dict, # type: ignore
) # type: ignore
_predefined_cmap: Dict[str, str] = {
"/Identity-H": "utf-16-be",<commit_title>[PATCH] default encoding for missing Fonts<commit_description><fixed_code>
map_dict, # type: ignore
) # type: ignore
unknown_char_map = ( "Unknown",... |
<vulnerable_code> cast,
)
from ._cmap import build_char_map
from ._utils import (
CompressedTransformationMatrix,
TransformationMatrixType,
if text != "":
output += text # .translate(cmap)
text = ""
_space_width = cmaps[operands[0]][1]
... |
<vulnerable_code> avio_seek(pb, ape->wavheaderlength, SEEK_CUR);
}
if(ape->totalframes > UINT_MAX / sizeof(APEFrame)){
av_log(s, AV_LOG_ERROR, "Too many frames: %d\n", ape->totalframes);
return -1;<commit_title>[PATCH] Do not attempt to decode APE file with no frames<commit_descripti... |
<vulnerable_code> column.isSortableByUser());
}
}<commit_title>[PATCH] Add test for extending Grid<commit_description><fixed_code>
column.isSortableByUser());
}
@Test
public void extendGridCustomDataCommunicator() {
MyGrid grid = new MyGrid();
}
public c... |
<vulnerable_code> var cursor = obj;
for (var i = 0, j = keys.length; i < j; i++) {
key = keys[i];
if (!TypeUtil.isObject(cursor[key])) {
cursor[key] = {};
}<commit_title>[PATCH] Fixed prototype pollution. #6<commit_description><f... |
<vulnerable_code> f(o, 'e.f.g', 'ok 2');
test.assertEqual(o['e']['f']['g'], 'ok 2');
});
});
describe('length', function() {
var f = obj.length;<commit_title>[PATCH] Fixed prototype pollution. #6<commit_description><fixed_code>
f(o, 'e.f.g', 'ok 2');
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.