text stringlengths 79 3.72M |
|---|
<vulnerable_code> }
if (this.userInfo) {
// validate the optiona argument, it is required
// only if this.userInfo is true
if (!userInfo || typeof userInfo !== 'string') {
return false<commit_title>[PATCH 1/3] Update index.js<commit_description>Co-authored-by: James Sumners <james@sumners.email><f... |
<vulnerable_code> }
if (received & EPOLLRDHUP) {
when |= OGS_POLLIN;
}
}
<commit_title>[PATCH] [SCTP] Fixed a crash on SIGPIPE (#2734)<commit_description><fixed_code>
}
if (received & EPOLLRDHUP) {
when |= OGS_POLLIN;
... |
<vulnerable_code>
#define CAFChannelDescriptionFormat "LLLLL"
static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21 };
static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16 };
static struct {
uint32_t mChannelLayoutTag; // Core Audio layout, 100 - 146 in high... |
<vulnerable_code>
function commonPlugins() {
return [
resolve({ extensions: ['.js', '.ts'] }),
commonjs(),
alias({
entries: [
{
},
],
}),
typescript({ noEmitOnError: false }),
]
}
output: {
file: 'dist/mobiledoc.js',
format: 'es',
sourcemap: true... |
<vulnerable_code> case SkipLinesOp:
{
operand=ReadBlobByte(image);
if (opcode == EOF)
ThrowRLEException(CorruptImageError,"UnexpectedEndOfFile");
if (opcode & 0x40)
{
operand=ReadBlobLSBSignedShort(image);
if (opcode == EOF... |
<vulnerable_code> register unsigned char
*q;
q=(unsigned char *) p;
if (LocaleNCompare((const char *) p,"8BIM",4) != 0)
break;
p=PushLongPixel(MSBEndian,p,&long_sans);
p=PushShortPixel(MSBEndian,p,&id);
p=PushShortPixel(MSBEndian,p,&short_sans);
p=PushLongPixel(MSBEndian,p,&count... |
<vulnerable_code> return false;
string strUserPass64 = strAuth.substr(6); boost::trim(strUserPass64);
string strUserPass = DecodeBase64(strUserPass64);
return strUserPass == strRPCUserColonPass;
}
//<commit_title>[PATCH] Make RPC password resistant to timing attacks<commit_description>Fixes issue#28... |
<vulnerable_code> }
}
BOOST_AUTO_TEST_SUITE_END()<commit_title>[PATCH] Make RPC password resistant to timing attacks<commit_description>Fixes issue#2838; this is a tweaked version of pull#2845 that
should not leak the length of the password and is more generic,
in case we run into other situations where we need
tim... |
<vulnerable_code> HttpEntity withoutSizeLimit();
/**
* Returns a future of a strict entity that contains the same data as this entity
* which is only completed when the complete entity has been collected. As the
* duration of receiving the complete entity cannot be predicted, a timeout needs to
... |
<vulnerable_code> <T> Self transformEntityDataBytes(Graph<FlowShape<ByteString, ByteString>, T> transformer);
/**
* Returns a future of Self message with strict entity that contains the same data as this entity
* which is only completed when the complete entity has been collected. As t... |
<vulnerable_code>import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.model.SwitchResultVo;
import org.apache.dolphinscheduler.plugin.task.api.parameters.SwitchParameters;
import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils;
import org... |
<vulnerable_code>
package org.apache.dolphinscheduler.server.master.utils;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class SwitchTaskUtils {
private static final ScriptEngineManager manager;
private static final ScriptEngine engine;... |
<vulnerable_code><commit_title>[PATCH] fix switch condition<commit_description><fixed_code>
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF ... |
<vulnerable_code>{
struct bpf_insn_aux_data *aux = commit_window ? cur_aux(env) : tmp_aux;
struct bpf_verifier_state *vstate = env->cur_state;
bool off_is_neg = off_reg->smin_value < 0;
bool ptr_is_dst_reg = ptr_reg == dst_reg;
u8 opcode = BPF_OP(insn->code);
alu_limit = abs(tmp_aux->alu_limit - alu_limit);
} e... |
<vulnerable_code> break;
}
}
q[i]=ClampToQuantum(pixel);
}
p+=GetPixelChannels(composite_image);
channels=GetPixelChannels(composite_image);<commit_title>[PATCH]<commit_description><fixed_code>
break;
}
}
q[i]=ClampPixel(pixel)... |
<vulnerable_code>%
*/
static inline Quantum ClampPixel(const MagickRealType value)
{
#if !defined(MAGICKCORE_HDRI_SUPPORT)
return((Quantum) value);
#else
if (value < 0.0f)
return(0.0);
if (value >= (MagickRealType) QuantumRange)
return((Quantum) QuantumRange);
return(value);
#endif
}
MagickExport Magi... |
<vulnerable_code> }
switch (sun_info.maptype)
{
case RMT_EQUAL_RGB:
{
unsigned char<commit_title>[PATCH]<commit_description><fixed_code>
}
switch (sun_info.maptype)
{
case RMT_NONE:
break;
case RMT_EQUAL_RGB:
{
unsigned char |
<vulnerable_code> BYTE* pbSegment;
size_t cbSegment;
if (!zgfx || !stream)
return FALSE;
cbSegment = segmentSize - 1;
if ((Stream_GetRemainingLength(stream) < segmentSize) || (segmentSize < 1) ||
(segmentSize > UINT32_MAX))
return FALSE;
Stream_Read_UINT8(stream, flags); /* header (1 byte) */
zgfx->O... |
<vulnerable_code>import org.xwiki.model.reference.EntityReferenceSerializer;
import org.xwiki.refactoring.internal.job.AbstractEntityJob;
import org.xwiki.refactoring.job.EntityJobStatus;
import org.xwiki.user.UserReference;
import org.xwiki.user.UserReferenceResolver;
// Update the author for the attribution ... |
<vulnerable_code>import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.mockito.Mock;
import org.xwiki.attachment.internal.AttachmentsManager;
import org.xwiki.attachment.internal.RedirectAttachmentClassDocumentInitializer;
import... |
<vulnerable_code> REQUEST *request = ctx;
rad_assert(request->magic == REQUEST_MAGIC);
/*
* If it's still queued (waiting for a thread to pick it
(pthread_equal(request->child_pid, NO_SUCH_CHILD_PID) == 0))) {
/*
* Cap delay at five minutes.
*/
if (request->delay < (USEC * 60 * 5)) {
request->... |
<vulnerable_code> if (tlen) {
oid_len = *tptr;
if (tlen < oid_len) {
return 0;
}
if (oid_len) {<commit_title>[PATCH] CVE-2017-13027/LLDP: Fix a bounds check.<commit_description>The total length of the OID is the OID length plus the length of the OID
length itself.
This f... |
<vulnerable_code> if (!kbuf)
return -ENOMEM;
if (!copy_from_iter_full(kbuf, len, from))
return -EFAULT;
ret = qrtr_endpoint_post(&tun->ep, kbuf, len);
return ret < 0 ? ret : len;
}
<commit_title>[PATCH] net: qrtr: fix memort leak in qrtr_tun_write_iter<commit_description>In qrtr_tun_write_iter the allocated k... |
<vulnerable_code>int vfs_open(const struct path *path, struct file *file,
const struct cred *cred)
{
struct dentry *dentry = path->dentry;
struct inode *inode = dentry->d_inode;
file->f_path = *path;
if (dentry->d_flags & DCACHE_OP_SELECT_INODE) {
inode = dentry->d_op->d_select_inode(dentry, file->f_flags)... |
<vulnerable_code> ecryptfs_opt_encrypted_view, ecryptfs_opt_fnek_sig,
ecryptfs_opt_fn_cipher, ecryptfs_opt_fn_cipher_key_bytes,
ecryptfs_opt_unlink_sigs, ecryptfs_opt_mount_auth_tok_only,
ecryptfs_opt_err };
static const match_table_t tokens = {
{ecryptfs_opt_fn_cipher_key_bytes, "ecryptfs_... |
<vulnerable_code> subscription->updateState,
subscription->updateOptions
);
if (subscription_get_filter (subscription))
request->filtercmd = g_strdup (subscription_get_filter (subscription));<commit_title>[PATCH] Fix RCE vulnerability on feed enrichment<commit_description>Currently there are a few places i... |
<vulnerable_code> request->authValue = g_strdup (authValue);
}
/* update result object */
updateResultPtr
/* everything starting with '|' is a local command */
if (*(job->request->source) == '|') {
debug1 (DEBUG_UPDATE, "Recognized local command: %s", job->request->source);
update_exec_cmd (job);
return;
}
... |
<vulnerable_code> ecma_deref_object (prototype_obj_p);
}
ecma_value_t target_length = ecma_make_integer_value (0);
ecma_string_t *len_string = ecma_get_magic_string (LIT_MAGIC_STRING_LENGTH);
ecma_property_descriptor_t prop_desc;
ecma_value_t status = ecma_op_object_get_own_property_descriptor (this_arg_o... |
<vulnerable_code> ciphertext = bytesToNumber(bytearray(string))
return ciphertext
def _rawPublicKeyOp(self, ciphertext):
data = numberToByteArray(ciphertext, numBytes(self.n))
string = m2.rsa_public_decrypt(self.rsa, bytes(data),
message = bytesToNumbe... |
<vulnerable_code> :type sLen: int
:param sLen: length of salt"""
EM = self.EMSA_PSS_encode(mHash, numBits(self.n) - 1, hAlg, sLen)
m = bytesToNumber(EM)
if m >= self.n:
raise MessageTooLongError("Encode output too long")
s = self._rawPrivateKeyOp(m)
S =... |
<vulnerable_code> @Override
public void call(Object... objects) {
Object data = objects[0];
if (data instanceof String) {
Manager.this.ondata((String)data);
} else if (data instanceof byte[]) {
Manager.this.on... |
<vulnerable_code>package io.socket.parser;
import io.socket.hasbinary.HasBinary;
import org.json.JSONException;
import org.json.JSONTokener;
import java.util.ArrayList;
logger.log(Level.WARNING, "An error occured while retrieving data from JSONTokener", e);
throw new DecodingEx... |
<vulnerable_code>package io.socket.parser;
import io.socket.emitter.Emitter;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.nio.charset.Charset;
import static org.hamcrest.CoreM... |
<vulnerable_code> Helpers.testDecodeError(Parser.EVENT + "2sd");
// event with invalid json data
Helpers.testDecodeError(Parser.EVENT + "2[\"a\",1,{asdf}]");
}
}<commit_title>[PATCH] fix: ensure the payload format is valid<commit_description>This commit should prevent some NPE issues encounte... |
<vulnerable_code> self, document: Document, error: bool, text: str, percentage: float
) -> None:
s = Style.BRIGHT + Fore.YELLOW + f"[doc {document.id}] "
s += Fore.CYAN + f"{percentage}% "
if error:
s += Style.RESET_ALL + Fore.RED + text
log.error(s)
el... |
<vulnerable_code>
if (code == LITE_SET_FG_FG_RUN || code == MEGA_MEGA_SET_FG_RUN)
{
SRCREADPIXEL(fgPel, pbSrc);
SRCNEXTPIXEL(pbSrc);
}
case MEGA_MEGA_DITHERED_RUN:
runLength = ExtractRunLength(code, pbSrc, &advance);
pbSrc = pbSrc + advance;
SRCREADPIXEL(pixelA, pbSrc);
SRCNEXTP... |
<vulnerable_code>/*
* packet format documented at
* http://www.rhyshaden.com/eigrp.htm
*/
struct eigrp_common_header {
/* ok they seem to want to know everything - lets fully decode it */
tlen=len-sizeof(struct eigrp_common_header);
/* FIXME print other header info */
eigrp_tlv_type,
... |
<vulnerable_code>import com.nextcloud.client.network.ClientFactory;
import com.nextcloud.client.notifications.AppNotificationManager;
import com.nextcloud.client.notifications.AppNotificationManagerImpl;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.FileDataStorageMa... |
<vulnerable_code> @Inject
MigrationsManager migrationsManager;
private PassCodeManager passCodeManager;
@SuppressWarnings("unused")
private boolean mBound;
DisplayUtils.useCompatVectorIfNeeded();
fixStoragePath();
passCodeManager = new PassCodeManager(preferences);
... |
<vulnerable_code> @Inject AppPreferences preferences;
@Inject OnboardingService onboarding;
@Inject DeviceInfo deviceInfo;
private boolean onlyAdd = false;
@SuppressLint("ResourceAsColor") @ColorInt
private int primaryColor = R.color.primary;<commit_title>[PATCH] PassCodeManager: convert to Kotli... |
<vulnerable_code>/*
* ownCloud Android client application
*
* @author David A. Velasco
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Fou... |
<vulnerable_code> void *kaddr;
maxlen = xdr->buf->page_len;
if (base >= maxlen) {
base = maxlen;
maxlen = 0;
} else
maxlen -= base;
if (len > maxlen)
len = maxlen;<commit_title>[PATCH] sunrpc: Avoid a KASAN slab-out-of-bounds bug in<commit_description><fixed_code>
void *kaddr;
maxlen = xdr->buf->page_le... |
<vulnerable_code> (devs, dev->id, U2FHID_INIT, nonce, sizeof (nonce), resp,
&resplen) == U2FH_OK)
{
U2FHID_INIT_RESP initresp;
if (resplen > sizeof (initresp))
{
return U2FH_MEMORY_ERROR;
}
memcpy (&initresp, resp, resplen);
dev->cid = initresp.cid;
dev->versionInterfa... |
<vulnerable_code>
private final String csrfToken = UUID.randomUUID().toString();
private final String pushId = UUID.randomUUID().toString();
/**<commit_title>[PATCH] fix: use time-constant comparison for security tokens<commit_description><fixed_code>
private final String csrfToken = UUID.randomUUID(... |
<vulnerable_code>import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import com.vaadin.server.ClientConnector;
import com.vaadin.server.NoInputStreamException;
streamVariable = uI.getConnectorTracker()
.getStreamVariable(connectorId, variableName)... |
<vulnerable_code>
import java.io.IOException;
import java.io.Reader;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
private int longPollingSuspendTimeout = -1;
/**
* Callback interface used internally to process an event with the
* corresponding UI prop... |
<vulnerable_code> // Chrome version does not necessarily match the desired version
// because of auto updates...
browserIdentifier = getExpectedUserAgentString(
getDesiredCapabilities()) + "87";
} else {
browserIdentifier = getExpectedUserAgentS... |
<vulnerable_code> return ret;
}
/*
* The njs_function_apply() function can convert fast array to object.
* After this conversion, there will be garbage in the value.
*/
if (njs_fast_path(njs_is_fast_array(&state->value)
&& (state->index - 1) < ... |
<vulnerable_code> " function(k, v) {return v.a.a;}); o"),
njs_str("TypeError: cannot get property \"a\" of undefined") },
/* JSON.stringify() */
{ njs_str("JSON.stringify()"),<commit_title>[PATCH] Fixed heap-use-after-free in JSON.parse().<commit_description><fixed_code... |
<vulnerable_code> const struct zsock_addrinfo *hints;
struct k_sem sem;
int status;
int idx;
};
static struct zsock_addrinfo ai_arr[2];
struct dns_addrinfo *info, void *user_data)
{
struct getaddrinfo_state *state = user_data;
struct zsock_addrinfo *ai = ai_arr + state->idx;
int socktype = SOCK_STREAM;
in... |
<vulnerable_code>from ellipticcurve.utils.compatibility import *
from ellipticcurve.privateKey import PrivateKey
from ellipticcurve.publicKey import PublicKey
from ellipticcurve.signature import Signature
from ellipticcurve.utils.file import File
from ellipticcurve.ecdsa import Ecdsa<commit_title>[PATCH] Add signature.... |
<vulnerable_code> curve = publicKey.curve
r = signature.r
s = signature.s
inv = Math.inv(s, curve.N)
u1 = Math.multiply(curve.G, n=(numberMessage * inv) % curve.N, N=curve.N, A=curve.A, P=curve.P)
u2 = Math.multiply(publicKey.point, n=(r * inv) % curve.N, N=curve.N, A=curv... |
<vulnerable_code> return schema.detach();
}
String_Schema_Obj Parser::parse_css_variable_value(bool top_level)
{
String_Schema_Obj schema = SASS_MEMORY_NEW(String_Schema, pstate);
String_Schema_Obj tok;
if (!(tok = parse_css_variable_value_token(top_level))) {
return {};
}
schema->c... |
<vulnerable_code> return normalized;
}
} // namespace Sass
} // namespace Util<commit_title>[PATCH] Make `parse_css_variable_value` non-recursive<commit_description>Fixes #2658 stack overflow<fixed_code>
return normalized;
}
char opening_bracket_for(char closing_bracket) {
switch (closing_bracket) {
case '... |
<vulnerable_code>)
def test_trigger_dag_button(admin_client, req, expected_run_id):
test_dag_id = "example_bash_operator"
admin_client.post(f"dags/{test_dag_id}/trigger?{req}")
with create_session() as session:
run = session.query(DagRun).filter(DagRun.dag_id == test_dag_id).first()
assert run i... |
<vulnerable_code> }
if (this.userInfo) {
// validate the optiona argument, it is required
// only if this.userInfo is true
if (!userInfo || typeof userInfo !== 'string') {
return false<commit_title>[PATCH] Update index.js<commit_description>Co-authored-by: James Sumners <james@sumners.email><fixed... |
<vulnerable_code><commit_title>[PATCH] Issue 4817 - BUG - locked crypt accounts on import may allow<commit_description><fixed_code>
# --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2021 William Brown <william@blackhats.net.au>
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for de... |
<vulnerable_code>int
crypt_pw_cmp(const char *userpwd, const char *dbpwd)
{
int rc;
char *cp;
struct crypt_data data;
data.initialized = 0;
/* we use salt (first 2 chars) of encoded password in call to crypt_r() */
cp = crypt_r(userpwd, dbpwd, &data);
if (cp) {
rc = slapi_ct_memcmp(... |
<vulnerable_code> all_cookies.append(L"\n*\n");
}
INTERNETCOOKIE2* current_cookie = cookie_pointer + cookie_index;
std::wstring cookie_name = current_cookie->pwszName;
std::wstring cookie_value = L"";
if (current_cookie->pwszValue) {
cookie_value = current_cook... |
<vulnerable_code>exports.formatters.o = function(v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts)
.replace(/\s*\n\s*/g, ' ');
};
/**<commit_title>[PATCH] fix: remove ReDoS regexp<commit_description><fixed_code>
exports.formatters.o = function(v) {
this.inspectOpts.color... |
<vulnerable_code> }
data->data_size = pages_total * 4;
data->data_read = pages_read * 4;
bool pages_parsed = true;
for(uint16_t i = 0; i < pages_total; i++) {
string_printf(temp_str, "Page %d", i);<commit_title>[PATCH] fix buffer overflow in mifar ul load<commit_descri... |
<vulnerable_code> for (; ; ++ndx, ++dynp) {
unsigned const d_tag = get_te32(&dynp->d_tag);
if (d_tag < DT_NUM) {
dt_table[d_tag] = ndx;
}
if (Elf32_Dyn::DT_NULL == d_tag) {
}
}
// DT_HASH often ends at DT_SYMTAB
unsigned const v_hsh = elf_unsigned_dynam... |
<vulnerable_code>static char *
search_make_new(const struct search_state *const state, int n, const char *const base_name) {
const size_t base_len = strlen(base_name);
const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
struct search_domain *dom;
for (dom = state->head; dom; dom = dom->next) {
... |
<vulnerable_code>};
const smtpSend = function (pool, mailOptions) {
pool._futureWrappedSendMail(mailOptions).wait();
};
const rawSend = function (mailOptions, smtpConfig) {
// Sends an email mailOptions object structured as described in
// https://github.com/nodemailer/mailcomposer#e-mail-message-fields
// ac... |
<vulnerable_code>
// First remove any instances of characters that cause trouble for SimpleSmtp. Ideally,
// we could escape such characters with a backslash, but that does not seem to help here.
const sanitized = displayName.replace(/"|<|>|\\|\r/g, "");
return "\"" + sanitized + "\" <" + this.getRetur... |
<vulnerable_code>
const sendOptions = {
to: email,
from: db.getServerTitle() + " <" + db.getReturnAddress() + ">",
subject: subject,
text: text,
};<commit_title>[PATCH] Validate e-mail addresses more strictly.<commit_description><fixed_code>
const sendOptions = {
to: email,
from: { name... |
<vulnerable_code> try {
sendEmail({
to: to,
from: globalDb.getServerTitle() + " <" + returnAddress + ">",
subject: "Testing your Sandstorm's SMTP setting",
text: "Success! Your outgoing SMTP is working.",
smtpConfig: restConfig,
sendInvites: function (token, origin, f... |
<vulnerable_code>
/*----------------------------------------------------------------------------*/
/* */
/* LIBMESHB V7.61 */
/* ... |
<vulnerable_code> ogs_log_hexdump(OGS_LOG_ERROR, pkbuf->data, pkbuf->len);
goto cleanup;
}
ogs_assert(ogs_pkbuf_pull(pkbuf, len));
if (gtp_h->type == OGS_GTPU_MSGTYPE_END_MARKER) {<commit_title>[PATCH] A crafted packet from UE can crash SGW-U/UPF<commit_description><fixed_code>
ogs_l... |
<vulnerable_code> ogs_log_hexdump(OGS_LOG_ERROR, pkbuf->data, pkbuf->len);
goto cleanup;
}
ogs_assert(ogs_pkbuf_pull(pkbuf, len));
if (gtp_h->type == OGS_GTPU_MSGTYPE_GPDU) {<commit_title>[PATCH] A crafted packet from UE can crash SGW-U/UPF<commit_description><fixed_code>
ogs_log_hex... |
<vulnerable_code>#define wmemmove(a,b,i) (wchar_t *)memmove((a), (b), (i) * sizeof(wchar_t))
#endif
struct archive_string_conv {
struct archive_string_conv *next;
char *from_charset;
as->s[as->length] = '\0';
/* Re-allocate buffer for MBS. */
if (archive_string_ensure(as,
as->length + len * 2 + 1... |
<vulnerable_code> for (i=0; i < (ssize_t) filesize; i++)
{
c=ReadBlobByte(pwp_image);
(void) fputc(c,file);
}
(void) fclose(file);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/535<commit_description><fixed_code>
for (i=0; i < (ssize_t) filesize; i++)
{
... |
<vulnerable_code> AcquireNextImage(image_info,image);
if (GetNextImageInList(image) == (Image *) NULL)
return((Image *) NULL);
image=SyncNextImageInList(image);
}
exception);
if (status == MagickFalse)
return((Image *) NULL);
if ((image_info->ping == ... |
<vulnerable_code> },
deleteField: function (tree, record) {
Ext.Msg.confirm(t('delete'), sprintf(t('delete_message_advanced'), t('portlet_customreport'), record.data.text), function (btn) {
if (btn == 'yes') {
Ext.Ajax.request({
url: Routing.generate('pimc... |
<vulnerable_code>
def test_too_many_characters(font):
with pytest.raises(ValueError):
font.getlength("A" * 1000001)
with pytest.raises(ValueError):
font.getbbox("A" * 1000001)
with pytest.raises(ValueError):
font.getmask2("A" * 1000001)
transposed_font = ImageFont.TransposedFont... |
<vulnerable_code> RAQM = 1
MAX_STRING_LENGTH = 1000000
try:<commit_title>[PATCH] Added underscores for readability<commit_description>Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com><fixed_code>
RAQM = 1
MAX_STRING_LENGTH = 1_000_000
try: |
<vulnerable_code> {
return false;
}
}<commit_title>[PATCH] CRAPP-302: Edit button is not displayed for guest user<commit_description>* Change the way to deal with change request edition right<fixed_code>
{
return false;
}
/**
* Check if the given user is allowed to use change re... |
<vulnerable_code>package org.xwiki.contrib.changerequest.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.xwi... |
<vulnerable_code> XWikiContext context = this.contextProvider.get();
String serializedDocReference = request.getParameter("docReference");
DocumentReference documentReference = this.documentReferenceResolver.resolve(serializedDocReference);
XWikiDocument modifiedDocument = null;
... |
<vulnerable_code> UserReference currentUserReference = this.currentUserReferenceResolver.resolve(CurrentUserReference.INSTANCE);
return this.changeRequestRightsManager.isAuthorizedToSplit(currentUserReference, changeRequest);
}
}<commit_title>[PATCH] CRAPP-302: Edit button is not displayed for guest ... |
<vulnerable_code>import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.inject.Inject;
import org.junit.jupiter.api.Test;
import org.xwiki.contrib.changerequest.Appro... |
<vulnerable_code>import org.suigeneris.jrcs.rcs.Version;
import org.xwiki.contrib.changerequest.ApproversManager;
import org.xwiki.contrib.changerequest.ChangeRequest;
import org.xwiki.contrib.changerequest.ChangeRequestManager;
import org.xwiki.contrib.changerequest.ChangeRequestMergeManager;
import org.xwiki.contrib.... |
<vulnerable_code>import org.junit.jupiter.api.Test;
import org.suigeneris.jrcs.rcs.Version;
import org.xwiki.contrib.changerequest.ChangeRequest;
import org.xwiki.contrib.changerequest.ChangeRequestStatus;
import org.xwiki.contrib.changerequest.FileChange;
import org.xwiki.contrib.changerequest.events.ChangeRequestCrea... |
<vulnerable_code>
/*
* Resize the pipe ring to a number of slots.
*/
int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
{
struct pipe_buffer *bufs;
unsigned int head, tail, mask, n;
/*
* We can shrink the pipe, if arg is greater than the ring occupancy.
* Since we don't expect a lot of ... |
<vulnerable_code>$(document).ready(function(){function t(){api.IMAP.get().success(function(e){0==e.length?$("#lastlogindiv").hide():(0==(e=e[0]).enabled?$("#lastlogindiv").hide():$("#lastlogindiv").show(),$("#imapusername").val(e.username),$("#imaphost").val(e.host),$("#imapport").val(e.port),$("#imappassword").val(e.p... |
<vulnerable_code> if (data.success == true) {
Swal.fire({
title: "Success",
html: "Logged into <b>" + $("#imaphost").val() + "</b>",
type: "success",
})
} else {
Swal.fire({
... |
<vulnerable_code>{
struct iovec iov;
struct pci_vtrnd_softc *sc;
int len;
uint16_t idx;
sc = vsc;
}
while (vq_has_descs(vq)) {
vq_getchain(vq, &idx, &iov, 1, NULL);
len = (int) read(sc->vrsc_fd, iov.iov_base, iov.iov_len);
<commit_title>[PATCH] Fix vtrnd pci_vtrnd_notify uninitialized memory use<commit_de... |
<vulnerable_code> *
* @return the secret key used in encryption/decryption of the serialized session data.
*/
public String getSecretKey() {
return secretKey;
}
/**
* Set the secret key used in the symmetric-key encryption/decryption of the serialized session data.
* <p>
* Defaults to a rando... |
<vulnerable_code> UNUSED(cls);
if (con_info != NULL) {
con_info->callback_first_iteration = 1;
con_info->u_instance = NULL;
u_map_init(&con_info->map_url_initial);
return NULL;
}
if (NULL == con_info->request || ulfius_init_request(con_info->request) != U_OK) {
ulfius_clean_request_... |
<vulnerable_code>import ssl
import asyncio
from tornado import httpclient
from keylime import json
except Exception as e:
return TornadoResponse(599, f"General communication failure: {str(e)}")
if response is None:
return TornadoResponse(599, f"Unspecified failure in tornado (empty http respons... |
<vulnerable_code>
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
return(DestroyImageList(image));
if (num_passes > 1)
pixel_info=AcquireVirtualMemory(image->rows,ping_rowbytes*<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/596<commit... |
<vulnerable_code> assign_opcode = CBC_ASSIGN_SET_IDENT;
#if ENABLED (JERRY_ES2015)
if (pattern_flags & PARSER_PATTERN_GROUP_EXPR)
{
parser_stack_push_uint8 (context_p, LEXER_ASSIGN_GROUP_EXPR);
}
if (!(pattern_flags & (PARSER_PATTERN_LET | PARSER_PATTERN_CONST | PARSER_PATTERN_LOCAL)))
{
... |
<vulnerable_code><commit_title>[PATCH] Fix assignment lookahead in parser_process_group_expression<commit_description><fixed_code>
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complian... |
<vulnerable_code> # ignore blank text as it's not meaningful in OT-SVG; it also prevents
# dangling tail text after removing an element when pretty_print=True
remove_blank_text=True,
),
)
<commit_title>[PATCH] subset: parse OT-SVG with resolve_entities=... |
<vulnerable_code>const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const models = require('../../models');
const ALLOWED_INCLUDES = ['count.posts'];
notFound: 'Author not found.'
};
module.exports = {
docName: 'authors',
},
... |
<vulnerable_code>const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const models = require('../../models');
const ALLOWED_INCLUDES = ['tags', 'authors', 'tiers'];
pageNotFound: 'Page not found.'
};
module.exports = {
docName: 'pages',
},
permissions: true,
... |
<vulnerable_code>const models = require('../../models');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const postsPublicService = require('../../services/posts-public');
const allowedIncludes = ['tags', 'authors', 'tiers', 'sentiment'];
postNotFound: 'Post not found.'
};
module... |
<vulnerable_code> await configUtils.restore();
});
it('can read authors with fields', function () {
return request.get(localUtils.API.getApiQuery(`authors/1/?key=${validKey}&fields=name`))
.set('Origin', testUtils.API.getURL())<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20Fixed=20fi... |
<vulnerable_code> await configUtils.restore();
});
it('Returns a validation error when unsupported "page" filter is used', function () {
return request.get(localUtils.API.getApiQuery(`pages/?key=${key}&filter=page:false`))
.set('Origin', testUtils.API.getURL())<commit_title>[PATCH] =... |
<vulnerable_code>
const validKey = localUtils.getValidKey();
it('browse posts', function (done) {
request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}`))
.set('Origin', testUtils.API.getURL())<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20Fixed=20filtering=20on=20private?=<commit_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.