text stringlengths 79 3.72M |
|---|
<vulnerable_code> if (deep &&
type.object(t[k]) &&
!(t[k] instanceof Monkey) &&
!isPrototypePolluted(k)) {
o[k] = merger(true, o[k] || {}, t[k]);
}
else {
})();
export {uniqid};
/**
* Blacklist certain keys to prevent Prototype Pollution
* @param {any} key - O... |
<vulnerable_code>#include "string.h"
#include "autoconf.h"
static inline void init_keys(at91_aes_key_size_t *key_size,
unsigned int *cipher_key,
unsigned int *cmac_key,
unsigned int *iv)
{
#if defined(CONFIG_AES_KEY_SIZE_128)
*key_size = AT91_AES_KEY_SIZE_128;
#elif defined(CONFIG_AES_KEY_SIZ... |
<vulnerable_code>const _ = require('lodash');
/**
* Iterates over connection object, replacing any template strings with values from user
} else {
const value = connection[key];
if (typeof value === 'string') {
_.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
const compiled = _.temp... |
<vulnerable_code> if (cachedResponse) {
core.debug('ℹ using cached response');
}
for (const line of value.split('\n')) {
if (line.length > 0) {
command.issue('add-mask', line);
}<commit_title>[PATCH] Don't include carriage return characters in m... |
<vulnerable_code> .replace(/[\0\u0008\u001B\u009B]/gu, "")
.replace(/\r?\n|\r/gu, " ")
.replace(/\^/gu, "^^")
.replace(/(["&<>|])/gu, "^$1");
}
/**
return arg
.replace(/[\0\u0008\u001B\u009B]/gu, "")
.replace(/\r?\n|\r/gu, " ")
.replace(/"/gu, `""`);
}
<commit_title>[PATCH] Escape `%` for ... |
<vulnerable_code> expected: { interpolation: "a$b$c", noInterpolation: "a$b$c" },
},
],
"ampersands ('&')": [
{
input: "a&b",
expected: { interpolation: "a`$b`$c", noInterpolation: "a`$b`$c" },
},
],
"ampersands ('&')": [
{
input: "a&b",
exp... |
<vulnerable_code> if (!CDROM_CAN(CDC_SELECT_DISC) || arg == CDSL_CURRENT)
return media_changed(cdi, 1);
if ((unsigned int)arg >= cdi->capacity)
return -EINVAL;
info = kmalloc(sizeof(*info), GFP_KERNEL);<commit_title>[PATCH] cdrom: information leak in cdrom_ioctl_media_changed()<commit_description>This cast is w... |
<vulnerable_code>#include "filter.h"
#include "linker.h"
#include "packer.h"
#include "p_mach.h"
#include "ui.h"
// We simplify arbitrarily by compressing only the __TEXT segment,
// which must be the first segment.
static const unsigned lc_segment[2] = {
0x1, 0x19
//Mach_command::LC_SEGMENT,
//Mach_comma... |
<vulnerable_code> int height = im->sy;
uint32 *buffer;
uint32 rgba;
/* switch off colour merging on target gd image just while we write out
* content - we want to preserve the alpha data until the user chooses
return GD_FAILURE;
}
TIFFReadRGBAImage(tif, width, height, buffer, 0);
for(y = 0; y < height; y++... |
<vulnerable_code><commit_title>[PATCH] [CVE-2016-6911]: Fix invalid read in<commit_description><fixed_code>
/*
We're testing that reading corrupt TIFF files doesn't cause any memory issues,
and that the operation gracefully fails (i.e. gdImageCreateFromTiffPtr() returns
NULL).
*/
#include "gd.h"
#include "gdtest.h"
... |
<vulnerable_code>
switch (this.dialect) {
case 'mysql':
/**
* Sub paths need to be quoted as ECMAScript identifiers
* https://bugs.mysql.com/bug.php?id=81896
*/
paths = paths.map(subPath => Utils.addTicks(subPath, '"'));
pathStr = this.escape(['$'].concat(pat... |
<vulnerable_code>'use strict';
const _ = require('lodash');
const Utils = require('../../utils');
const MySQLQueryGenerator = require('../mysql/query-generator');
const util = require('util');
class MariaDBQueryGenerator extends MySQLQueryGenerator {
createSchema(schema, options) {
options = Object.assign({
... |
<vulnerable_code> // Parse nested object
if (smth.conditions) {
const conditions = this.parseConditionObject(smth.conditions).map(condition =>
`${this.quoteIdentifier(condition.path[0])}->>'$.${_.tail(condition.path).join('.')}' = '${condition.value}'`
);
return conditions.... |
<vulnerable_code>'use strict';
const Utils = require('../../utils');
const util = require('util');
const Transaction = require('../../transaction');
const _ = require('lodash');
const MySqlQueryGenerator = require('../mysql/query-generator');
handleSequelizeMethod(smth, tableName, factory, options, prepend) {
i... |
<vulnerable_code> });
});
it('should properly escape the single quotes in array', function() {
return this.Model.create({
data: {<commit_title>[PATCH] fix(sequelize.json.fn): use common path extraction for<commit_description><fixed_code>
});
});
... |
<vulnerable_code> it('condition object', () => {
expectsql(sql.whereItemQuery(undefined, Sequelize.json({ id: 1 })), {
postgres: '("id"#>>\'{}\') = \'1\'',
sqlite: "json_extract(`id`, '$') = '1'",
mariadb: "json_unquote(json_extract(`id`,'$.')) = '1'",
my... |
<vulnerable_code> it('sequelize.json("profile.id"), sequelize.cast(2, \'text\')")', function() {
expectsql(sql.whereItemQuery(undefined, this.sequelize.json('profile.id', this.sequelize.cast('12346-78912', 'text'))), {
postgres: "(\"profile\"#>>'{id}') = CAST('12346-78912' AS TEXT)",
... |
<vulnerable_code> // apply tooltips
if(field.tooltip) {
try {
var tooltipHtml = field.tooltip;
// classification-store tooltips are already translated
... |
<vulnerable_code>const ImplV2 = artifacts.require('DummyImplementationV2');
const ProxyAdmin = artifacts.require('ProxyAdmin');
const TransparentUpgradeableProxy = artifacts.require('TransparentUpgradeableProxy');
contract('ProxyAdmin', function (accounts) {
const [proxyAdminOwner, newAdmin, anotherAccount] = accoun... |
<vulnerable_code> client.setAttribute(SamlConfigAttributes.SAML_FORCE_NAME_ID_FORMAT_ATTRIBUTE, Boolean.toString(val));
}
public boolean forceArtifactBinding(){
return "true".equals(resolveAttribute(SamlConfigAttributes.SAML_ARTIFACT_BINDING));
}<commit_title>[PATCH] KEYCLOAK-19177 Disable E... |
<vulnerable_code> String SAML_ENCRYPTION_PRIVATE_KEY_ATTRIBUTE = "saml.encryption." + CertificateInfoHelper.PRIVATE_KEY;
String SAML_ASSERTION_LIFESPAN = "saml.assertion.lifespan";
String SAML_ARTIFACT_BINDING_IDENTIFIER = "saml.artifact.binding.identifier";
}<commit_title>[PATCH] KEYCLOAK-19177 Disable ECP ... |
<vulnerable_code> client.setForceNameIDFormat(false);
}
if (rep.getSamlServerSignature() == null) {
client.setRequiresRealmSignature(true);
}<commit_title>[PATCH] KEYCLOAK-19177 Disable ECP flow by default for all Saml<commit_description><fixed_code>
client.se... |
<vulnerable_code> return getAttributes().get(SamlConfigAttributes.SAML_FORCE_NAME_ID_FORMAT_ATTRIBUTE);
}
public String getSamlArtifactBinding() {
if (getAttributes() == null) return null;
return getAttributes().get(SamlConfigAttributes.SAML_ARTIFACT_BINDING);<commit_title>[PATCH] KEYCLO... |
<vulnerable_code>import org.keycloak.models.UserSessionModel;
import org.keycloak.models.utils.DefaultAuthenticationFlows;
import org.keycloak.protocol.saml.JaxrsSAML2BindingBuilder;
import org.keycloak.protocol.saml.SamlConfigAttributes;
import org.keycloak.protocol.saml.SamlProtocol;
import org.keycloak.protocol.saml... |
<vulnerable_code>package org.keycloak.testsuite.saml;
import org.junit.Test;
import org.keycloak.dom.saml.v2.protocol.ResponseType;
import org.keycloak.dom.saml.v2.protocol.StatusResponseType;
import org.keycloak.protocol.saml.SamlConfigAttributes;
import org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHo... |
<vulnerable_code>import java.util.List;
import java.util.Map;
import org.keycloak.representations.idm.ClientRepresentation;
import org.keycloak.testsuite.console.page.clients.CreateClientForm;
import org.keycloak.testsuite.console.page.fragment.OnOffSwitch;
public static final String SAML_ASSERTION_CONSUMER_UR... |
<vulnerable_code>import static org.keycloak.testsuite.auth.page.login.OIDCLogin.SAML;
import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettingsForm.SAML_AUTHNSTATEMENT;
import static org.keycloak.testsuite.console.page.clients.settings.ClientSettingsForm.SAMLClientSettings... |
<vulnerable_code> $scope.samlEncrypt = false;
$scope.samlForcePostBinding = false;
$scope.samlForceNameIdFormat = false;
$scope.samlXmlKeyNameTranformer = $scope.xmlKeyNameTranformers[1];
$scope.disableAuthorizationTab = !client.authorizationServicesEnabled;
$scope.disableServiceAccountRolesTab =... |
<vulnerable_code>
#ifdef XFSDUMP
if (g_str_equal(argv[0], "xfsdump"))
dump_program = XFSDUMP;
else /* strcmp(argv[0], "xfsdump") != 0 */
#endif
#endif
#if defined(DUMP)
dump_program = DUMP;
validate_dump_option(argc, argv);
# endif
# endif
#endif
/*<commit_title>[PATCH] Updat... |
<vulnerable_code>#!/usr/bin/env python
from .helper import PillowTestCase
from PIL import Image
repro = ('Tests/images/sgi_overrun_expandrowF04.bin',
'Tests/images/sgi_crash.bin',
)
class TestSgiCrashes(PillowTestCase):
def test_crashes(self):
for path in repro:
with open(pat... |
<vulnerable_code>from tensorflow.python.eager import def_function
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 resource_variable_ops
from tensorflow.python.ops import script_ops
from... |
<vulnerable_code> endp++;
memmove(line, endp, strlen(endp) + 1);
for (i = 0; i < ctx->msgcount; i++)
if (mutt_str_strcmp(line, ctx->hdrs[i]->data) == 0)
break;<commit_title>[PATCH] Ensure UID in fetch_uidl<commit_description><fixed_code>
endp++;
memmove(line, endp, strlen(endp) + 1);
/* uid m... |
<vulnerable_code>
this.processContent = function processContent (content, query) {
var output
content = '<div>' + content + '</div>'
content = $(content).mark(query)
// Split content by sentence.
var sentences = content.html().replace(/(\.+|:|!|\?|\r|\n)("*|'*|\)*|}*|]*)/gm, '|').spli... |
<vulnerable_code> var expectedResults = ' … This is <mark data-markjs="true">test</mark> sentence one … This is <mark data-markjs="true">test</mark> sentence two … This is <mark data-markjs="true">test</mark> sentence three … This is <mark data-markjs="true">test</mark> sentence four … This is <mark data-markjs="t... |
<vulnerable_code> : ApplicationFeature(server, "ServerSecurity"),
_enableFoxxApi(true),
_enableFoxxStore(true),
_hardenedRestApi(false) {
setOptional(false);
startsAfter<application_features::GreetingsFeaturePhase>();
}
arangodb::options::Flags::OnCoordinator,
... |
<vulnerable_code> TRI_V8_TRY_CATCH_END
}
static void JS_RunInRestrictedContext(
v8::FunctionCallbackInfo<v8::Value> const& args) {
TRI_V8_TRY_CATCH_BEGIN(isolate)
TRI_AddGlobalFunctionVocbase(
isolate, TRI_V8_ASCII_STRING(isolate, "SYS_IS_FOXX_STORE_DISABLED"),
JS_IsFoxxStoreDisabled, true);
TRI... |
<vulnerable_code> return {source: `${baseUrl}${splitted[1]}/archive/${splitted[2] || 'master'}.zip`};
}
if (/^https?:/i.test(appInfo)) {
return {source: appInfo};
}
if (/^uploads[/\\]tmp-/.test(appInfo)) {<commit_title>[PATCH] [APM-78] Disable installation from remote URL (#15292)<commit_description><fix... |
<vulnerable_code> statisticsInAllDatabases: internal.enabledStatisticsInAllDatabases(),
foxxStoreEnabled: !internal.isFoxxStoreDisabled(),
foxxApiEnabled: !internal.isFoxxApiDisabled(),
clusterApiJwtPolicy: internal.clusterApiJwtPolicy(),
minReplicationFactor: internal.minReplicationFactor,... |
<vulnerable_code> if (!frontendConfig.foxxStoreEnabled) {
delete menus.Store;
}
menus[activeKey].active = true;
if (disabled) {<commit_title>[PATCH] [APM-78] Disable installation from remote URL (#15292)<commit_description><fixed_code>
if (!frontendConfig.foxxStoreEnabled) {
... |
<vulnerable_code> this.navigate('#dashboard', { trigger: true });
return;
}
window.modalView.clearValidators();
if (this.serviceUrlView) {
this.serviceUrlView.remove();<commit_title>[PATCH] [APM-78] Disable installation from remote URL (#15292)<commit_description><fi... |
<vulnerable_code> // / @brief expose configuration
// //////////////////////////////////////////////////////////////////////////////
if (global.SYS_IS_FOXX_API_DISABLED) {
exports.isFoxxApiDisabled = global.SYS_IS_FOXX_API_DISABLED;
delete global.SYS_IS_FOXX_API_DISABLED;
}
if (global.SYS_IS_FOXX_STO... |
<vulnerable_code> return global.ArangoServerState.isFoxxmaster();
}
// Startup and self-heal
function selfHealAll (skipReloadRouting) {
_buildServiceBundleFromScript(tempServicePath, tempBundlePath, serviceInfo);
} else if (/^https?:/i.test(serviceInfo)) {
// Remote path
const tempFile = downlo... |
<vulnerable_code><commit_title>[PATCH] [APM-78] Disable installation from remote URL (#15292)<commit_description><fixed_code>
/*jshint globalstrict:false, strict:false */
/* global getOptions, assertEqual, assertTrue, assertFalse, arango */
//////////////////////////////////////////////////////////////////////////////... |
<vulnerable_code><commit_title>[PATCH] [APM-78] Disable installation from remote URL (#15292)<commit_description><fixed_code>
/*jshint globalstrict:false, strict:false */
/* global getOptions, assertEqual, assertFalse, arango */
////////////////////////////////////////////////////////////////////////////////
/// DISCL... |
<vulnerable_code> rndis_set_cmplt_type *resp;
rndis_resp_t *r;
r = rndis_add_response(params, sizeof(rndis_set_cmplt_type));
if (!r)
return -ENOMEM;
resp = (rndis_set_cmplt_type *)r->buf;
BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset);
#ifdef VERB... |
<vulnerable_code>
time_t now=time(NULL);
struct tm * gmt=gmtime(&now);
verbprintf(0, "FLEX: %04i-%02i-%02i %02i:%02i:%02i %i/%i/%c %02i.%03i [%010] NUM ", gmt->tm_year+1900, gmt->tm_mon+1, gmt->tm_mday, gmt->tm_hour, gmt->tm_min, gmt->tm_sec,
flex->Sync.baud, flex->Sync.levels, PhaseNo, flex->FIW.cycleno, ... |
<vulnerable_code>}
char* belle_sip_string_to_backslash_less_unescaped_string(const char* buff) {
char *output_buff=belle_sip_malloc(strlen(buff)+1);
unsigned int i;
unsigned int out_buff_index=0;
for(i=0; buff[i] != '\0'; i++) {
if (buff[i] == '\\') {
i++;/*skip \*/
}
/*make sure to only remove one \ in ... |
<vulnerable_code> /*Dialog created by notify matching subscription are still in NULL state if (obj->state==BELLE_SIP_DIALOG_NULL) belle_sip_fatal("_belle_sip_dialog_match() must not be used for dialog in null state.");*/
dcid=belle_sip_header_call_id_get_call_id(obj->call_id);
return strcmp(dcid,call_id)==0
&& strc... |
<vulnerable_code> * This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2021-05-13 15:53:11
* - for the lexer : belle_sip_messageLexerLexer
*
* Editing it, at least manually, i... |
<vulnerable_code> * This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2021-05-13 15:53:10
* - for the parser : belle_sip_messageParserParser
*
* Editing it, at least manually,... |
<vulnerable_code> if (belle_sip_message_is_request(msg)){
const belle_sip_list_t *rroutes;
/*probably better to be in channel*/
fix_outgoing_via(prov, chan, msg);
for (rroutes=belle_sip_message_get_headers(msg,"Record-Route");rroutes!=NULL;rroutes=rroutes->next){
belle_sip_header_record_route_t* rr=(belle_s... |
<vulnerable_code> BC_ASSERT_STRING_EQUAL(belle_generic_uri_get_scheme(L_absoluteUri), "tel");
BC_ASSERT_STRING_EQUAL(belle_sip_header_from_get_tag(L_from),"dlfjklcn6545614XX");
belle_sip_object_unref(L_from);
}
static void test_to_header_with_paramless_address_spec(void) {<commit_title>[PATCH] =?UTF-8?q?-fix=20via=... |
<vulnerable_code>import org.citydb.core.util.Util;
import org.citydb.util.concurrent.SingleWorkerPool;
import org.citydb.util.log.Logger;
import org.citygml4j.builder.jaxb.CityGMLBuilder;
import org.citygml4j.xml.schema.SchemaHandler;
import org.xml.sax.InputSource;
wfsConfig = registry.lookup(WFSConfig.class);
ex... |
<vulnerable_code>package vcs.citydb.wfs.config;
import org.citydb.config.ConfigUtil;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.SchemaOutputResolver;
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
File file;
if (namespaceUri.equals(ConfigUtil.C... |
<vulnerable_code>import org.citydb.core.operation.exporter.util.InternalConfig;
import org.citydb.core.operation.exporter.writer.FeatureWriteException;
import org.citydb.util.log.Logger;
import org.citygml4j.model.module.Module;
import org.citygml4j.model.module.ModuleContext;
import org.citygml4j.model.module.Modules;... |
<vulnerable_code>import net.opengis.fes._2.FilterType;
import net.opengis.fes._2.ResourceIdType;
import net.opengis.wfs._2.*;
import org.citygml4j.builder.jaxb.CityGMLBuilder;
import org.citygml4j.model.module.citygml.CityGMLModule;
import org.citygml4j.model.module.citygml.CityGMLModuleType;
import javax.xml.parsers.S... |
<vulnerable_code>
import vyper.ast as vy_ast
from vyper.compiler.phases import CompilerData
from vyper.semantics.namespace import RESERVED_KEYWORDS
def _valid_identifier(attr):<commit_title>[PATCH] fix an import<commit_description><fixed_code>
import vyper.ast as vy_ast
from vyper.compiler.phases import CompilerData... |
<vulnerable_code> /**
* A cookie attribute was found.
*/
ATTRIBUTE_PRESENCE("https://www.rfc-editor.org/rfc/rfc6265#section-4.2.1", "A cookie attribute is present");
private final String url;
private final String description;
/**
* A CookieCompliance mode that ... |
<vulnerable_code>import static org.eclipse.jetty.http.CookieCompliance.Violation.COMMA_NOT_VALID_OCTET;
import static org.eclipse.jetty.http.CookieCompliance.Violation.COMMA_SEPARATOR;
import static org.eclipse.jetty.http.CookieCompliance.Violation.ESCAPE_IN_QUOTES;
import static org.eclipse.jetty.http.CookieCompliance... |
<vulnerable_code>
// lenient with spaces and EOF
Arguments.of("abc=", "abc", ""),
Arguments.of("abc = ", "abc", ""),
Arguments.of("abc = ;", "abc", ""),
Arguments.of("abc = ; ", "abc", ""),<commit_title>[PATCH] New CookieCutter<commit_description>ignorable whi... |
<vulnerable_code> assertCookie("Cookies[1]", cookies[1], "session_id", "1111", 1, null);
cookies = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie);
assertThat("Cookies.length", cookies.length, is(2));
assertCookie("Cookies[0]", cookies[0], "session_id", "1234", 0, null);
... |
<vulnerable_code> assert_tx_failed(lambda: c.abi_decode(abi.encode("(bytes)", (b"a" * 22,))))
@pytest.mark.parametrize(
"output_typ,input_",
[<commit_title>[PATCH] fix lint tests<commit_description><fixed_code>
assert_tx_failed(lambda: c.abi_decode(abi.encode("(bytes)", (b"a" * 22,))))
@pytest.mark.... |
<vulnerable_code>
import java.util.Collections;
import java.util.Iterator;
import java.util.function.Supplier;
public class MetaData implements Iterable<HttpField>
return _fields.iterator();
}
@Override
public String toString()
{<commit_title>[PATCH] Use ISO-8859-1 for encoding/decoding in huf... |
<vulnerable_code> }
}
}
}<commit_title>[PATCH] Use ISO-8859-1 for encoding/decoding in huffman/hpack/qpack<commit_description>Signed-off-by: Lachlan Roberts <lachlan@webtide.com><fixed_code>
}
}
}
public static boolean isIllegalCharacter(char c)
{
return (... |
<vulnerable_code>
import java.nio.ByteBuffer;
import org.eclipse.jetty.util.Utf8StringBuilder;
import static org.eclipse.jetty.http.compression.Huffman.rowbits;
import static org.eclipse.jetty.http.compression.Huffman.rowsym;
return decoded;
}
private final Utf8StringBuilder _utf8 = new Utf8StringBui... |
<vulnerable_code> encode(CODES, buffer, b);
}
public static int octetsNeededLC(String s)
{
return octetsNeeded(LCCODES, s);
}
public static void encodeLC(ByteBuffer buffer, String s)
{
encode(LCCODES, buffer, s);
}
for (int i = 0; i < len; i++)
{
... |
<vulnerable_code>
import java.nio.ByteBuffer;
public class NBitStringParser
{
private final NBitIntegerParser _integerParser;
private final HuffmanDecoder _huffmanBuilder;
private final StringBuilder _stringBuilder;
private boolean _huffman;
private int _count;
private int _length;
{
... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack;
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.util.Locale;
import java.util.stream.Stream;
import org.eclipse.jetty.http.compression.HuffmanDecoder;... |
<vulnerable_code>// ========================================================================
//
package org.eclipse.jetty.http3.qpack;
import java.nio.ByteBuffer;
<commit_title>[PATCH] Use ISO-8859-1 for encoding/decoding in huffman/hpack/qpack<commit_description>Signed-off-by: Lachlan Roberts <lachlan@webtide.com><f... |
<vulnerable_code>import org.eclipse.jetty.http.compression.NBitIntegerParser;
import org.eclipse.jetty.http2.hpack.HpackContext.Entry;
import org.eclipse.jetty.util.BufferUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final HpackContext _context;
private final MetaDataBuilder _builder;... |
<vulnerable_code>package org.eclipse.jetty.http2.hpack;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashSet;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http.Pr... |
<vulnerable_code> else
{
buffer.put((byte)0x80);
NBitIntegerEncoder.encode(buffer, 7, HuffmanEncoder.octetsNeededLC(name));
HuffmanEncoder.encodeLC(buffer, name);
}
HpackEncoder.encodeValue(buffer, huffman, value);<commit_title>[PATCH] Use ISO-8859-1 f... |
<vulnerable_code> }
@Test
public void encodeDecodeNonAscii() throws Exception
{
HpackEncoder encoder = new HpackEncoder();
HpackDecoder decoder = new HpackDecoder(4096, 8192);
ByteBuffer buffer = BufferUtil.allocate(16 * 1024);
HttpFields fields0 = HttpFields.build()
... |
<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>//
// ========================================================================
// 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>package org.eclipse.jetty.http3.qpack.internal;
import java.nio.ByteBuffer;
import java.util.Objects;
import org.eclipse.jetty.http.HttpField;
{
buffer.put((byte)0x00);
NBitIntegerEncoder.encode(buffer, 7, value.length());
buffer.put(value.g... |
<vulnerable_code>package org.eclipse.jetty.http3.qpack.internal.instruction;
import java.nio.ByteBuffer;
import org.eclipse.jetty.http.compression.HuffmanEncoder;
import org.eclipse.jetty.http.compression.NBitIntegerEncoder;
{
buffer.put((byte)(0x00));
NBitIntegerEncoder.encode(buffer,... |
<vulnerable_code>package org.eclipse.jetty.http3.qpack.internal.instruction;
import java.nio.ByteBuffer;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.compression.HuffmanEncoder;
{
buffer.put((byte)(0x40));
NBitIntegerEncoder.encode(buffer, 5, _name.length());
... |
<vulnerable_code><commit_title>[PATCH] Use ISO-8859-1 for encoding/decoding in huffman/hpack/qpack<commit_description>Signed-off-by: Lachlan Roberts <lachlan@webtide.com><fixed_code>
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and othe... |
<vulnerable_code>static word last_fo_entries = 0;
static word last_bytes_finalized = 0;
/* Collect or expand heap in an attempt make the indicated number of */
/* free blocks available. Should be called until the blocks are */
/* available (setting retry value to TRUE unless this is the first call */
... |
<vulnerable_code>
function merge(target, obj) {
for (var key in obj) {
if (key === '__proto__' || !hasOwn(obj, key)) {
continue;
}
function isObject(val) {
return typeOf(val) === 'object' || typeOf(val) === 'function';
}<commit_title>[PATCH] add isValidKey function to ensure only valid keys are merge... |
<vulnerable_code>
xls_error_t xls_parseWorkBook(xlsWorkBook* pWB)
{
BOF bof1 = { .id = 0, .size = 0 };
BOF bof2 = { .id = 0, .size = 0 };
BYTE* buf = NULL;
static xls_error_t xls_preparseWorkSheet(xlsWorkSheet* pWS)
{
BOF tmp;
BYTE* buf = NULL;
xls_error_t retval = LIBXLS_OK;
xls_error_t xls_p... |
<vulnerable_code> pmt->program->pcr_pid = ((data[0] & 0x1f) << 8) | data[1];
info_length = ((data[2]&0xf)<<8) | data[3];
if (info_length != 0) {
/* ...Read Descriptors ... */
u8 tag, len;
u32 first_loop_len = 0;
len = data[5];
while (info_length > first_loop_len) {
if (tag == GF_M2TS_MPEG4_IOD_DESCRIPTO... |
<vulnerable_code> }
}
@SuppressWarnings("unchecked")
@Override
protected void executeBusinessLogic() throws ConnectorException {
configureProxy();
getTransformer().transform(new DOMSource(responseDocumentBody), new StreamResult(System.err));
}
} catch ... |
<vulnerable_code>#define READ(val) \
(*(val + 0) + (*(val + 1) << 8) + (*(val + 2) << 16) + (*(val + 3) << 24))
#define name_CASE \
switch(LOWER_DWORD(val)) { \
#define user_CASE \
p += 4; \
val = READ(p); \
name_CASE; \
go... |
<vulnerable_code><commit_title>[PATCH 01/14] Implement cgroups support in OSMemoryInfo<commit_description>Signed-off-by: chinrank <thrillpool1@gmail.com><fixed_code>
/*
* Copyright 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file ex... |
<vulnerable_code> if (operatingSystem.isMacOsX()) {
delegate = new NativeOsMemoryInfo();
} else if (operatingSystem.isLinux()) {
delegate = new MemInfoOsMemoryInfo();
} else {
delegate = new MBeanOsMemoryInfo();
}
}
@Override
public OsMemor... |
<vulnerable_code> String memTotalString = Files.asCharSource(new File(CGROUP_MEM_TOTAL_FILE), Charset.defaultCharset()).readFirstLine();
memUsage = Long.parseLong(memUsageString);
memTotal = Long.parseLong(memTotalString);
memAvailable = memTotal - memUsage;
} catc... |
<vulnerable_code>
package org.gradle.process.internal.health.memory;
import com.google.common.io.Files;
import java.io.File;
@Override
public OsMemoryStatus getOsSnapshot() {
long memUsage;
long memTotal;
long memAvailable;
try {
String memUsageString = Files.asCh... |
<vulnerable_code> } catch (IOException e) {
throw new UnsupportedOperationException("Unable to read system memory from " + MEMINFO_FILE_PATH, e);
}
OsMemoryStatusSnapshot memInfo = getOsSnapshotFromMemInfo(meminfoOutputLines);
if (memInfo.getFreePhysicalMemory() < 0 || memInfo... |
<vulnerable_code> // There are some finalized nodes that are also members
// For each member, determine which finalized nodes to wait for
ImmutableMap.Builder<Node, MemberSuccessors> blockingNodesBuilder = ImmutableMap.builder();
for (Node member : members) {
if (isFinalizerNo... |
<vulnerable_code>
// Determine whether any dependencies of a finalized node are also members, in which case treat the dependency as if it were a finalized member
Set<Node> dependenciesThatAreMembers = getDependenciesThatAreMembers(blockedFinalizedMembers);
dependenciesThatAreMembers.stream()
... |
<vulnerable_code> return dependencyNodes.getDependencySuccessors();
}
public SortedSet<Node> getFinalizers() {
return dependentNodes.getFinalizers();
}<commit_title>[PATCH 01/14] Implement cgroups support in OSMemoryInfo<commit_description>Signed-off-by: chinrank <thrillpool1@gmail.com><fixe... |
<vulnerable_code>
import java.util.NavigableSet;
import java.util.Set;
import static org.gradle.execution.plan.NodeSets.newSortedNodeSet;
);
}
public abstract TaskInternal getTask();
protected void deprecateLifecycleHookReferencingNonLocalTask(String hookName, Node taskNode) {<commit_title>[PATC... |
<vulnerable_code> // For each member, determine which finalized nodes to wait for
ImmutableMap.Builder<Node, MemberSuccessors> blockingNodesBuilder = ImmutableMap.builder();
// Determine whether any dependencies of a finalized node are also members, in which case treat the dependency as if it we... |
<vulnerable_code> if (members.contains(toNode) && !blockedFinalizedMembers.contains(toNode)) {
dependenciesThatAreMembers.add(toNode);
}
toNode.visitHardSuccessors(queue::add);
}
}
return dependenciesThatAreMembers;<commit_ti... |
<vulnerable_code> @Nullable
private ElementSuccessors successors;
private boolean finalizedNodeHasStarted;
public FinalizerGroup(TaskNode node, NodeGroup delegate) {
this.ordinal = delegate.asOrdinal();
}
public void scheduleMembers(SetMultimap<FinalizerGroup, FinalizerGroup> reachableG... |
<vulnerable_code>import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.SetMultimap;
import javax.annotation.Nullable;
import java.util.ArrayList;
Set<Node> seen = new HashSet<>(1024);
for (Node fromNode : blockedFinalizedMembers) {
... |
<vulnerable_code> Set<Node> dependenciesThatAreMembers = new HashSet<>(members.size());
Set<Node> seen = new HashSet<>(1024);
for (Node fromNode : blockedFinalizedMembers) {
ArrayDeque<Node> queue = new ArrayDeque<>(1024);
queue.add(fromNode);
while (!queue.is... |
<vulnerable_code>import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.SetMultimap;
import kotlin.collections.ArrayDeque;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;<commit_ti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.