text stringlengths 79 3.72M |
|---|
<vulnerable_code>#
from datetime import datetime
def monkeypatch_vobject_performance():
"""
icalendar.tzinfo_eq = new_tzinfo_eq
def monkeypatch_all_at_ready():
monkeypatch_vobject_performance()<commit_title>[PATCH] [SECURITY] Do not allow Pillow to parse EPS files<commit_description><fixed_code>
#
from ... |
<vulnerable_code># <https://www.gnu.org/licenses/>.
#
from arabic_reshaper import ArabicReshaper
from django.utils.functional import SimpleLazyObject
from PIL.Image import Resampling
from reportlab.lib.utils import ImageReader
height = width * self._image.size[1] / self._image.size[0]
self._image.... |
<vulnerable_code>import math
from io import BytesIO
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from PIL import Image, ImageOps, ImageSequence
def create_thumbnail(sourcename, size):
source = default_storage.open(sourcename)
image = Image.open(BytesIO(s... |
<vulnerable_code> attachment = CachedFileField(
label=_("Attachment"),
required=False,
ext_whitelist=(
".png", ".jpg", ".gif", ".jpeg", ".pdf", ".txt", ".docx", ".gif", ".svg",
".pptx", ".ppt", ".doc", ".xlsx", ".xls", ".jfif", ".heic", ".heif", ".pages",
"... |
<vulnerable_code>FILE_UPLOAD_MAX_SIZE_EMAIL_AUTO_ATTACHMENT = 1024 * 1024 * config.getint("pretix_file_upload", "max_size_email_auto_attachment", fallback=1)
FILE_UPLOAD_MAX_SIZE_OTHER = 1024 * 1024 * config.getint("pretix_file_upload", "max_size_other", fallback=10)
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' ... |
<vulnerable_code>import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
i... |
<vulnerable_code>import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.vaadin.flow.server.VaadinRequest;
import com.vaadin.... |
<vulnerable_code><commit_title>[PATCH] fix: Use incremental numeric id as a key for Tree Grid items<commit_description>Using Object::toString as an item's key for server-client communication makes item's data visible on the client side, so generated numeric id is used instead.<fixed_code>
/*
* Copyright 2000-2022 Vaad... |
<vulnerable_code>
static bool parse_reconnect(struct pool *pool, json_t *val)
{
char *sockaddr_url, *stratum_port, *tmp;
char *url, *port, address[256];
if (opt_disable_client_reconnect) {
applog(LOG_WARNING, "Stratum client.reconnect forbidden, aborting.");
return false;
}
memset(address, 0, 255);
url = (c... |
<vulnerable_code>function redirectSelectChange()
{
redirectTypeValue = $('#redirect_type :selected').val();
if (redirectTypeValue == '404' ||
redirectTypeValue == '410' ||
redirectTypeValue == 'default' ||
redirectTypeValue == '200-displayed' ||
redirectTypeValue == '404-displayed' ||
... |
<vulnerable_code> clearop(cap->oap);
else
{
find_pattern_in_path(ptr, 0, len, TRUE,
cap->count0 == 0 ? !isupper(cap->nchar) : FALSE,
((cap->nchar & 0xf) == ('d' & 0xf)) ? FIND_DEFINE : FIND_ANY,
islower(cap->nchar) ? ACTION_SHOW : ACTION_GOTO,
cap->cmdchar == ']' ? curwin->w_cursor.lnum + 1 : (... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5023,
/**/<commit_title>[PATCH] patch 8.2.5024: using freed memory with "]d"<commit_description>Problem: Using freed memory with "]d".
Solution: Copy the pattern before searching.<fixed_code>
static int inclu... |
<vulnerable_code>import org.springframework.web.server.WebSession;
import jakarta.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
if (StringUtils.isBlank(password)) {
MSException.throwException(Translator.get("password_is_null"));
}
UserExample example ... |
<vulnerable_code>import unittest
import unittest.mock
from test.support import requires, swap_attr
import tkinter as tk
from idlelib.idle_test.tkinter_testing_utils import run_in_tk_mainloop
@run_in_tk_mainloop()
def test_very_long_wrapped_line(self):
with swap_attr(self.shell, 'squeezer', None):
... |
<vulnerable_code> if warnings.filters != new_filters:
warnings.filters[:] = new_filters
warnings._filters_mutated()<commit_title>[PATCH] [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large<commit_description><fixed_code>
if warnings.filters != new_filters:
warnings.filters[:] = new... |
<vulnerable_code> self.assertRaises(ValueError, ast.literal_eval, '+True')
self.assertRaises(ValueError, ast.literal_eval, '2+3')
def test_literal_eval_complex(self):
# Issue #4907
self.assertEqual(ast.literal_eval('6j'), 6j)<commit_title>[PATCH] [3.10] gh-95778: CVE-2020-10735: Prev... |
<vulnerable_code>class PyUsabilityTest(UsabilityTest):
decimal = P
class PythonAPItests(unittest.TestCase):
def test_abc(self):
class PyCoverage(Coverage):
decimal = P
class PyFunctionality(unittest.TestCase):
"""Extra functionality in decimal.py"""
<commit_title>[PATCH] [3.10] gh-95778: CVE-2020-107... |
<vulnerable_code>from io import StringIO
from collections import OrderedDict
from test.test_json import PyTest, CTest
class TestDecode:
d = self.json.JSONDecoder()
self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
class TestPyDecode(TestDecode, PyTest): pass
class TestCDecode(TestDecode, CT... |
<vulnerable_code> self.assertIsInstance(sys.executable, str)
self.assertEqual(len(sys.float_info), 11)
self.assertEqual(sys.float_info.radix, 2)
self.assertEqual(len(sys.int_info), 2)
self.assertTrue(sys.int_info.bits_per_digit % 5 == 0)
self.assertTrue(sys.int_info.sizeof... |
<vulnerable_code>#include "pycore_getopt.h" // _PyOS_GetOpt()
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_interp.h" // _PyInterpreterState.runtime
#include "pycore_pathconfig.h" // _Py_path_config
#include "pycore_pyerrors.h" // _PyErr_Fetch()
#include "pycore_pylifecycle.... |
<vulnerable_code>#include "Python.h"
#include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark()
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
#include "pycore_object.h" // _PyObject_IS_GC()
#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0()
#include "pycore_pyerrors.h"... |
<vulnerable_code>
@api.route('/songs/<int:id>/related')
def get_song_relations(id):
top = request.args.get('top')
song = Song.query.filter_by(id=id).first()
if not song:
return route_not_found(song)<commit_title>[PATCH] =?UTF-8?q?fix=20sql=20injection=20vulnerability=20in=20ge?=<commit_description><... |
<vulnerable_code> assert len(res.json) == 1
assert res.json[0]['id'] == self.songs['edm'][1]['id']
<commit_title>[PATCH] =?UTF-8?q?fix=20sql=20injection=20vulnerability=20in=20ge?=<commit_description><fixed_code>
assert len(res.json) == 1
assert res.json[0]['id'] == self.songs['edm'][1]['... |
<vulnerable_code>});
/* POST create user */
router.get('/new', function(req, res, next) {
var conn = mysql.createConnection({
host : "ec2-52-1-159-248.compute-1.amazonaws.com",
user : "root",
password: "root",
port : 3306,
database: "picture_this",
connectTimeout : 30000
});
//O... |
<vulnerable_code> private List<GHPoint> getPointsFromRequest(HttpServletRequest httpServletRequest, String profile) {
String url = httpServletRequest.getRequestURI();
String urlStart = "/navigate/directions/v5/gh/" + profile + "/";
if (url.indexOf(urlStart) != 0) throw new IllegalArgumentExce... |
<vulnerable_code> sheet.values['A1'];
test.fail('Vulnerability works');
} catch (error) {
console.log(error);
test.strictSame(error.constructor.name === 'TypeError', true);
}
<commit_title>[PATCH] fixup! Improve tests for security<commit_description><fixed_code>
sheet.values['A1'];
test.fail(... |
<vulnerable_code> goto error;
}
ret = ca8210_get_platform_data(priv->spi, pdata);
if (ret) {
dev_crit(&spi_device->dev, "ca8210_get_platform_data failed\n");
goto error;
}
priv->spi->dev.platform_data = pdata;
ret = ca8210_dev_com_init(priv);
if (ret) {<commit_title>[PATCH] ieee802154: ca8210: prevent mem... |
<vulnerable_code> // Do not require auth for static paths and the API...this could be a bit brittle
if (req.path.match(/^\/(static|javascripts|pluginfw|api)/)) return cb(true);
if (req.path.indexOf('/admin') != 0) {
if (!settings.requireAuthentication) return cb(true);
if (!settings.requireAutho... |
<vulnerable_code> protected ConsumerCurator consumerCurator;
protected OwnerCurator ownerCurator;
protected DeletedConsumerCurator deletedConsumerCurator;
private Provider<I18n> i18nProvider;
@Inject
ConsumerAuth(ConsumerCurator consumerCurator, OwnerCurator ownerCurator,<commit_title>[PATCH] Di... |
<vulnerable_code> */
package org.candlepin.auth;
import org.candlepin.model.ConsumerCurator;
import org.candlepin.model.DeletedConsumerCurator;
import org.candlepin.model.OwnerCurator;
import com.google.inject.Inject;
// itself.
X509Certificate identityCert = certs[0];
return createPrincipal... |
<vulnerable_code> */
package org.candlepin.auth;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.candlepin.model.Consumer;
import org.candlepi... |
<vulnerable_code> return(DestroyImageList(image));
if ((sun_info.length*sizeof(*sun_data))/sizeof(*sun_data) !=
sun_info.length || !sun_info.length)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
number_pixels=(MagickSizeType) image->columns*image->rows;
if ((sun_info.... |
<vulnerable_code> }
skb_put(skb, MWIFIEX_UPLD_SIZE);
if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
PCI_DMA_FROMDEVICE))
return -1;
card->cmdrsp_buf = skb;
<commit_title>[PATCH] mwifiex: pcie: Fix memory leak in<commit_description><fixed_code>
}
skb_put(skb, MWIFIEX_UPLD_SIZE);
if (mwifiex_... |
<vulnerable_code> GetBitContext gb;
PutBitContext pb;
MPEG4AudioConfig m4ac;
int off;
init_get_bits(&gb, buf, size * 8);
off = avpriv_mpeg4audio_get_config2(&m4ac, buf, size, 1, s);
if (off < 0)
return off;<commit_title>[PATCH] avformat/adtsenc: return value check for init_get_bits i... |
<vulnerable_code> 'plone.directives.form',
'plone.formwidget.masterselect',
'plone.principalsource',
'imio.helpers',
'imio.migrator',
'setuptools',
'z3c.table',
],
extras_require={
'test': [<commit_title>[PATCH] Escaped some column rendering to avoi... |
<vulnerable_code>from collective.task import _
from collective.task import PMF
from collective.task.adapters import EMPTY_STRING
from plone import api
from Products.CMFPlone.utils import normalizeString
from Products.CMFPlone.utils import safe_unicode
class TasksTable(Table):
"""Table that displays tasks info.""... |
<vulnerable_code> <T extends IdentifiableObject> long countAllValuesByAttributes( Class<T> klass, List<Attribute> attributes );
<T extends IdentifiableObject> List<T> getByUid( Class<T> clazz, Collection<String> uids );
<T extends IdentifiableObject> List<T> getAndValidateByUid( Class<T> type, Collecti... |
<vulnerable_code> int resolve_attempts = 10;
int ret = -1;
if (IS_ENABLED(CONFIG_NET_IPV6)) {
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_STREAM;<commit_title>[PATCH] lib: updatehub: Init hints variable<commit_description>The hints variable is used without a defined state. This fill the struct
with zero... |
<vulnerable_code>
Tine.Addressbook.ContactGridPanel.displayNameRenderer = function(data) {
var i18n = Tine.Tinebase.appMgr.get('Addressbook').i18n;
return data ? data : ('<div class="renderer_displayNameRenderer_noName">' + i18n._('No name') + '</div>');
};
Tine.Addressbook.ContactGridPanel.countryRenderer = f... |
<vulnerable_code> allowDrop: false,
expanded: false,
text: Ext.util.Format.htmlEncode(record.get('name')),
qtip: Tine.Tinebase.common.doubleEncode(record.get('host')),
leaf: false,
cls: 'felamimail-nod... |
<vulnerable_code> if(attr.name && typeof attr.name == 'object') {
Ext.apply(attr, {
text: Ext.util.Format.htmlEncode(attr.name.name),
qtip: Tine.Tinebase.common.doubleEncode(attr.name.name)
});
}
// copy 'real' data to a node record... |
<vulnerable_code> this.store.each(function(record) {
var label = (record.data.description == '')
? record.data.macaddress
: Ext.util.Format.ellipsis(record.data.description, 30);
var node = new Ext.tree.TreeNode({
id: record.id,
... |
<vulnerable_code> metadata.css = 'x-tinebase-uploadrow';
}
return fileName;
}
if (! Ext.ux.PercentRendererWithName.template) {
if (typeof value == 'object') {
fileName = value.name;
}
var percent = record.get('progress');
var additionalStyle... |
<vulnerable_code> var recordClass = Tine.Tinebase.data.RecordMgr.get(this.record_model),
app = Tine.Tinebase.appMgr.get(this.app);
if (recordClass) {
Ext.each(recordClass.getFieldDefinitions(), function(field) {
if (field.label) {<commit_title>[PATCH] name might n... |
<vulnerable_code> }
Ext.applyIf(attr, {
text: Ext.util.Format.htmlEncode(attr.name),
qtip: Tine.Tinebase.common.doubleEncode(attr.name),
leaf: !!attr.account_grants,
allowDrop: !!attr.account_grants && attr.account_grants.addGrant
});
... |
<vulnerable_code>
for (var id in this.filterPanels) {
if (this.filterPanels.hasOwnProperty(id) && this.filterPanels[id].isActive) {
filters.push({'condition': 'AND', 'filters': this.filterPanels[id].getValue(), 'id': id, label: this.filterPanels[id].title});
}
... |
<vulnerable_code> this.filterPanel.activeFilterPanel.on('titlechange', this.onFilterPanelTitleChange, this);
this.editor = new Ext.tree.TreeEditor(this);
Tine.widgets.grid.FilterStructureTreePanel.superclass.initComponent.call(this);
},
*/
onNodeTextChange: function... |
<vulnerable_code> Ext.apply(attr, {
isPersistentFilter : isPersistentFilter,
text : Ext.util.Format.htmlEncode(this.app.i18n._hidden(attr.name)),
qtip : Tine.Tinebase.common.doubleEncode(attr.description ? this.app.i18n._hidden(a... |
<vulnerable_code> var el = relations[index];
if (el.type == this.type && el.related_model == this.relModel) {
var record = new this.recordClass(el.related_record);
return record.getTitle();
}
}
}<commit_title>[PATCH] name might not be displa... |
<vulnerable_code> title: String.format(_('Rename {0}'), this.nodeName),
msg: String.format(_('Please enter the new name of the {0}:'), this.nodeName),
buttons: Ext.MessageBox.OKCANCEL,
value: node.attributes.longName || node.text,
fn: functi... |
<vulnerable_code> }, this);
node.longName = node.name;
node.text = node.name = Ext.util.Format.htmlEncode(containerName);
parentNode.push(node);
}, this);<commit_title>[PATCH] name might not be displayed correctly<commit_description>Change-Id: I949c7a80b5356f393d... |
<vulnerable_code>
/* Don't allow faking input to the controlling tty (CVE-2017-5226) */
{SCMP_SYS (ioctl), EPERM, &SCMP_A1 (SCMP_CMP_MASKED_EQ, 0xFFFFFFFFu, (int) TIOCSTI)},
};
struct<commit_title>[PATCH] run: Block clone3() in sandbox<commit_description>clone3() can be used to implement clone() with CLONE... |
<vulnerable_code> env.str("RHSM_KEY"),
)
) as c2r:
c2r.expect_exact(" ... activation key detected: ")
c2r.expect_exact("Organization: ")
c2r.sendline()
assert c2r.expect_exact(["Organization", "Registering the system"]) == 0<commit_title>[PATCH] Edit testing depend... |
<vulnerable_code> image=AcquireImage(image_info);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
return((Image *) NULL);
read_info=CloneImageInfo(image_info);
SetImageInfoBlob(read_info,(void *) NULL,0);
(void) CopyMagickString(read_info->magick,"SVG",MaxTextEx... |
<vulnerable_code> // max ACL size is USHRT_MAX
if (required_size > USHRT_MAX)
return PyErr_Format(PyExc_OverflowError, "%s: adding ACE would put ACL over size limit", __FUNCTION__ );
ZeroMemory(psacl_padded, required_size);
memcpy(psacl_padded, psacl, psacl->AclSize);
... |
<vulnerable_code> }
if (!ret) {
if (return_list && *return_list) {
free(*return_list);
*return_list = nullptr;
}
return_size = 0;<commit_title>[PATCH] ext_mbstring: Fix invalid free() in php_mb_parse_encoding<commit_description>Summary:
A chunk of memory allocated by 'req::calloc_noptrs' was ... |
<vulnerable_code> time_t now;
time_t then;
/* We had better go around this loop exactly twice! */
then = 0;
for (sp = stamp; *sp; sp++) {<commit_title>[PATCH] SECURITY: Fix potential denial of service attack against<commit_description><fixed_code>
time_t now;
time_t then;
if (strlen(stamp) != 2) return... |
<vulnerable_code> })
textarea.dispatchEvent(event)
}<commit_title>[PATCH 1/3] Add a wait function in tests<commit_description><fixed_code>
})
textarea.dispatchEvent(event)
}
function wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
} |
<vulnerable_code> assert.include(textarea.value, 'name | origin\n-- | --\nhubot | github\nbender | futurama')
})
it('retains text around tables', async function () {
const data = {
'text/html': `<commit_title>[PATCH 1/3] Add a wait function in tests<commit_description><fixed_code>
asse... |
<vulnerable_code> goto conn_without_ssl_ok;
}
cmd_error = conn_response(CR_ERR_SSL_EXPECTED);
}
conn_without_ssl_ok:;
#endif<commit_title>[PATCH] fail HELLO command when SSL is required<commit_description><fixed_code>
goto conn_without_ssl_ok;
}
cmd_error = conn_response(CR_ERR_SSL_EXPECTE... |
<vulnerable_code>
struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
{
int err;
struct nfs_client *clp = nfs_alloc_client(cl_init);
if (IS_ERR(clp))
return clp;
init_waitqueue_head(&clp->cl_lock_waitq);
#endif
INIT_LIST_HEAD(&clp->pending_cb_stateids);
return clp;
error:
struct nf... |
<vulnerable_code> if (count != 1)
continue;
length=extent;
profile=BlobToStringInfo((const void *) NULL,length);
if (profile != (StringInfo *) NULL)
{
entry->decoder=(DecodeImageHandler *) ReadPSImage;
entry->encoder=(EncodeImageHandler *) WritePSImage;
entry->ma... |
<vulnerable_code> }
// Check if they try to send a really large message
if ( cbData > k_cbMaxUnreliableMsgSize && !( pSendMessage->m_nFlags & k_nSteamNetworkingSend_Reliable ) )
{
SpewWarningRateLimited( usecNow, "Trying to send a very large (%d bytes) unreliable message. Sending as reliable instead.\n", cbData... |
<vulnerable_code> t = b;
}
n = MIN((size_t) k, l);
l -= n;
p += n;<commit_title>[PATCH] time-util: fix buffer-over-run<commit_description>Fixes #23928.<fixed_code>
t = b;
}
n... |
<vulnerable_code> test_format_timespan_accuracy(1);
test_format_timespan_accuracy(USEC_PER_MSEC);
test_format_timespan_accuracy(USEC_PER_SEC);
}
TEST(verify_timezone) {<commit_title>[PATCH] time-util: fix buffer-over-run<commit_description>Fixes #23928.<fixed_code>
test_format_timespan_a... |
<vulnerable_code>
switch (type) {
case ICMP_REDIRECT:
dccp_do_redirect(skb, sk);
goto out;
case ICMP_SOURCE_QUENCH:
/* Just silently ignore these. */<commit_title>[PATCH] dccp/tcp: fix routing redirect race<commit_description><fixed_code>
switch (type) {
case ICMP_REDIRECT:
if (!sock_owned_by_user(sk))
... |
<vulnerable_code> np = inet6_sk(sk);
if (type == NDISC_REDIRECT) {
struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
if (dst)
dst->ops->redirect(dst, sk, skb);
goto out;
}
<commit_title>[PATCH] dccp/tcp: fix routing redirect race<commit_description><fixed_code>
np = inet6_sk(sk);
if (type == N... |
<vulnerable_code>
switch (type) {
case ICMP_REDIRECT:
do_redirect(icmp_skb, sk);
goto out;
case ICMP_SOURCE_QUENCH:
/* Just silently ignore these. */<commit_title>[PATCH] dccp/tcp: fix routing redirect race<commit_description><fixed_code>
switch (type) {
case ICMP_REDIRECT:
if (!sock_owned_by_user(sk))
... |
<vulnerable_code>from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.http import (
HttpResponse, JsonResponse, Http404, HttpResponseBadRequest)
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django... |
<vulnerable_code> */
#include "updatehub_device.h"
bool updatehub_get_device_identity(char *id, int id_max_len)
{
u8_t hwinfo_id[DEVICE_ID_BIN_MAX_SIZE];<commit_title>[PATCH] lib: updatehub: Fix compile warning<commit_description>Based on the current platform a warning can raise becase of missing
string.h include fil... |
<vulnerable_code>#endif
// delete characters until we are at or before want_vcol
while (vcol > want_vcol
&& (cc = *(ml_get_cursor() - 1), VIM_ISWHITE(cc)))
ins_bs_one(&vcol);
<commit_title>[PATCH] patch 8.2.5162: reading before the start of the line with BS<commit_description><fixed_code>
#endif
... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5161,
/**/<commit_title>[PATCH] patch 8.2.5162: reading before the start of the line with BS<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
... |
<vulnerable_code> image->rows=bounds.y2-bounds.y1;
status=SetImageExtent(image,image->columns,image->rows);
if (status == MagickFalse)
return(DestroyImageList(image));
/*
Write stitches as SVG file.
*/
}
(void) FormatLocaleFile(file,"</svg>\n");
(void) fclose(file);
(void) CloseBlob(image);
i... |
<vulnerable_code>$packages["time"]=(function(){var $pkg={},$init,C,B,E,A,D,AG,BO,BP,BQ,BT,CM,CN,CO,CW,CX,DY,DZ,EA,EC,EE,EF,EG,EH,EI,EL,EQ,EU,O,S,V,W,X,Y,AC,AF,AU,CA,CE,CP,DW,CQ,DX,CR,DB,DL,i,F,H,Q,R,T,U,Z,AA,AB,AD,AE,AH,AI,AJ,AK,AL,AM,AN,AP,AQ,AR,AS,AT,AV,BR,BS,BU,BV,BW,BZ,CB,CC,CD,CF,CG,CH,CI,CJ,CK,CL,CS,CT,CU,CV,CY,C... |
<vulnerable_code>{
BYTE* op = (BYTE*)dst;
const BYTE* const oend = op + dstCapacity;
switch (type) {
case set_rle:
*op = codeTable[0];
CHECK_F(FSE_buildCTable_rle(nextCTable, (BYTE)max));
return 1;
case set_repeat:
memcpy(nextCTable, prevCTable, prevCTableSize);
... |
<vulnerable_code> CHECK(ZSTD_isError(cSize), "ZSTD_compressCCtx failed : %s", ZSTD_getErrorName(cSize));
/* compression failure test : too small dest buffer */
if (cSize > 3) {
const size_t missing = (FUZ_rand(&lseed) % (cSize-2)) + 1; /* no problem, as cSize > 4 (f... |
<vulnerable_code>
source = self.request.form.get("source")
if source:
# Is it valid XML?
try:
root = etree.fromstring(source)
except etree.XMLSyntaxError as e:
return dumps(
{<commit_title>[PATCH] For increased secur... |
<vulnerable_code># recent setuptools versions will *TRANSFORM* something like 'X.Y.Zdev' into 'X.Y.Z.dev0', with a warning like
# UserWarning: Normalizing '2.4.0dev' to '2.4.0.dev0'
# This causes problems further up the dependency chain...
VERSION = LooseVersion('4.1.2')
UNKNOWN = 'UNKNOWN'
<commit_title>[PATCH] bum... |
<vulnerable_code> clear_buffer_mapped(bh);
clear_buffer_req(bh);
clear_buffer_new(bh);
bh->b_bdev = NULL;
return may_free;
}<commit_title>[PATCH] jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer<commit_description>journal_unmap_buffer()'s zap_buffer: code clears a lot of buffer head
state ala discard_buf... |
<vulnerable_code> for (i = 0; i < g_strv_length (mimetypes); i++) {
if (strcmp(mimeFromFile, mimetypes[i]) == 0)
return TRUE;
}
/* fallback for malformed epub files */
if (strcmp (mimeFromFile, "application/zip") == 0)
}
static gboolean
extract_one_file(EpubDocument*... |
<vulnerable_code>import json
import yaml
from urllib.request import urlopen
from yaml import Loader, SafeLoader
import csv
from csv import register_dialect, Dialect, QUOTE_MINIMAL
def construct_yaml_str(self, node):
return self.construct_scalar(node)
Loader.add_constructor(u'tag:yaml.org,2002:str', construct_yaml... |
<vulnerable_code>
from __future__ import division, absolute_import, unicode_literals
from owlmixin import util
class TestReplaceKeys:
def test_need_not_snake(self):
assert util.to_snake("<file_list>") == "file_list"
assert util.to_snake("-o") == "o"
assert util.to_snake("--detail-option")... |
<vulnerable_code>from vyper.old_codegen.lll_node import LLLnode
from vyper.old_codegen.parser_utils import check_single_exit, getpos
from vyper.old_codegen.types import (
ByteArrayLike,
TupleType,
canonicalize_type,
super(ContractRecord, self).__init__(*args)
# Function signature object
class Func... |
<vulnerable_code>
from vyper.ast.signatures.function_signature import FunctionSignature
# Generate default argument function signatures.
def generate_default_arg_sigs(code, interfaces, global_ctx):
# generate all sigs, and attach.
total_default_args = len(code.args.defaults)<commit_title>[PATCH] wip external ... |
<vulnerable_code>
frame_size = context.memory_allocator.size_of_mem
o.context = context
o.total_gas = o.gas + calc_mem_gas(frame_size)
o.func_name = sig.name
return o, allocate_start, frame_size<commit_title>[PATCH] wip external functions rewrite<commit_description><fixed_code>
frame_size = co... |
<vulnerable_code>from vyper.old_codegen.types.types import ByteArrayLike, get_size_of_type
from vyper.utils import MemoryPositions
def generate_lll_for_external_function(
code: vy_ast.FunctionDef, sig: FunctionSignature, context: Context, check_nonpayable: bool,
) -> LLLnode:
func_type = code._metadata["type"... |
<vulnerable_code>from vyper.old_codegen.lll_node import LLLnode
def get_sig_statements(sig, pos):
method_id_node = LLLnode.from_list(sig.method_id, pos=pos, annotation=f"{sig.sig}")
<commit_title>[PATCH] wip external functions rewrite<commit_description><fixed_code>
from vyper.old_codegen.lll_node import LLLnode
... |
<vulnerable_code>
* For functions without default arguments the dict contains one item.
* For functions with default arguments, there is one key for each
function signfature.
"""
arg_types = [i.canonical_type for i in self.arguments.values()]
<commit_title>[PATCH] wip external ... |
<vulnerable_code>import org.acumos.designstudio.ce.service.IAcumosCatalog;
import org.acumos.designstudio.ce.util.EELFLoggerDelegator;
import org.acumos.designstudio.ce.util.Properties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import o... |
<vulnerable_code>import org.acumos.designstudio.ce.util.DSUtil;
import org.acumos.designstudio.ce.util.EELFLoggerDelegator;
import org.acumos.designstudio.ce.util.Properties;
import org.acumos.designstudio.ce.vo.DSCompositeSolution;
import org.acumos.designstudio.ce.vo.SuccessErrorMessage;
import org.acumos.designstudi... |
<vulnerable_code><commit_title>[PATCH] Senitization for CSS Vulnerability<commit_description>Issue-Id : ACUMOS-1650
Description : Senitization for CSS Vulnerability - Design Studio
Change-Id: If8fd4b9b06f884219d93881f7922421870de8e3d
Signed-off-by: Ramanaiah Pirla <RP00490596@techmahindra.com><fixed_code>
/*-
* =====... |
<vulnerable_code> bot.write(['MODE', trigger.sender, mode, parse_host_mask(trigger.group().split())])
elif trigger.account in chanops and selfsafe:
bot.write(['MODE', trigger.sender, mode])
else:
bot.reply('Access Denied. If in error, please contact the channel founder... |
<vulnerable_code>#define UNSUPPORTED 0
#define SUPPORTED 1
typedef struct rz_debug_gdb_ctx_t {
RzIOGdb **origrziogdb;
libgdbr_t *desc;
int unk = 0, perm, i;
char *ptr, *pos_1;
size_t line_len;
char name[1024], region1[100], region2[100], perms[5];
RzDebugMap *map = NULL;
region1[0] = region2[0] = '0';
regio... |
<vulnerable_code>#include <rz_io.h>
#include <rz_debug.h>
static int __io_step(RzDebug *dbg) {
free(dbg->iob.system(dbg->iob.io, "ds"));
return true;
}
char *ostr = str;
ut64 map_start, map_end;
char perm[32];
char name[512];
for (;;) {
char *nl = strchr(str, '\n');
if (nl) {
if (_s_) {
memmove(_s_,... |
<vulnerable_code>#include <rz_lib.h>
#include <string.h>
static void rz_reg_profile_def_free(RzRegProfileDef *def) {
if (!def) {
return;
return NULL;
}
char *ptr1, *gptr, *gptr1;
char name[16], groups[128], type[16];
const int all = 1, gpr = 2, save = 4, restore = 8, float_ = 16,
sse = 32, vector = 64, sy... |
<vulnerable_code>
ecma_value_t *buffer_p = collection_p->buffer_p;
ecma_object_t *object_p = ecma_get_object_from_value (stack_top_p[-4]);
uint32_t index = stack_top_p[-3];
while (index < collection_p->item_count)
{
ecma_string_t *prop_name_p = ecma_get_pro... |
<vulnerable_code><commit_title>[PATCH] Fix for-in collection cleanup on abrupt 'has' result<commit_description>This patch fixes #4747
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>from PyPDF2._utils import (
mark_location,
matrix_multiply,
read_block_backwards,
read_previous_line,
read_until_regex,
read_until_whitespace,
skip_over_comment,<commit_title>[PATCH 1/2] Minor flake8 fix<commit_description><fixed_code>
from PyPDF2._utils import (
mark_lo... |
<vulnerable_code>def build_char_map(
font_name: str, space_width: float, obj: DictionaryObject
) -> Tuple[
str, float, Dict[int, str], Dict
]: # font_type,space_width /2, encoding, cmap
ft: DictionaryObject = obj["/Resources"]["/Font"][font_name] # type: ignore
font_type: str = cast(str, ft["/Subtype"... |
<vulnerable_code>
text: str = ""
output: str = ""
cmaps: Dict[str, Tuple[str, float, Dict[int, str], Dict[str, str]]] = {}
resources_dict = cast(DictionaryObject, obj["/Resources"])
if "/Font" in resources_dict:
for f in cast(DictionaryObject, resources_dict["/Font"])... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.