text stringlengths 79 3.72M |
|---|
<vulnerable_code> /* We could confirm data sizes but a malcious MDMP will always get around
** this! But we can ensure that the data is not outside of the file */
if (entry->location.rva + entry->location.data_size > obj->b->length) {
eprintf("[ERROR] Size Mismatch - Stream data is larger than file size!\n");
ret... |
<vulnerable_code>import java.lang.annotation.Target;
import java.util.function.Function;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.extension.ConditionEvaluationResult;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.... |
<vulnerable_code> directory in question exists on the Referrer server.
"""
os.mkdir(os.path.join(self.tempdir, 'existing_directory'))
attack_url = f'//python.org/..%2f..%2f..%2f..%2f..%2f../%0a%0d/../{self.tempdir_name}/existing_directory'
response = self.request(attack_url)
... |
<vulnerable_code> number_planes,
number_planes_filled,
one,
offset,
pixel_info_length;
ssize_t
count,
y;
unsigned char
offset=((image->rows-y-1)*image->columns*number_planes)+x*
number_planes+plane;
operand++;
if (offset+((size_t) operand*number... |
<vulnerable_code>
for (i=(int) first_object; i <= (int) last_object; i++)
{
if (mng_info->exists[i] && !mng_info->frozen[i])
{
MngBox<commit_title>[PATCH] Skip MNG CLIP chunk with out-of-range object IDs<commit_description><fixe... |
<vulnerable_code> @Beta
@Deprecated
public static File createTempDir() {
File baseDir = new File(System.getProperty("java.io.tmpdir"));
@SuppressWarnings("GoodTime") // reading system time without TimeSource
String baseName = System.currentTimeMillis() + "-";
for (int counter = 0; counter < TEMP_D... |
<vulnerable_code> async installPlugin(ctx) {
try {
const { plugin } = ctx.request.body;
strapi.reload.isWatching = false;
strapi.log.info(`Installing ${plugin}...`);
async uninstallPlugin(ctx) {
try {
const { plugin } = ctx.params;
strapi.reload.isWatching = false;
strap... |
<vulnerable_code>def escape_link(url):
"""Remove dangerous URL schemes like javascript: and escape afterwards."""
lower_url = url.lower().strip('\x00\x1a \n\r\t')
for scheme in _scheme_blacklist:
if lower_url.startswith(scheme):
return ''
return escape(url, quote=True, smart_amp=Fals... |
<vulnerable_code><commit_title>[PATCH] Fix bypassing XSS vulnerability.<commit_description>Bypasing with newline.
Old:
>>> markdown('''[aa](java
... script:alert`1`;)''')
'<p><a href="java\nscript:alert`1`;">aa</a></p>\n'
New:
>>> markdown('''[aa](java
... script:alert`1`;)''')
'<p><a href="">aa</a></p>\n'
Bypassing... |
<vulnerable_code> ('javascript:alert`1`', ''),
# bypass attempt
('jAvAsCrIpT:alert`1`', ''),
# javascript pseudo protocol with entities
('javascript:alert`1`', 'javascript&colon;alert`1`'),
# javascript pseudo protocol with prefix (dangerous in Chrome)<commit_tit... |
<vulnerable_code> (curwin, curwin->w_topline, FALSE);
int skip_lines = 0;
int width1 = curwin->w_width - curwin_col_off();
int width2 = width1 + curwin_col_off2();
// similar formula is used in curs_columns()
if (curwin->w_skipcol > width1)
skip_lines += (curwin->w_skipcol - width1) / wid... |
<vulnerable_code>
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import random_seed
from tensorflow.python.framework import test_util
self.assertEqual(0, math_ops.reduce_sum(math_ops.cast(
math_ops.less_... |
<vulnerable_code>
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.kernel_tests.random import util
sample = random_ops.random_poisson(shape=[2], lam=... |
<vulnerable_code>
#include "regint.h"
static void
conv_ext0be32(const UChar* s, const UChar* end, UChar* conv)
{
return ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION;
}
extern int
onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;
if... |
<vulnerable_code>} from "discourse/plugins/discourse-chat/discourse/components/chat-to-topic-selector";
import { CHANNEL_STATUSES } from "discourse/plugins/discourse-chat/discourse/models/chat-channel";
import { htmlSafe } from "@ember/template";
import { escapeExpression } from "discourse/lib/utilities";
export defau... |
<vulnerable_code>import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseLater from "discourse-common/lib/later";
import { htmlSafe } from "@ember/template";
import { escapeExpression } from "discourse/lib/utilities";
export default Component.extend({
chat: service(),
if (
isEmpty(chann... |
<vulnerable_code>import { inject as service } from "@ember/service";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { htmlSafe } from "@ember/template";
import { escapeExpression } from "discourse/lib/utilities";
export default class MoveToChannelModalInner extends Component {
@service chat;
get... |
<vulnerable_code> }
get title() {
return escapeExpression(this.channel.title);
}
get text() {
}
get title() {
return escapeExpression(this.channel.title);
}
get oneOnOneMessage() {<co... |
<vulnerable_code>import User from "discourse/models/user";
import UserChatChannelMembership from "discourse/plugins/discourse-chat/discourse/models/user-chat-channel-membership";
import { ajax } from "discourse/lib/ajax";
export const CHATABLE_TYPES = {
directMessageChannel: "DirectMessageChannel",
isDraft = false... |
<vulnerable_code> env = jinja2.Environment(loader=loader, autoescape=autoescape)
# Update the environment with our custom filters
env.filters.update(
{
"format_ts": _format_ts_filter,
"mxc_to_http": _create_mxc_to_http_filter(self.public_baseurl),
... |
<vulnerable_code> uint8_t options[];
} _packed_ DHCP6PDPrefixOption;
#define DHCP6_OPTION_IA_NA_LEN (sizeof(struct ia_na))
#define DHCP6_OPTION_IA_PD_LEN (sizeof(struct ia_pd))
#define DHCP6_OPTION_IA_TA_LEN (sizeof(struct ia_ta))
static int option_append_hdr(... |
<vulnerable_code> return(DestroyImageList(image));
(void) SetImageProperty(image,"caption",caption);
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
width=(size_t) floor(draw_info->pointsize*strlen(caption)+0.5);
if (AcquireMagickResource(WidthResource,width) == MagickFalse)
{
caption=Destro... |
<vulnerable_code> return(DestroyImageList(image));
(void) SetImageProperty(image,"label",label);
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
width=(size_t) floor(0.5*draw_info->pointsize*strlen(label)+0.5);
if (AcquireMagickResource(WidthResource,width) == MagickFalse)
{
label=DestroyStr... |
<vulnerable_code> image->x_resolution,image->y_resolution);
if (image_info->ping != MagickFalse)
(void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0");
page.width=(size_t) floor((double) page.width*image->x_resolution/delta.x+
0.5);
page.height=(size_t) floor((double) page.height*image->y_resol... |
<vulnerable_code> (void) ParseMetaGeometry(page_geometry,&geometry.x,&geometry.y,
&geometry.width,&geometry.height);
scale.x=(double) (geometry.width*delta.x)/resolution.x;
geometry.width=(size_t) floor(scale.x+0.5);
scale.y=(double) (geometry.height*delta.y)/resolution.y;
geometry.height=(size... |
<vulnerable_code> (void) ParseMetaGeometry(page_geometry,&geometry.x,&geometry.y,
&geometry.width,&geometry.height);
scale.x=PerceptibleReciprocal(resolution.x)*geometry.width*delta.x;
geometry.width=(size_t) floor(scale.x+0.5);
scale.y=PerceptibleReciprocal(resolution.y)*geometry.height*delta.y;
... |
<vulnerable_code> (void) CloneString(&annotate->text,textlist[i]);
if ((metrics.width == 0) || (annotate->gravity != NorthWestGravity))
(void) GetTypeMetrics(image,annotate,&metrics);
height=(size_t) floor(metrics.ascent-metrics.descent+0.5);
if (height == 0)
height=draw_info->pointsize;
... |
<vulnerable_code> (void) GetNextToken(q,&q,extent,token);
if (*token == ',')
(void) GetNextToken(q,&q,extent,token);
bounds.width=(size_t) floor(GetDrawValue(token,&next_token)+
0.5);
if (token == next_token)
... |
<vulnerable_code> scale.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
scale.y=scale.x;
*width=(size_t) floor(scale.x*former_width/100.0+0.5);
*height=(size_t) floor(scale.y*former_height/100.0+0.5);
former_width=(*width);
former_height=(*height);
}<commit_title>[PA... |
<vulnerable_code> }
geometry.x=CastDoubleToLong(ceil(min.x-0.5));
geometry.y=CastDoubleToLong(ceil(min.y-0.5));
geometry.width=(size_t) floor(max.x-min.x+0.5);
geometry.height=(size_t) floor(max.y-min.y+0.5);
page=(*image)->page;
(void) ParseAbsoluteGeometry("0x0+0+0",&(*image)->page);
crop_image=CropIma... |
<vulnerable_code> (void) SetImageColorspace(clone_image,sRGBColorspace);
(void) SetImageVirtualPixelMethod(clone_image,EdgeVirtualPixelMethod);
clone_image->compose=OverCompositeOp;
border_info.width=(size_t) floor(2.0*sigma+0.5);
border_info.height=(size_t) floor(2.0*sigma+0.5);
border_info.x=0;
border_... |
<vulnerable_code>!function(t){var i=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;jQuery.htmlPrefilter=function(t){return t.replace(i,"<$1></$2>")},t.extend(Craft,{navHeight:48,index:function(e,i){if(!t.isArray(e))throw"The first argument passed to Craft.index() must be a... |
<vulnerable_code> },
promptForTabName: function(oldName) {
return prompt(Craft.t('app', 'Give your tab a name.'), oldName);
},
removeTab: function($tab) {<commit_title>[PATCH] Fixed an XSS vulnerability<commit_description><fixed_code>
},
promptForTabName: function(oldName) {
re... |
<vulnerable_code>
#@+others
#@+node:ekr.20161123121021.1: *3* dart_i.clean_headline
dart_pattern = re.compile(r'^\s*([\w_]+\s*)+\(')
def clean_headline(self, s, p=None):
<commit_title>[PATCH] Fixed #1597<commit_description><fixed_code>
#@+others
#@+node:ekr.20161123121021.1: *3* dart_i.clean_h... |
<vulnerable_code> isInvalidPayload("1/admin,{}");
isInvalidPayload('2/admin,"invalid');
isInvalidPayload("2/admin,{}");
expect(() => new Decoder().add("999")).to.throwException(
/^unknown packet type 9$/<commit_title>[PATCH] fix: check the format of the event name<commit_description>A packet like ... |
<vulnerable_code>from gluon.admin import *
from gluon.fileutils import abspath, read_file, write_file
from gluon.utils import web2py_uuid
from gluon.tools import Config
from gluon.compileapp import find_exposed_functions
from glob import glob
from gluon._compat import iteritems, PY2, pickle, xrange, urlopen, to_bytes, ... |
<vulnerable_code> {BGP_ATTR_AS_PATHLIMIT, "AS_PATHLIMIT"},
{BGP_ATTR_PMSI_TUNNEL, "PMSI_TUNNEL_ATTRIBUTE"},
{BGP_ATTR_ENCAP, "ENCAP"},
#if ENABLE_BGP_VNC
{BGP_ATTR_VNC, "VNC"},
#endif
{BGP_ATTR_LARGE_COMMUNITIES, "LARGE_COMMUNITY"},
case BGP_ATTR_EXT_COMMUNITIES:
ret = bgp_attr_ext_communities(&attr_args);
... |
<vulnerable_code> _cleanup_free_ char *t = NULL;
if (!isempty(e)) {
if (!utf8_is_valid(e))
log_unit_warning(u, "Status message in notification message is not UTF-8 clean.");
else {
... |
<vulnerable_code>
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
un->sun_family = AF_UNIX;
strcpy(un->sun_path, uri->path);
resolved_addr->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1;
return 1;<commit_titl... |
<vulnerable_code> arg.type = GRPC_ARG_STRING;
arg.key = GRPC_ARG_SERVER_URI;
arg.value.string = grpc_resolver_factory_add_default_prefix_if_needed(target);
grpc_channel_args *new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
gpr_free(arg.value.string);
grpc_channel *channel = grpc_channel_create(exec... |
<vulnerable_code> rootjQuery,
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,<commit_title>[PATCH] Prioritize #id over <tag> to avoid XSS v... |
<vulnerable_code> document.body.removeChild( iframe );
});
if ( !isLocal ) {
test("isXMLDoc - XML", function() {
expect(3);<commit_title>[PATCH] Prioritize #id over <tag> to avoid XSS via location.hash<commit_description><fixed_code>
document.body.removeChild( iframe );
});
test("XSS via location.hash", function() ... |
<vulnerable_code> return null;
}
$(function () {
"use strict";
}
);
$('.rules-box').each(function (i, v) {
var box = $(v);
var groupId = box.data('group');<commit_title>[PATCH] Catch CSRF issues<commit_description><fixed_code>
return null;
}
function moveRuleGr... |
<vulnerable_code> spos = a->start.pos;
epos = a->end.pos;
}
if (a->start.line != a->end.line || spos > epos)
epos = spos;
pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col,
rows > 1,<commit_title>[PATCH] Prevent segfault for formUpdateBuffer<commit_description>Bug-Debian: https:... |
<vulnerable_code>
#define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_VCCL)
/* Active Lua function (given call info) */
#define ci_func(ci) (clLvalue(s2v((ci)->func)))
static const char *funcnamefromcode (lua_State *L, CallInfo *ci,
const char **name);
/*
** This function ... |
<vulnerable_code> ptrdiff_t oldtop = savestack(L, L->top); /* hook may change top */
int delta = 0;
if (isLuacode(ci)) {
Proto *p = clLvalue(s2v(ci->func))->p;
if (p->is_vararg)
delta = ci->u.l.nextraargs + p->numparams + 1;
if (L->top < ci->top)
luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres... |
<vulnerable_code> L->openupval = NULL;
L->status = LUA_OK;
L->errfunc = 0;
}
<commit_title>[PATCH] Fixed bug: invalid 'oldpc' when returning to a function<commit_description>The field 'L->oldpc' is not always updated when control returns to a
function; an invalid value can seg. fault when computing 'changedline'.... |
<vulnerable_code> ProtectNT(luaT_adjustvarargs(L, GETARG_A(i), ci, cl->p));
if (trap) {
luaD_hookcall(L, ci);
L->oldpc = pc + 1; /* next opcode will be seen as a "new" line */
}
updatebase(ci); /* function has new base after adjustment */
vmbreak;<commit_titl... |
<vulnerable_code> << "modtime:" << record._modtime << "type:" << record._type << "etag:" << record._etag
<< "fileId:" << record._fileId << "remotePerm:" << record._remotePerm.toString()
<< "fileSize:" << record._fileSize << "checksum:" << record._checksumHeader
... |
<vulnerable_code> if (acc->capabilities().clientSideEncryptionAvailable()) {
// Verify if the folder is empty before attempting to encrypt.
const auto isEncrypted = info->_isEncrypted;
const auto isParentEncrypted = _model->isAnyAncestorEncrypted(index);
if (!isEncrypted && !isParen... |
<vulnerable_code>
_numericFileId = fileRecord.numericFileId();
_isEncryptedItem = fileRecord._isE2eEncrypted;
_isSecureFileDropSupportedFolder =
fileRecord._isE2eEncrypted && fileRecord.e2eMangledName().isEmpty() && _accountState->account()->secureFileDropSupported();
// Will get added when sh... |
<vulnerable_code> QStringList e2eFoldersToBlacklist;
const auto couldGetFiles = _journal.getFilesBelowPath("", [this, &e2eFoldersToBlacklist, &folderRootDir](const SyncJournalFileRecord &rec) {
// We only want to add the root-most encrypted folder to the blacklist
if (rec.isValid() && rec._isE2eE... |
<vulnerable_code> case Qt::DisplayRole: {
//: Example text: "File.txt (23KB)"
const auto &xParent = static_cast<SubFolderInfo *>(index.internalPointer());
const auto suffix = (subfolderInfo._isNonDecryptable && subfolderInfo._checked && (!xParent || !xParent->_isEncrypted))
... |
<vulnerable_code> bool anyAncestorEncrypted = false;
auto ancestor = fileData.parentFolder();
while (ancestor.journalRecord().isValid()) {
if (ancestor.journalRecord()._isE2eEncrypted) {
anyAncestorEncrypted = true;
break;
}
FileData fileData = FileData::get(ar... |
<vulnerable_code> if (!folder->journalDb()->getFileRecord(fileName.mid(1), &rec)) {
qCWarning(lcActivity) << "could not get file from local DB" << fileName.mid(1);
}
if (rec.isValid() && (rec._isE2eEncrypted || !rec._e2eMangledName.isEmpty())) {
... |
<vulnerable_code> if (handleExcluded(path._target, e, isHidden))
continue;
const auto isEncryptedFolderButE2eIsNotSetup = e.serverEntry.isValid() && e.serverEntry.isE2eEncrypted &&
_discoveryData->_account->e2e() && !_discoveryData->_account->e2e()->_publicKey.isNull() && _discov... |
<vulnerable_code> result.sharedByMe = true;
}
} else if (property == "is-encrypted" && value == QStringLiteral("1")) {
result.isE2eEncrypted = true;
} else if (property == "lock") {
result.locked = (value == QStringLiteral("1") ? SyncFileItem::LockStatu... |
<vulnerable_code> qCWarning(lcPropagator) << "could not get file from local DB" << pathCompontentsJointed;
}
if (rec.isValid() && rec._isE2eEncrypted) {
return true;
}
pathComponents.removeLast();
if (!accountPtr->capabilities().clientSideEncryptionAvaila... |
<vulnerable_code> const auto account = propagator()->account();
if (!account->capabilities().clientSideEncryptionAvailable() ||
!parentRec.isValid() ||
!parentRec._isE2eEncrypted) {
startAfterIsEncryptedIsChecked();
} else {
_downloadEncryptedHelper = new PropagateDownloadEncr... |
<vulnerable_code> if (propagator()->_abortRequested)
return;
if (!_item->_encryptedFileName.isEmpty() || _item->_isEncrypted) {
if (!_item->_encryptedFileName.isEmpty()) {
_deleteEncryptedHelper = new PropagateRemoteDeleteEncrypted(propagator(), _item, this);
} else {<commit_... |
<vulnerable_code>
void PropagateRemoteDeleteEncryptedRootFolder::start()
{
Q_ASSERT(_item->_isEncrypted);
const bool listFilesResult = _propagator->_journal->listFilesInPath(_item->_file.toUtf8(), [this](const OCC::SyncJournalFileRecord &record) {
_nestedItems[record._e2eMangledName] = record;<commit_t... |
<vulnerable_code> _item->_isShared = _item->_remotePerm.hasPermission(RemotePermissions::IsShared) || _item->_sharedByMe;
_item->_lastShareStateFetchedTimestamp = QDateTime::currentMSecsSinceEpoch();
if (!_uploadEncryptedHelper && !_item->_isEncrypted) {
success();
} else {
... |
<vulnerable_code>
if (!account->capabilities().clientSideEncryptionAvailable() ||
!parentRec.isValid() ||
!parentRec._isE2eEncrypted) {
setupUnencryptedFile();
return;
}<commit_title>[PATCH] use a getter to query encryption status<commit_description>Signed-off-by: Matthieu Gallie... |
<vulnerable_code> rec._serverHasIgnoredFiles = _serverHasIgnoredFiles;
rec._checksumHeader = _checksumHeader;
rec._e2eMangledName = _encryptedFileName.toUtf8();
rec._isE2eEncrypted = _isEncrypted;
rec._lockstate._locked = _locked == LockStatus::LockedItem;
rec._lockstate._lockOwnerDisplayName = _... |
<vulnerable_code>
SyncJournalFileRecord updatedRec;
QVERIFY(folder->journalDb()->getFileRecord(QStringLiteral("encrypted"), &updatedRec));
QVERIFY(updatedRec._isE2eEncrypted);
QVERIFY(updatedRec.isDirectory());
FolderMan::instance()->removeE2eFiles(account);<commit_title>[PATCH]... |
<vulnerable_code> canClose;
// Merge user and default options.
this.options = /** @type {{ canClose: boolean, title: string,
titleIcon: string, closeCleanVueInstances: Array }} */
(this.mergeOptions(internalOptions));
$.pkp.controllers.modal.ModalHandler.prototype.modalBuild =
function() {
var $... |
<vulnerable_code><commit_title>[PATCH] Regression test for<commit_description><fixed_code>
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class Jp2ImageEncodeJp2HeaderOutOfBoundsRead(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/securit... |
<vulnerable_code> high,
low;
/*
Auto fit text into bounding box.
*/
for ( ; ; draw_info->pointsize*=2.0)
{
text=AcquireString(caption);
i=FormatMagickCaption(image,draw_info,split,&metrics,&text);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMa... |
<vulnerable_code>const deleteVariablesByNames = (sortStr, variables) =>
R.filter(c => R.indexOf(c.variable, variables) !== -1)(sortStr)
module.exports = {
keys,
serialize,<commit_title>[PATCH] Renamed toString -> toPreparedStatement in sqiUtils<commit_description><fixed_code>
const deleteVariablesByNames = (sor... |
<vulnerable_code>
const binaryToString = (node, paramsArr) => {
const { operator, left, right, right: { type: rightType, value: rightValue } } = node
const { clause: clauseLeft, paramsArr: paramsArrLeft } = toString(left, paramsArr)
if (operator === '===' && rightType === types.Literal && rightValue === null) {
... |
<vulnerable_code> LDAP_SEARCH(pol_dn, LDAP_SCOPE_BASE, "(objectclass=krbPwdPolicy)", password_policy_attributes);
ent=ldap_first_entry(ld, result);
if (ent != NULL) {
if ((st = populate_policy(context, ld, ent, pol_name, *policy)) != 0)
goto cleanup;
}
cleanup:
ldap_msgfree(resu... |
<vulnerable_code> if (decompressed.isReadable()) {
out.add(decompressed);
} else {
finished = true;
in.skipBytes(in.readableBytes());
decompressed.release();
}
}
z.next_... |
<vulnerable_code> if (decompressed.isReadable()) {
out.add(decompressed);
} else {
finished = true;
in.skipBytes(in.readableBytes());
decompressed.release();
}
}
}
@Override
protected void handlerRemo... |
<vulnerable_code> // we throw the exception only if the buffer could not be expanded at all
// this means that one final attempt to deserialize will always be made with the buffer at maxAllocation
if (buffer.ensureWritable(preferredSize, true) == 1) {
decompressionBufferExhausted(buff... |
<vulnerable_code> @Test
public void testMaxAllocation() throws Exception {
int maxAllocation = 1024;
ZlibDecoder decoder = createDecoder(ZlibWrapper.NONE, maxAllocation);
EmbeddedChannel chDecoder = new EmbeddedChannel(decoder);
TestByteBufAllocator alloc = new TestByteBufAllocato... |
<vulnerable_code> with self.assertRaises(errors.OutOfRangeError):
sess.run(get_next)
@combinations.generate(combinations.combine(tf_api_version=2, mode=["eager"]))
def testFromSparseTensorSlicesError(self):
with self.assertRaises(AttributeError):<commit_title>[PATCH] Prevent nullptr deref in Spars... |
<vulnerable_code> struct stun_attr *data, *peer;
struct allocation *al;
struct perm *perm;
int err;
(void)sock;
(void)ctx;
if (!peer || !data)
return true;
perm = perm_find(al->perms, &peer->v.xor_peer_addr);
if (!perm) {
++al->dropc_tx;
return true;
}
err = udp_send(al->rel_us, &peer->v.xor_peer_addr... |
<vulnerable_code> if parent_manifest_data:
for mlist in parent_manifest_data.get('manifests', []):
imageos = mlist.get('platform', {}).get('os', "")
if imageos not in ["", 'linux'] and imageos not in os_overrides:
dest_type = 'di... |
<vulnerable_code> * This file was part of the Independent JPEG Group's software:
* Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, 2015-2018, D. R. Commander.
* Copyright (C) 2015, Google, Inc.
* For conditions of distribution and use, see the accompanying README.ijg
... |
<vulnerable_code> * Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.
* Copyright (C) 2013, Linaro Limited.
* For conditions of distribution and use, see the accompanying RE... |
<vulnerable_code> * Copyright (C) 1994-1996, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2013, Linaro Limited.
* Copyright (C) 2014-2015, 2018, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
JDIMENSION in_ro... |
<vulnerable_code> gsf_infile_child_by_name (GSF_INFILE (dir),
dirname);
if (subdir) {
/* Undo the ref. */
g_object_unref (subdir);
dir = GSF_INFILE_TAR (subdir);
} else
dir = tar_create_dir (dir, dirname);
}<commit_title>[PATCH] tar: fix crash on broken tar file.<commit_description><... |
<vulnerable_code> return null;
}
var hsl = /^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
var match = string.match(hsl);
if (match) {
return null;
}
var hwb = /^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]... |
<vulnerable_code>/* $OpenBSD: readconf.c,v 1.361 2021/07/23 04:04:52 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
case oCanonicalizePermittedCNAMEs:
value = options->num_permitted_cnames != 0;
while ((arg = argv_next(&ac, &av)) != NULL) {... |
<vulnerable_code>/* $OpenBSD: ssh.c,v 1.567 2021/09/10 10:26:02 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
port = default_ssh_port();
if (cname != NULL)
*cname = '\0';
snprintf(strport, sizeof strport, "%d", port);
memset(&hints, ... |
<vulnerable_code>/* $OpenBSD: readconf.c,v 1.362 2021/09/15 06:56:01 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
/* oCanonicalizePermittedCNAMEs */
printf("canonicalizePermittedcnames");
if (o->num_permitted_cnames == 0)
printf("none");
... |
<vulnerable_code>#include "dbus-job.h"
#include "dbus.h"
#include "escape.h"
#include "job.h"
#include "log.h"
#include "macro.h"
}
int job_deserialize(Job *j, FILE *f) {
assert(j);
assert(f);
for (;;) {
char line[LINE_MAX], *l, *v;
size_t k;
if... |
<vulnerable_code> _cleanup_(manager_reloading_stopp) _unused_ Manager *reloading = manager_reloading_start(m);
for (;;) {
char line[LINE_MAX];
const char *val, *l;
errno = 0;
if (!fgets(line, sizeof(line), f)) {
if ... |
<vulnerable_code> assert(fds);
for (;;) {
char line[LINE_MAX], *l, *v;
CGroupIPAccountingMetric m;
size_t k;
if (!fgets(line, sizeof(line), f)) {
if (feof(f))
return 0;
... |
<vulnerable_code>{
LEX_CHECK_SPACE_OK("\\.", yyextra->lex_buf_len, LEX_BUF_SIZE);
*yyextra->lex_buf_ptr++ = yytext[0];
*yyextra->lex_buf_ptr++ = yytext[1];
yyextra->lex_buf_len += 2;
YY_BREAK
case 66:
YY_RULE_SETUP
#line 592 "lexer.l"
{ YYTEXT_TO_BUFFER; }
YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RUL... |
<vulnerable_code> /**
* A CookieCompliance mode that allows <a href="https://tools.ietf.org/html/rfc2965">RFC 2965</a> compliance, but without bad quotes.
*/
public static final CookieCompliance RFC2965 = new CookieCompliance("RFC2965", complementOf(of(Violation.BAD_QUOTES)));
private static final... |
<vulnerable_code> hwc->event_base = 0;
} else if (hwc->idx >= X86_PMC_IDX_FIXED) {
hwc->config_base = MSR_ARCH_PERFMON_FIXED_CTR_CTRL;
hwc->event_base = MSR_ARCH_PERFMON_FIXED_CTR0;
} else {
hwc->config_base = x86_pmu_config_addr(hwc->idx);
hwc->event_base = x86_pmu_event_addr(hwc->idx);<commit_title>[PATCH... |
<vulnerable_code>
/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
* access to the local variable yy_act. Since yyless() is a macro, it would break
* existing scanners that call yyless() from OUTSIDE re_yylex.
* One obvious solution it to make yy... |
<vulnerable_code>
// Test case for issue #324
assert_true_regexp("whatever| x. x", " xy x", " xy x");
}
<commit_title>[PATCH] re_lexer: Make reading escape sequences more robust (#586)<commit_description>* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes... |
<vulnerable_code> // 14-Jul-2016, tatu: Not sure how or why, but during code coverage runs
// (via Cobertura) we get `java.lang.AbstractMethodError` so... ignore that too
}
DEFAULT_PARSER_FACTORY = parserFactory;
}
<commit_title>[PATCH] Fix #2589<commit_description><fixed_co... |
<vulnerable_code> Sint64 size;
void *pixels, *ptr;
/* Worse case at the end of line pulling 'alignment' extra blank pixels */
int pitch = (width + alignment) * 4;
pitch += alignment;
pitch &= ~alignment;
size = height * pitch + sizeof (void *) + alignment;<commit_t... |
<vulnerable_code> return add_item_to_array(array, newitem);
}
if (after_inserted != array->child && newitem->prev == NULL) {
/* return false if after_inserted is a corrupted array item */
return false;
}<commit_title>[PATCH] fix error in null checkings (#810)<commit_description>fixes... |
<vulnerable_code> goto cleanup;
}
cleanup:
if (retval != 0)
*status = "UNKNOWN_SERVER";
goto cleanup;
}
/* Don't return a referral to the empty realm or the service realm. */
if (realms == NULL || realms[0] == '\0' ||
data_eq_string(srealm, realms[0])) {
retva... |
<vulnerable_code> }
hash_param.type = siBuffer;
hash_param.data = 0;
hash_param.len = 0;
hash_slot = PK11_GetBestSlot(hash_to_nss[instance->crypto_hash_type], NULL);
if (hash_slot == NULL) {<commit_title>[PATCH] totemcrypto: fix hmac key initialization<commit_description>Signed-off-by: Fabio M. Di Nitto <fdinitt... |
<vulnerable_code>
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
s = strm->state;
if (s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
return Z_BUF_ERROR;
do {
put = Buf_size - s->bi_valid;<commit_title>[PATCH] Assure that the number of bits for deflatePrime() is valid.<commit_d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.