text stringlengths 79 3.72M |
|---|
<vulnerable_code>/* Generated by Cython 0.29.17 */
/* BEGIN: Cython Metadata
{
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_17"
#define CYTHON_HEX_VERSION 0x001D11F0
#define CYTHO... |
<vulnerable_code>/* Generated by Cython 0.29.17 */
/* BEGIN: Cython Metadata
{
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_17"
#define CYTHON_HEX_VERSION 0x001D11F0
#define CYTHO... |
<vulnerable_code>/* Generated by Cython 0.29.17 */
/* BEGIN: Cython Metadata
{
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_17"
#define CYTHON_HEX_VERSION 0x001D11F0
#define CYTHO... |
<vulnerable_code><commit_title>[PATCH] Fix malformed read/write in BufferedReader<commit_description>read_strings and read affected<fixed_code>
import socket
from unittest import TestCase
import mock
from clickhouse_driver.bufferedreader import BufferedSocketReader
class BufferedReaderTestCase(TestCase):
def tes... |
<vulnerable_code>from airflow.kubernetes import pod_generator
from airflow.kubernetes.pod_generator import PodGenerator
from airflow.kubernetes.secret import Secret
from airflow.models import BaseOperator
from airflow.providers.cncf.kubernetes.backcompat.backwards_compat_converters import (
convert_affinity,
co... |
<vulnerable_code>import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.OnAccountsUpdateListener;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
/**
* Start a new {@link UploadFileOperation}.
*/
priva... |
<vulnerable_code> fd_t fd_,
const options_t &options_,
const endpoint_uri_pair_t &endpoint_uri_pair_) :
stream_engine_base_t (fd_, options_, endpoint_uri_pair_)
{
}
<commit_title>[PATCH] problem: zeromq connects peer before handshake is completed<commit_description>Solution: delay connecting the peer pipe unti... |
<vulnerable_code>void zmq::session_base_t::process_attach (i_engine *engine_)
{
zmq_assert (engine_ != NULL);
// Create the pipe if it does not exist yet.
if (!_pipe && !is_terminating ()) {
object_t *parents[2] = {this, _socket};
// The endpoints strings are not set on bind, set them he... |
<vulnerable_code>zmq::stream_engine_base_t::stream_engine_base_t (
fd_t fd_,
const options_t &options_,
const endpoint_uri_pair_t &endpoint_uri_pair_) :
_options (options_),
_inpos (NULL),
_insize (0),
_handshaking (true),
_io_error (false),
_session (NULL),
_socket (NULL)
{
const ... |
<vulnerable_code> const endpoint_uri_pair_t &endpoint_uri_pair_,
const ws_address_t &address_,
bool client_) :
stream_engine_base_t (fd_, options_, endpoint_uri_pair_),
_client (client_),
_address (address_),
_cl... |
<vulnerable_code> fd_t fd_,
const options_t &options_,
const endpoint_uri_pair_t &endpoint_uri_pair_) :
stream_engine_base_t (fd_, options_, endpoint_uri_pair_),
_greeting_size (v2_greeting_size),
_greeting_bytes_read (0),
_subscription_required (false),<commit_title>[PATCH] problem: zeromq connect... |
<vulnerable_code> rc = zmq_setsockopt (server, ZMQ_SUBSCRIBE, "A", 1);
TEST_ASSERT_EQUAL_INT (0, rc);
// SUB binds, let its state machine run
zmq_recv (server, buffer, 16, ZMQ_DONTWAIT);
if (sub_command_) {<commit_title>[PATCH] problem: zeromq connects peer before handshake is c... |
<vulnerable_code> try:
try:
return_tuple = func(self, *args, **kwargs)
display.vvv(return_tuple, host=self.host)
# 0 = success
# 1-254 = remote command return code
# 255 could be a failure from... |
<vulnerable_code>'use strict';
const vary = require('vary');
/**
* CORS middleware
*
* @param {Object} [options]
* - {String|Function(ctx)} origin `Access-Control-Allow-Origin`, default is request Origin header
* - {String|Array} allowMethods `Access-Control-Allow-Methods`, default is 'GET,HEAD,PUT,POST,DELETE... |
<vulnerable_code>'use strict';
const assert = require('assert');
const Koa = require('koa');
const request = require('supertest');
ctx.body = { foo: 'bar' };
});
it('should not set `Access-Control-Allow-Origin` when request Origin header missing', function(done) {
request(app.listen())
.ge... |
<vulnerable_code>@RunWith(SpringRunner.class)
@WebMvcTest
@Import({VaadinConnectEndpoints.class, MyRestController.class})
public class EndpointWithRestControllerIT {
private MockMvc mockMvcForEndpoint;
<commit_title>[PATCH] Remove the IT suffix from the test<commit_description><fixed_code>
@RunWith(SpringRunner.cl... |
<vulnerable_code> url);
oidc_error(r, "%s: %s", *err_str, *err_desc);
return FALSE;
}
/* validate the URL to prevent HTTP header splitting */<commit_title>[PATCH] Fix open redirect starting with a slash<commit_description><fixed_code>
url);
oidc_error(r, "%s: %s", *err_str, *err_desc);
return FALS... |
<vulnerable_code>/*
** {======================================================
** Library for packing/unpacking structures.
** $Id: struct.c,v 1.4 2012/07/04 18:54:29 roberto Exp $
** See Copyright Notice at the end of this file
** =======================================================
*/
** h/H - signed/unsigned shor... |
<vulnerable_code> crypto_free_aead(ctx->child);
}
static int pcrypt_init_instance(struct crypto_instance *inst,
struct crypto_alg *alg)
{
inst->alg.encrypt = pcrypt_aead_encrypt;
inst->alg.decrypt = pcrypt_aead_decrypt;
err = aead_register_instance(tmpl, inst);
if (err)
goto out_drop_aead;
return -EINVAL;
... |
<vulnerable_code> const symbol = 'NFT';
const batches = [
{ receiver: user1, amount: 0 },
{ receiver: user1, amount: 3 },
{ receiver: user2, amount: 5 },
{ receiver: user3, amount: 0 },
{ receiver: user1, amount: 7 },<commit_title>[PATCH] Fix ERC721Consecutive balance update on batch size 1<commi... |
<vulnerable_code> if (tag == 0) break;
ddjvu_message_pop(lc->context);
} while ((message = ddjvu_message_peek(lc->context)));
} while (!ddjvu_page_decoding_done(lc->page));
ddjvu_document_get_pageinfo(lc->document, p... |
<vulnerable_code> requires transitive org.eclipse.jetty.io;
exports org.eclipse.jetty.http;
exports org.eclipse.jetty.http.pathmap;
uses org.eclipse.jetty.http.HttpFieldPreEncoder;<commit_title>[PATCH] Issue #9554 - move common hpack/qpack code to jetty-http<commit_description>Signed-off-by: Lachlan Ro... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack.internal.util;
public class EncodingException extends Exception
{<commit_title>[PATCH] Issue #9554 - move common hpack/qpack code to jetty-http<commit_description>Signed-off-by: Lachla... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http2.hpack;
import java.nio.ByteBuffer;
import org.eclipse.jetty.util.Utf8StringBuilder;
public class Huffman
{
// Appendix C: Huffman Codes
// http://tools.ietf.org/html/draft-ietf-ht... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack.internal.util;
import java.nio.ByteBuffer;
import org.eclipse.jetty.util.Utf8StringBuilder;
public class HuffmanDecoder
{
static final char EOS = HuffmanEncoder.EOS;
static f... |
<vulnerable_code><commit_title>[PATCH] Issue #9554 - move common hpack/qpack code to jetty-http<commit_description>Signed-off-by: Lachlan Roberts <lachlan@webtide.com><fixed_code>
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack.internal.util;
import java.nio.ByteBuffer;
public class NBitIntegerEncoder
{
public static int octectsNeeded(int n, long i)
{
if (n == 8)
{<commit_title>[PATCH... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack.internal.util;
import java.nio.ByteBuffer;
public class NBitIntegerParser
{
private int _prefix;
private long _total;
private long _multiplier;<commit_title>[PATCH] Issue ... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack.internal.util;
import java.nio.ByteBuffer;
<commit_title>[PATCH] Issue #9554 - move common hpack/qpack code to jetty-http<commit_description>Signed-off-by: Lachlan Roberts <lachlan@web... |
<vulnerable_code>import org.eclipse.jetty.http.HostPortHttpField;
import org.eclipse.jetty.http.HttpHeader;
/**
*
*/
public class AuthorityHttpField extends HostPortHttpField
{
public static final String AUTHORITY = HpackContext.STATIC_TABLE[1][0];<commit_title>[PATCH] Issue #9554 - move common hpack/qpack code ... |
<vulnerable_code>import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpScheme;
import org.eclipse.jetty.util.Index;
import org.eclipse.jetty.util.StringUtil;
import org.slf4j.Logger;
String value = field.getValue();
if (value != nul... |
<vulnerable_code>import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpTokens;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http2.hpack.HpackContext.Entry;
import org.eclipse.jetty.util.BufferUtil;
import org.slf4j.Logger;
if (b < 0)
{
//... |
<vulnerable_code>import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http.PreEncodedHttpField;
import org.eclipse.jetty.http2.hpack.HpackContext.Entry;
import org.eclipse.jetty.http2.hpack.HpackContext.StaticEntry;
import org.eclipse.jetty.util.BufferUtil;
... |
<vulnerable_code>
package org.eclipse.jetty.http2.hpack;
@SuppressWarnings("serial")
public abstract class HpackException extends Exception
{
HpackException(String messageFormat, Object... args)
*/
public static class StreamException extends HpackException
{
StreamException(String messageForma... |
<vulnerable_code>import org.eclipse.jetty.http.HttpFieldPreEncoder;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.util.BufferUtil;
/**
int nameIdx = HpackContext.staticIndex(header);
if (nameIdx > 0)
NBitInteger.encode(buffer,... |
<vulnerable_code> private HostPortHttpField _authority;
private String _path;
private String _protocol;
private long _contentLength = Long.MIN_VALUE;
private HpackException.StreamException _streamException;
private boolean _request;
private boolean _response;
return _size;
}
... |
<vulnerable_code>//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.... |
<vulnerable_code>import java.nio.ByteBuffer;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http2.hpack.HpackContext.Entry;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
int huff = 0xff & buffer.get();
assertTrue((0x80 & huff) == 0x80);
int len... |
<vulnerable_code>import java.util.Locale;
import java.util.stream.Stream;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.TypeUtil;
import org.hamcrest.Matchers;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
@MethodSource("data")
... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.TypeUtil;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@Test
public void testOctetsNeeded()
{
assertEquals(0, NBitInteger.octects... |
<vulnerable_code>
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http3.qpack.internal.QpackContext;
import org.eclipse.jetty.http3.qpack.internal.instruction.InsertCountIncrementInstruction;
import org.eclipse.jetty.http3.qpack.internal.instruction.SectionAckno... |
<vulnerable_code>import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http.PreEncodedHttpField;
import org.eclipse.jetty.http3.qpack.internal.EncodableEntry;
import org.eclipse.jetty.http3.qpack.internal.QpackContext;
import org.eclipse.jetty.http3.qpack.internal.St... |
<vulnerable_code>import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.PreEncodedHttpField;
import org.eclipse.jetty.http3.qpack.internal.table.Entry;
import org.eclipse.jetty.http3.qpack.internal.util.HuffmanEncoder;
import org.eclipse.jetty.http3.qpack.inter... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;
@Override
public void encode(ByteBufferPool.Lease lease)
... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.HuffmanEncoder;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;
@Override
public void encode(ByteBufferPool.Lease lease)
... |
<vulnerable_code>import java.nio.ByteBuffer;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.HuffmanEncoder;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
i... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;
@Override
public void encode(ByteBufferPool.Lease lease)
... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;
@Override
public void encode(ByteBufferPool.Lease lease)
... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.Instruction;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;
@Override
public void encode(ByteBufferPool.Lease lease)
... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.QpackException;
import org.eclipse.jetty.http3.qpack.internal.util.EncodingException;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerParser;
import org.eclipse.jetty.http3.qpack.internal.util.NBitStringParser;
/**
* Par... |
<vulnerable_code>
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http3.qpack.QpackDecoder;
import org.eclipse.jetty.http3.qpack.QpackException;
import org.eclipse.jetty.http3.qpack.internal.QpackContext;
import org.eclipse.jetty.http3.qpack.internal.metadata.Me... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.QpackException;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerParser;
/**
* Parses a stream of unframed instructions for the Encoder. These instructions are sent from the remote Decoder.<commit_title>[PATCH] Issue #955... |
<vulnerable_code>import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http3.qpack.internal.util.HuffmanEncoder;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.util.StringUtil;
public class Entry
... |
<vulnerable_code>//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.... |
<vulnerable_code>import java.util.Locale;
import java.util.stream.Stream;
import org.eclipse.jetty.http3.qpack.internal.util.HuffmanDecoder;
import org.eclipse.jetty.http3.qpack.internal.util.HuffmanEncoder;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.TypeUtil;
import org.hamcrest.Matchers;... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerParser;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.TypeUtil;
import org.junit.jupiter.api.Test;<commit_title>[PATCH] Issue #9554 - move common hpack/qpack code to jetty-http<commit_d... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerEncoder;
import org.eclipse.jetty.http3.qpack.internal.util.NBitIntegerParser;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.TypeUtil;
import org.junit.jupiter.api.Test;
@Test
p... |
<vulnerable_code>/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */
(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.creat... |
<vulnerable_code>/*!
* jQuery JavaScript Library v1.4.2
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, a... |
<vulnerable_code>/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d... |
<vulnerable_code>/*! jQuery v1.8.2 jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d=... |
<vulnerable_code>//source - http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
var ValidHostnameRegex = new RegExp("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$");
function isValidHostName(hostname) {
retur... |
<vulnerable_code>'use strict';
var assert = require('assert'),
dnsSync = require('../index');
describe('dns sync', function () {
assert.ok(ns.length >= 1);
assert.ok(ns[0].match(/^ns[0-9]+\.google\.com$/));
});
});<commit_title>[PATCH] allowing only valid rrtypes<commit_description><fixed_code... |
<vulnerable_code> ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
"usb bulk transmit failed: %d\n", ret);
usb_unanchor_urb(urb);
ret = -EINVAL;
goto err_free_urb_to_pipe;
}<commit_title>[PATCH] ath10k: fix memory leak<commit_description>In ath10k_usb_hif_tx_sg the allocated urb should be released if
usb_submit_... |
<vulnerable_code> e_phnum = get_te16(&ehdri.e_phnum);
e_shnum = get_te16(&ehdri.e_shnum);
unsigned const e_phentsize = get_te16(&ehdri.e_phentsize);
if (ehdri.e_ident[Elf32_Ehdr::EI_CLASS]!=Elf32_Ehdr::ELFCLASS32
|| sizeof(Elf32_Phdr) != e_phentsize
|| (Elf32_Ehdr::ELFDATA2MSB == ehdri.e_ident[El... |
<vulnerable_code> FileUtils.deleteFile(new File(upgradeDir, "boot/system.classpath"));
cleanAndCopy(Bootstrap.getLibDir(), new File(upgradeDir, "lib"));
for (File file: new File(Bootstrap.getSiteDir(), "avatars").listFiles()) {
if (file.isFile()) {
try {
FileUtils.copyFileToDirectory(file, new F... |
<vulnerable_code> if (StringUtils.isBlank(secondaryName))
secondaryName = primaryName;
File avatarFile = new File(Bootstrap.getSiteDir(), "avatars/generated/" + encoded + ".png");
if (!avatarFile.exists()) {
Lock avatarLock = LockUtils.getLock("generated-avatar:" + encoded);
avatarLock.lock();
@Over... |
<vulnerable_code> }
private File getCustomLogoFile() {
return new File(Bootstrap.getSiteDir(), "logo.png");
}
@Override<commit_title>[PATCH] Fix security vulnerability issue regarding site/* access<commit_description><fixed_code>
}
private File getCustomLogoFile() {
return new File(Bootstrap.getSiteDir(), ... |
<vulnerable_code> }
private File getLogoFile() {
return new File(Bootstrap.getSiteDir(), "logo.png");
}
@Override<commit_title>[PATCH] Fix security vulnerability issue regarding site/* access<commit_description><fixed_code>
}
private File getLogoFile() {
return new File(Bootstrap.getSiteDir(), "assets/log... |
<vulnerable_code>package io.onedev.server.product;
import java.util.EnumSet;
import javax.inject.Inject;
* Configure a servlet to serve contents under site folder. Site folder can be used
* to hold site specific web assets.
*/
ServletHolder fileServletHolder = new ServletHolder(new FileAssetServlet(Boo... |
<vulnerable_code> with Measure(self._clock, "check_host_in_room"):
return await self._store.is_host_joined(room_id, host)
async def check_restricted_join_rules(
self,
state_ids: StateMap[str],<commit_title>[PATCH] Add `assert_host_in_room`<commit_description><fixed_code>
... |
<vulnerable_code> continue;
}
while ((n = read (input, buf, 16)))
{
zzip_write (output, buf, n);
}<commit_title>[PATCH] #68 return value of posix read(2) is signed<commit_description><fixed_code>
continue;
}
while (0 < (n = read (input, buf, 16)))
{
zzip_write (output, buf, n... |
<vulnerable_code> page_length=10, filters=None, filter_fields=None, as_dict=False):
if isinstance(filters, string_types):
filters = json.loads(filters)
if searchfield:
sanitize_searchfield(searchfield)
limit_page_length=page_length,
order_by=order_by,
ignore_permissions = True if doctype == "DocTyp... |
<vulnerable_code> ignore_permissions=False, user=None, with_comment_count=False,
join='left join', distinct=False, start=None, page_length=None, limit=None,
ignore_ifnull=False, save_user_settings=False, save_user_settings_fields=False,
update=None, add_total_row=None, user_settings=None):
if not ignore_permis... |
<vulnerable_code> self->calledPresentationSelector.size = 0;
self->callingPresentationSelector.size = 0;
while (bufPos < endPos) {
uint8_t tag = buffer[bufPos++];
int len;
bufPos = BerDecoder_decodeLength(buffer, &len, bufPos, endPos);
if (bufPos < 0) {
if (bufP... |
<vulnerable_code> }
}
break;
case SESSION_DATA:
if (DEBUG_ISO_SERVER)<commit_title>[PATCH] - fix - server crashes when presentation message has no user<commit_description><fixed_code>
}
}
... |
<vulnerable_code> // [databind#2688]: apache/drill
s.add("oadd.org.apache.xalan.lib.sql.JNDIConnectionPool");
DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);
}
<commit_title>[PATCH] Block one more gadget type (weblogic/oracle-aqjms)<commit_description>Merged from FasterXML/jac... |
<vulnerable_code>from django.core.exceptions import ImproperlyConfigured
from django.http.response import HttpResponseForbidden
from django.utils.encoding import force_str, force_text
from django.utils.http import urlencode
from django.utils.translation import ugettext_lazy as _
# Instead of redirecting to... |
<vulnerable_code>from django.core.exceptions import ValidationError
from django.http import HttpResponseRedirect, JsonResponse
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from shuup.apps.provides import get_provide_objects
try:
handler = self.get_co... |
<vulnerable_code>from collections import OrderedDict
from django.core.exceptions import ImproperlyConfigured
from django.http.response import Http404
from shuup.front.basket import get_basket
from shuup.utils.django_compat import reverse
return phase
if not phase.should_skip() and not p... |
<vulnerable_code>from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.http.response import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.i18n import set_language
from itertools import chain
def _not_here_yet(request, *args, **kwar... |
<vulnerable_code>from django.core.exceptions import ValidationError
from shuup.utils.django_compat import force_text
for obj in obj_list:
if isinstance(obj, ValidationError):
for msg in obj.messages:
yield force_text(msg)
continue
if isinstance(obj, Exceptio... |
<vulnerable_code>
urlpatterns = [
url(r"^xtheme/editor/$", EditorView.as_view(), name="xtheme_editor"),
url(r"^xtheme/(?P<view>.+)/*$", extra_view_dispatch, name="xtheme_extra_view"),
url(r"^xtheme/$", command_dispatch, name="xtheme"),
url(
r"^xtheme-prod-hl/(?P<plugin_type>.*)/(?P<cutoff_days>\... |
<vulnerable_code># This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.http.response import HttpResponseRedirect
from shuup.utils.excs import Problem
from shuup.xtheme.editing import set_edit_mode
response = handle_command(re... |
<vulnerable_code>import json
from django.http.response import HttpResponse, HttpResponseRedirect
from django.middleware.csrf import get_token
from django.utils.http import urlencode
from django.utils.translation import ugettext_lazy as _
from django.views.generic import TemplateView
if command:
disp... |
<vulnerable_code>from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.http.response import HttpResponseNotFound
from shuup.xtheme._theme import get_current_theme
theme = getattr(request, "theme", None) or get_current_theme(request.shop)
view_func ... |
<vulnerable_code> return -1;
}
gdGetBuf(conversion_buffer, image_block_size, ctx);
while (buffer_caret < image_block_size) {
tga->bitmap[buffer_caret] = (int) conversion_buffer[buffer_caret];
return -1;
}
gdGetBuf( conversion_buffer, image_block_size, ctx );
buffer_caret = 0;
<commit_title>[PATC... |
<vulnerable_code><commit_title>[PATCH] security fix xss: escape all special html characters before<commit_description><fixed_code>
/*! https://mths.be/he v0.5.0 by @mathias | MIT license */
;(function(root) {
// Detect free variables `exports`.
var freeExports = typeof exports == 'object' && exports;
// Detect fre... |
<vulnerable_code> 'Replacing with "unknown". This may be a bug or a database corruption.');
}
const authorClass = `author-${msg.userId.replace(/[^a-y0-9]/g, (c) => {
if (c === '.') return '-';
return `z${c.charCodeAt(0)}z`;<commit_title>[PATCH] escape userId before setting it as ... |
<vulnerable_code> * @param {Function} [fn] - Set the handler method.
*/
export function handler (type, name, fn) {
if (arguments.length > 2) {
handlers[type][name] = fn
}<commit_title>[PATCH] Fix prototype pollution vulnerability (#23)<commit_description>* Fix prototype pollution vulnerability
* Update .travi... |
<vulnerable_code> t.same(res.body, {links: [{icon: 'path to icon'}]}, 'should respond with correct object')
})
})<commit_title>[PATCH] Fix prototype pollution vulnerability (#23)<commit_description>* Fix prototype pollution vulnerability
* Update .travis.yml<fixed_code>
t.same(res.body, {links: [{icon: ... |
<vulnerable_code>
static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
{
u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size;
int err;
smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,<commit_title>[PATCH] bpf: Fix integer overflow in prealloc_elems_and_freelist()<... |
<vulnerable_code> char *msg;
};
/* 3.8 Notification Payload */
struct ikev2_auth {
struct isakmp_gen h;
uint8_t auth_method; /* Protocol-ID */
ND_TCHECK(*ext);
UNALIGNED_MEMCPY(&e, ext, sizeof(e));
ND_PRINT((ndo," n len=%d", ntohs(e.len) - 4));
if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
ND_PRINT((ndo... |
<vulnerable_code> (curwin, curwin->w_topline, FALSE);
int skip_lines = 0;
int width1 = curwin->w_width - curwin_col_off();
if (width1 > 0) {
int width2 = width1 + curwin_col_off2();
// similar formula is used in curs_columns()
if (curwin->w_skipcol > width1)<commit_title>[PATCH] Fix codestyle.<... |
<vulnerable_code> }
(void) CloseBlob(image);
DestroyImage(RemoveFirstImageFromList(&image));
if (image_type == GIMP_GRAY)
image->type=GrayscaleType;
return(GetFirstImageInList(image));<commit_title>[PATCH] =?UTF-8?q?Check=20for=20image=20list=20before=20we=20dest?=<commit_description><fixed_code>
}
(... |
<vulnerable_code>
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gen_nn_ops
input_b, row_seq, col_seq, overlapping)
self.ass... |
<vulnerable_code> return new Promise((resolve) => {
process.nextTick(() => {
const urlSanitized = util.sanitizeShellString(url).toLowerCase();
let result = {
url: urlSanitized,
ok: false,<commit_title>[PATCH] inetChecksite() fixed vulnerability: command injection<commit_description><fi... |
<vulnerable_code> if (!bounce_buf)
return -ENOMEM;
if (copy_in) {
ret = copy_from_user(bounce_buf, (void __user *)buf, len);
if (ret)
memset(bounce_buf, 0, len);
}
*bounce_buf_ret = bounce_buf;
hgcm_call_add_pagelist_size(bounce_buf, len, extra);
return 0;
}<commit_title>[PATCH] virt: vbox: fix memory le... |
<vulnerable_code> goto unlock;
}
if (!list_empty(&timer->open_list_head)) {
timeri = list_entry(timer->open_list_head.next,
struct snd_timer_instance, open_list);
if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) {
err = -EBUSY;
timeri = NULL;
goto unlock;
}
}<commit_title>[PATCH] ALSA: timer: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.