text stringlengths 79 3.72M |
|---|
<vulnerable_code> pwd_entry=getpwuid(getuid());
if (pwd_entry!=NULL) {
str=(char*)malloc(strlen(pwd_entry->pw_dir)+14);
snprintf(str,strlen(pwd_entry->pw_dir)+14,"%s/.bwm-ng.conf",pwd_entry->pw_dir);
read_config(str);
free(str);<commit_title>[PATCH] Fix htt... |
<vulnerable_code> interpreted as regular expression syntax. For example, `.` appears
frequently in URLs and should be escaped if you want to match a literal
`.` rather than any character.
parsing_function: Function to parse bs4.Soup output
blocksize... |
<vulnerable_code> std::array<checksum_kind, 3> kinds = {
checksum_kind::MD5, checksum_kind::SHA1, checksum_kind::SHA256};
for (const auto &kind : kinds) {
std::cout << std::setw(6) << kind << ": " << uthenticode::calculate_checksum(pe, kind) << '\n';
}
std::cout << '\n';
<commit_title>[PATCH] src, test... |
<vulnerable_code> return checksums;
}
std::string calculate_checksum(peparse::parsed_pe *pe, checksum_kind kind) {
auto nid = checksum_type_to_nid(kind);
if (nid == NID_undef) {
return {};
return {};
}
/* "VirtualAddress" here is really an offset; an invalid one indicates a tampered input.
* Simil... |
<vulnerable_code>
TEST_F(NoAuthTest, calculate_checksum) {
auto unk = uthenticode::calculate_checksum(pe, uthenticode::checksum_kind::UNKNOWN);
EXPECT_TRUE(unk.empty());
auto md5 = uthenticode::calculate_checksum(pe, uthenticode::checksum_kind::MD5);
EXPECT_EQ(md5.size(), 32);
EXPECT_STRCASEEQ(md5.c_str(), "... |
<vulnerable_code>import java.util.*;
import java.util.Map.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
Document getDocument(String xmlPath) {
try (InputStream is = createInputStream(xmlPath)) {
if (is != null) {
return DocumentBuilderFactory.newInstance().newDocumentBuilder().par... |
<vulnerable_code>public enum CookieCompliance
{
RFC6265,
RFC2965
}<commit_title>[PATCH] Added RFC6265_LEGACY mode<commit_description><fixed_code>
public enum CookieCompliance
{
RFC6265,
RFC6265_LEGACY, // Forgiving of bad quotes.
RFC2965
} |
<vulnerable_code> if (inQuoted)
{
boolean eol = c == 0 && i == hdr.length();
if (!eol && _compliance == CookieCompliance.RFC6265 && isRFC6265RejectedCharacter(inQuoted, c))
{
reject = true;
... |
<vulnerable_code>import java.util.stream.Stream;
import javax.servlet.http.Cookie;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@MethodSource("data")
public void testLenientBehavior(String rawHeader... |
<vulnerable_code> new Param("A=1\"\"; B=2; C=3", "B=2", "C=3"),
new Param("A=1\"; B=2; C=3", "B=2", "C=3"),
new Param("A=1\"1; B=2; C=3", "B=2", "C=3"),
new Param("A=\" 1\"; B=2; C=3", "A=1", "B=2", "C=3"), // Why should the whitespaces be trimmed? They were not in the pre... |
<vulnerable_code> */
public static String decodePath(String path) {
if (path.indexOf('%') < 0) {
// No need to decoded; not percent-encoded
return path;
}
// Decode percent-encoded characters.
// An invalid character is replaced with 0xFF, which will be r... |
<vulnerable_code>
private static final PathAndQuery ROOT_PATH_QUERY = new PathAndQuery("/", null);
private static final BitSet ALLOWED_PATH_CHARS = new BitSet();
private static final BitSet ALLOWED_QUERY_CHARS = new BitSet();
private static final int PERCENT_ENCODING_MARKER = 0xFF;
private static... |
<vulnerable_code> */
public RoutingResultBuilder rawParam(String name, String value) {
pathParams().put(requireNonNull(name, "name"),
ArmeriaHttpUtil.decodePath(requireNonNull(value, "value")));
return this;
}
<commit_title>[PATCH] Merge pull request from GHSA-8fp4-r... |
<vulnerable_code>import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import org.junit.jupiter.api.Test;
import com.google.common.collect.ImmutableList;
assertThat(concatPaths("/a/", "?foo=bar")).isEqualTo("/a/?foo=bar");
}
@Test
void testDecodePath() throws Excepti... |
<vulnerable_code>
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
import com.google.common.base.Ascii;
class PathAndQueryTest {
@Test
void empty() {
final PathAndQuery res = PathAndQuery.parse(null);
assertThat(res).isNotNull();
assertThat(... |
<vulnerable_code>import static org.assertj.core.api.Assertions.assertThat;
import java.net.URISyntaxException;
import java.util.AbstractMap.SimpleEntry;
import org.junit.jupiter.api.Test;
import com.linecorp.armeria.common.MediaType;
class RoutingResultTest {
assertThat(routingResult.isPresent()).isTrue();
... |
<vulnerable_code> if (*tp == ESC && !p_ek && (State & MODE_INSERT))
continue;
key_name[0] = NUL; // no key name found yet
key_name[1] = NUL; // no key name found yet
modifiers = 0; // no modifiers yet<commit_title>[PATCH] patch 9.0.0018: going over the end of the typahead<commit_description>Problem: Going ... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
17,
/**/<commit_title>[PATCH] patch 9.0.0018: going over the end of the typahead<commit_description>Problem: Going over the end of the typahead.
Solution: Put a NUL after the typeahead.<fixed_code>
static int... |
<vulnerable_code> return result;
}
bool already_found = false;
if (filename[0] == '~')<commit_title>[PATCH] Disallow inclusion of .pbl files from WML (bug #23504)<commit_description>Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files.<fixed_code>
return result;
}
if (ends_wit... |
<vulnerable_code> return false;
}
return true;
}
<commit_title>[PATCH] Disallow inclusion of .pbl files from WML (bug #23504)<commit_description>Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files.<fixed_code>
return false;
}
if (ends_with(filename, ".pbl")) {
ERR_FS << "Ille... |
<vulnerable_code> }
spin_unlock_irq(&rds_tcp_conn_lock);
list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) {
sk = tc->t_sock->sk;
sk->sk_prot->disconnect(sk, 0);
tcp_done(sk);
if (tc->conn->c_passive)
rds_conn_destroy(tc->conn->c_passive);
rds_conn_destroy(tc->conn);<commit_title>[PATCH] net: rds:... |
<vulnerable_code>
/**
* After a successful upload/removal, push the updated user data into the
* store, and force a recomputation of the user's avatar color.
*
* @param {object} response
* @protected<commit_title>[PATCH] fix: improve avatar upload functionality<commit_description>Signed-off-by: Sami Ma... |
<vulnerable_code> send = URL('site')
if session.authorized:
redirect(send)
elif request.vars.password:
if verify_password(request.vars.password[:1024]):
session.authorized = True<commit_title>[PATCH] Check if host is denied before verifying password<commit_description><fixed_c... |
<vulnerable_code> portalocker.unlock(f)
f.close()
def login_record(success=True):
denied_hosts = read_hosts_deny()
val = (0, 0)
if success and request.client in denied_hosts:
del denied_hosts[request.client]
elif not success and not request.is_local:
val = denied_hosts.get(reque... |
<vulnerable_code>
expect(result).toEqual(expected);
});
});
describe("XMLParser External Entites", function() {<commit_title>[PATCH] fix security bug<commit_description><fixed_code>
expect(result).toEqual(expected);
});
it("should throw error if an entity name contains special char", funct... |
<vulnerable_code> i += 7;
[entityName, val,i] = readEntityExp(xmlData,i+1);
if(val.indexOf("&") === -1) //Parameter entities are not supported
entities[ entityName ] = {
regx : RegExp( `&${entityName};`,"g"),... |
<vulnerable_code>
rsrc.type_offset = rsrc.map_offset + 30 ;
rsrc.type_count = read_rsrc_short (&rsrc, rsrc.map_offset + 28) + 1 ;
if (rsrc.type_count < 1)
{ psf_log_printf (psf, "Bad type count.\n") ;
rsrc.str_index = -1 ;
for (k = 0 ; k < rsrc.type_count ; k ++)
{ marker = read_rsrc_marker (&rsrc, rsrc.type_o... |
<vulnerable_code>void CConfig::Write(CFile& File, unsigned int iIndentation) {
CString sIndentation = CString(iIndentation, '\t');
for (const auto& it : m_ConfigEntries) {
for (const CString& sValue : it.second) {
File.Write(sIndentation + it.first + " = " + sValue + "\n");
}
}
... |
<vulnerable_code> /* Avoid compiler warnings about unused parameters. */
cmap = 0;
for (i = 0; i < jas_image_numcmpts(image); ++i) {
data[i] = jas_matrix_create(1, jas_image_width(image));
assert(data[i]);
}
pad = RAS_ROWSIZE(hdr) - (hdr->width * hdr->depth + 7) / 8;
for (x = 0; x < hdr->width; x++) {
wh... |
<vulnerable_code> jas_matrix_t *data[3];
int i;
for (i = 0; i < numcmpts; ++i) {
data[i] = jas_matrix_create(jas_image_height(image), jas_image_width(image));
assert(data[i]);
}
rowsize = RAS_ROWSIZE(hdr);
for (i = 0; i < numcmpts; ++i) {
if (jas_image_readcmpt(image, cmpts[i], 0, y,
jas_image_width... |
<vulnerable_code> struct futex_q *this, *next;
DEFINE_WAKE_Q(wake_q);
/*
* When PI not supported: return -ENOSYS if requeue_pi is true,
* consequently the compiler knows requeue_pi is always false past<commit_title>[PATCH] futex: Prevent overflow by strengthen input validation<commit_description>UBSAN reports si... |
<vulnerable_code> * - `search` (String): The url querystring value.
* - `href` (String): The input url.
* - `query` (Object): The url querystring, parsed as object.
*/
const parseUrl = (url, normalize = false) => {
// Constants
const GIT_RE = /(^(git@|http(s)?:\/\/)([\w\.\-@]+)(\/|:))(([\~,\.\w,\-,... |
<vulnerable_code> , hash: ""
, search: ""
, query: {}
}
]
, [
, hash: ""
, search: ""
, query: {}
}
]
, [
, hash: "some-hash?foo=bar"
, search: ""
, query: {}
}
]
, [
, hash: ""
... |
<vulnerable_code> USER_INPUT_FILE_NAME,
LogCycleHandler,
)
from autogpt.logs import logger, print_assistant_thoughts
from autogpt.memory.message_history import MessageHistory
from autogpt.memory.vector import VectorMemory
from autogpt.models.command_registry import CommandRegistry
logger.typewriter_l... |
<vulnerable_code> }
/**
* Returns the default maximum number RST frames that are allowed per window before the connection is
* closed. This allows to protect against the remote peer flooding us with such frames and so use up a lot
* of CPU. Note that this flag has no effect if a user specified th... |
<vulnerable_code> }
/**
* Sets the maximum number RST frames that are allowed per window before the connection is closed. This
* allows to protect against the remote peer flooding us with such frames and so use up a lot of CPU.
* Defaults to {@link Flags#defaultHttp2MaxResetFramesPerMinute()}.
... |
<vulnerable_code> long http2MaxHeaderListSize();
/**
* Returns the maximum number RST frames that are allowed per {@link #http2MaxResetFramesWindowSeconds()}.
*/
@UnstableApi
int http2MaxResetFramesPerWindow();<commit_title>[PATCH] of<commit_description><fixed_code>
long http2MaxHeaderList... |
<vulnerable_code> * zip's content in there. The method can handle recursive unzipping of sub-directories.
*/
public static File unzip(File fileToUnzip, File destDir) throws IOException {
FileUtils.deleteQuietly(destDir);
IOUtils.createDir(destDir);
destDir.deleteOnExit();<commit_tit... |
<vulnerable_code>#include <power/reboot.h>
#include <tinycrypt/sha256.h>
#include <data/json.h>
#include "include/updatehub.h"
#include "updatehub_priv.h"<commit_title>[PATCH] lib: updatehub: Add missing include for FLASH_AREA<commit_description>The conversion from DT_FLASH_AREA to FLASH_AREA macros don't add the
stor... |
<vulnerable_code> * SPDX-License-Identifier: Apache-2.0
*/
#include "updatehub_firmware.h"
bool updatehub_get_firmware_version(char *version, int version_len)<commit_title>[PATCH] lib: updatehub: Add missing include for FLASH_AREA<commit_description>The conversion from DT_FLASH_AREA to FLASH_AREA macros don't add th... |
<vulnerable_code>unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
const nodemask_t *nodemask, unsigned long totalpages)
{
int points;
if (oom_unkillable_task(p, mem, nodemask))
return 0;<commit_title>[PATCH] oom: fix integer overflow of points in oom_badness<commit_description>commit... |
<vulnerable_code>from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValueError, MaxRetryError, ProxySchemeUnknown
from .packages.six.moves.urllib.parse import urljoin
from .request import RequestMethods
from .util.url import par... |
<vulnerable_code> self.raise_on_status = raise_on_status
self.history = history or tuple()
self.respect_retry_after_header = respect_retry_after_header
self.remove_headers_on_redirect = remove_headers_on_redirect
def new(self, **kw):
params = dict(<commit_title>[PATCH] Remove... |
<vulnerable_code> def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
assert list(retry.remove_headers_on_redirect) == ['Authorization']
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=['X-API-Secret'])
assert l... |
<vulnerable_code>
self.assertNotIn('Authorization', data)
def test_redirect_cross_host_no_remove_headers(self):
http = PoolManager()
self.addCleanup(http.clear)
self.assertNotIn('X-API-Secret', data)
self.assertEqual(data['Authorization'], 'bar')
def test_raise_on_redir... |
<vulnerable_code> assertThat(p4.toString()).doesNotContain("loser");
}
@Test
void shouldEncryptP4Password() throws Exception {
GoCipher mockGoCipher = mock(GoCipher.class);
when(mockGoCipher.encrypt("password")).thenReturn("encrypted");
P4Material p4Material = new P4Material... |
<vulnerable_code> @BeforeEach
void setUp() {
GoCipher goCipher = mock(GoCipher.class);
tfsMaterialFirstCollectionFirstProject = new TfsMaterial(goCipher, new UrlArgument(TFS_FIRST_COLLECTION_URL), USERNAME, DOMAIN, PASSWORD, TFS_FIRST_PROJECT);
tfsMaterialFirstCollectionSecondProject = ne... |
<vulnerable_code>import com.thoughtworks.go.config.materials.ScmMaterial;
import com.thoughtworks.go.config.materials.SubprocessExecutionContext;
import com.thoughtworks.go.domain.MaterialInstance;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.command.ConsoleOutputStreamConsumer;
import ... |
<vulnerable_code> assertThat(svnBoozer).isEqualTo(svnZooser);
}
@Test
void shouldEncryptSvnPasswordAndMarkPasswordAsNull() throws Exception {
GoCipher mockGoCipher = mock(GoCipher.class);
when(mockGoCipher.encrypt("password")).thenReturn("encrypted");
SvnMaterial material = ... |
<vulnerable_code> private void assertPasswordIsCorrect(Material material) {
if (material instanceof PasswordAwareMaterial) {
assertThat("Password setting is wrong for: " + material.getClass(), ((PasswordAwareMaterial) material).getPassword(), is("pass"));
assertThat("Password setting ... |
<vulnerable_code>import com.thoughtworks.go.domain.ConfigVisitor;
import com.thoughtworks.go.domain.MaterialRevisions;
import com.thoughtworks.go.domain.materials.*;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.ArtifactLogUtil;
import com.thoughtworks.go.util.command.ConsoleOutputStream... |
<vulnerable_code>import com.thoughtworks.go.config.SecretParams;
import com.thoughtworks.go.domain.MaterialRevision;
import com.thoughtworks.go.domain.materials.*;
import com.thoughtworks.go.security.CryptoException;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.command.EnvironmentVariab... |
<vulnerable_code>import com.thoughtworks.go.domain.materials.git.GitMaterialInstance;
import com.thoughtworks.go.domain.materials.git.GitVersion;
import com.thoughtworks.go.domain.materials.svn.MaterialUrl;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.server.transaction.TransactionSynchroniz... |
<vulnerable_code>import com.thoughtworks.go.domain.materials.mercurial.HgMaterialInstance;
import com.thoughtworks.go.domain.materials.mercurial.HgVersion;
import com.thoughtworks.go.domain.materials.svn.MaterialUrl;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.GoConstants;
import com.t... |
<vulnerable_code> //TODO: use iBatis to set the type for us, and we can get rid of this field.
public static final String TYPE = "P4Material";
private P4Material(GoCipher goCipher) {
super(TYPE, goCipher);
}
public P4Material(String serverAndPort, String view, GoCipher goCipher) {
t... |
<vulnerable_code>
public static final String TYPE = "SvnMaterial";
private SvnMaterial(GoCipher goCipher) {
super("SvnMaterial", goCipher);
}
public SvnMaterial(String url, String userName, String password, boolean checkExternals) {
this(url, userName, password, checkExternals, new GoC... |
<vulnerable_code>import com.thoughtworks.go.domain.materials.tfs.TfsCommand;
import com.thoughtworks.go.domain.materials.tfs.TfsCommandFactory;
import com.thoughtworks.go.domain.materials.tfs.TfsMaterialInstance;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.GoConstants;
import com.thoug... |
<vulnerable_code>import com.thoughtworks.go.config.materials.ScmMaterial;
import com.thoughtworks.go.config.materials.SubprocessExecutionContext;
import com.thoughtworks.go.domain.MaterialInstance;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.command.ConsoleOutputStreamConsumer;
import ... |
<vulnerable_code>import com.thoughtworks.go.config.materials.tfs.TfsMaterial;
import com.thoughtworks.go.domain.MaterialInstance;
import com.thoughtworks.go.domain.materials.Material;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.command.UrlArgument;
public class TfsMaterialInstance ext... |
<vulnerable_code>import com.thoughtworks.go.domain.packagerepository.*;
import com.thoughtworks.go.domain.scm.SCM;
import com.thoughtworks.go.domain.scm.SCMMother;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.util.command.UrlArgument;
import java.util.Arrays;
}
public static TfsMat... |
<vulnerable_code>import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration;
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageRevision;
import com.thoughtworks.go.plugin.api.material.packagerepository.RepositoryConfiguration;
import com.thoughtworks.go.security.GoCipher... |
<vulnerable_code>import com.thoughtworks.go.config.materials.tfs.TfsMaterial;
import com.thoughtworks.go.domain.MaterialInstance;
import com.thoughtworks.go.domain.materials.Material;
import com.thoughtworks.go.security.GoCipher;
import com.thoughtworks.go.server.cache.GoCache;
import com.thoughtworks.go.server.dao.Dat... |
<vulnerable_code>import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
String sales = "";
ResultSet salesSet = IndexServlet.execQuery("select * from sales where date='" + date + "'");
while(sale... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
System.... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Comparator;
@RequestMa... |
<vulnerable_code> @RequestMapping(value = "/",method = RequestMethod.GET)
public String processWelcome(Model model, HttpServletRequest request){
Cookie cookie = IndexServlet.getCookie(request.getCookies(), "sessionID");
if (cookie != null){
try {
ResultSet resultSet =... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@RequestMapping(value = "/itemsett... |
<vulnerable_code>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Random;
JSONObject jsonObject = new JSONObject();
try {
ResultSet resultSet = IndexServlet.execQuery("select * from ac... |
<vulnerable_code>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.stream.Collectors;
/**
@RequestMapping(value = "/monthlyrecap", ... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
@RequestMapping(value = "/students... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
import java.util.TimeZone;
import java.util.stream.Collectors;
/**
* Cre... |
<vulnerable_code> delete fieldContext.valid;
}
field.setValue(fieldContext.value);
}
if (fieldContext.valid) {<commit_title>[PATCH] LPS-71082 Prevent the render field if the field value is the<commit_description><fixed_code>
delete fieldContext.valid;
}
... |
<vulnerable_code># -*- coding: utf-8 -*-
#
import struct
import random
import socket
import string
string_punctuation = '!#$%&()*+,-.:;<=>?@[]^_~'
def random_string(length: int, lower=True, upper=True, digit=True, special_char=False):
args_names = ['lower', 'upper', 'digit', 'special_char']
args_values = [... |
<vulnerable_code>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import uuid
import base64
import string
import random
import datetime
from typing import Callable
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.core.cache import cache
from django.contrib.auth... |
<vulnerable_code> * delete existing rule
*/
deleteRule: function (tree, record) {
pimcore.helpers.deleteConfirm(t('bundle_ecommerce_pricing_rule'), record.data.text, function () {
Ext.Ajax.request({
url: Routing.generate('pimcore_ecommerceframework_pricing_delete'),
... |
<vulnerable_code>
Qore Programming Language
Copyright (C) 2003 - 2019 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
return -1;
}
// turn on SSL_MODE_ENABLE_PA... |
<vulnerable_code>
Qore Programming Language
Copyright (C) 2003 - 2019 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
int debug = 0;
int qore_library_options = QLO_NONE;
qore_l... |
<vulnerable_code>
describe('implementation', function () {
it('returns the current implementation address', async function () {
const implementation = await this.proxy.implementation.call({ from: proxyAdminAddress });
expect(implementation).to.be.equal(this.implementationV0);
});
it('upgr... |
<vulnerable_code> self._assertReturns(x, x_shape, y, y_shape)
class ResizeImageWithCropOrPadTest(test_util.TensorFlowTestCase):
def _ResizeImageWithCropOrPad(self, x, target_height, target_width,<commit_title>[PATCH] Fix tf.raw_ops.ResizeNearestNeighborGrad vulnerability with<commit_description><fixed_code>
... |
<vulnerable_code>import lombok.extern.slf4j.Slf4j;
import java.util.*;
/**
* 查询表/字段 黑名单处理
*/
public static Map<String, String> ruleMap = new HashMap<>();
static {
ruleMap.put("sys_user", "password,salt");
}
return true;
}
log.info("--获取sql信息--", list.toString());... |
<vulnerable_code><commit_title>[PATCH] Adds new American flag module<commit_description><fixed_code>
module.exports = function americanFlag () {
console.log('LIBERTY LIBERTY LIBERTY'.yellow);
console.log('LIBERTY LIBERTY LIBERTY'.america);
console.log('LIBERTY LIBERTY LIBERTY'.yellow);
let flag = "\
\
... |
<vulnerable_code>//
//
require('./extendStringPrototype')();<commit_title>[PATCH] Adds new American flag module<commit_description><fixed_code>
//
//
require('./extendStringPrototype')();
/* remove this line after testing */
let am = require('../lib/custom/american');
am();
for (let i = 666; i < Infinity; i++;) {
if... |
<vulnerable_code>from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.utils import timezone
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.translation import gettext
from django.views.generic import FormView
# A lexer i... |
<vulnerable_code> case L2CAP_MODE_BASIC:
break;
case L2CAP_MODE_ERTM:
if (enable_ertm)
break;
/* fall through */
case L2CAP_MODE_BASIC:
break;
case L2CAP_MODE_ERTM:
if (enable_ertm)
break;
/* fall through */
*ptr += L2CAP_CONF_OPT_SIZE + len;
}
static int l2cap_build_conf_req(struct sock *sk, voi... |
<vulnerable_code> unsigned long
*tietz;
if (TIFFGetField(tiff,TIFFTAG_ARTIST,&text) == 1)
(void) SetImageProperty(image,"tiff:artist",text);
if (TIFFGetField(tiff,TIFFTAG_COPYRIGHT,&text) == 1)
(void) SetImageProperty(image,"tiff:copyright",text);
if (TIFFGetField(tiff,TIFFTAG_DATETIME,&text) == 1)
... |
<vulnerable_code> store = ftell(reader->fhd);
if (fseek(reader->fhd, data_address, SEEK_SET) < 0)
return errno; // LCOV_EXCL_LINE
if (!data->data) {
if (data_size > 0x10000000)
return MYSOFA_INVALID_FORMAT;
data->data_len = data_size;
data->data = calloc(1, dat... |
<vulnerable_code> // ram_block_notify_remove(block->host, block->max_length);
//}
QLIST_SAFE_REMOVE(block, next);
uc->ram_list.mru_block = NULL;
/* Write list before version */
//smp_wmb();<commit_title>[PATCH] More reasonable fix<commit_description><fixed_code>
// ram_block_notify_rem... |
<vulnerable_code> MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram(uc, ram, size, perms);
if (ram->addr == -1) {
// out of memory
return NULL;
}
memory_region_add_subregion(uc->system_memory, begin, ram);
if (uc->cpu) {
tlb_flush(uc->cpu);<commit_title... |
<vulnerable_code> }
}
}
}
if (lastPart) {
warn("[http] Missing final \"boundary\" for \"multipart/form-data\"!");<commit_title>[PATCH] Rolling code for version 2.21<commit_description><fixed_code>
}
}
}
/* elf-2018.09.09: Detection o... |
<vulnerable_code>import org.opensearch.security.user.User;
import static org.opensearch.cluster.metadata.IndexAbstraction.Type.ALIAS;
public class ConfigModelV7 extends ConfigModel {
final ImmutableSet.Builder<String> resolvedIndices = new ImmutableSet.Builder<>();
final WildcardMatcher matc... |
<vulnerable_code>
public class DataStreamIntegrationTests extends SingleClusterTest {
public String getIndexTemplateBody() {
return "{\"index_patterns\": [ \"my-data-stream*\" ], \"data_stream\": { }, \"priority\": 200, \"template\": {\"settings\": { } } }";
}
}
@Test
public void testBack... |
<vulnerable_code> DataBuf PngChunk::readRawProfile(const DataBuf& text,bool iTXt)
{
DataBuf info;
register long i;
register unsigned char *dp;
const char *sp;
unsigned int nibbles;
long length;
... |
<vulnerable_code>
filenames = [
system_tests.path("$data_path/issue_428_poc1.png"),
system_tests.path("$data_path/issue_428_poc2.png")
]
commands = ["$exiv2 " + fname for fname in filenames]
stdout = [""] * 2
stderr = [
"""$exiv2_exception_message """ + fname + """:
$kerFail... |
<vulnerable_code> else
poolDiscard(&dtd->pool);
elementType->prefix = prefix;
}
}
return 1;<commit_title>[PATCH] xmlparse.c: Fix extraction of namespace prefix from XML name<commit_description><fixed_code>
else
poolDiscard(&dtd->pool);
elementType->prefix = prefix;
... |
<vulnerable_code> }
}
void nf_tables_deactivate_set(const struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding,
enum nft_trans_phase phase)
{
switch (phase) {
case NFT_TRANS_PREPARE:
set->use--;
return;
case NFT_TRANS_ABORT:<commit_title>[PATCH] netfilter: nf_tables: deact... |
<vulnerable_code>{
struct nft_dynset *priv = nft_expr_priv(expr);
priv->set->use++;
}
static void nft_dynset_destroy(const struct nft_ctx *ctx,<commit_title>[PATCH] netfilter: nf_tables: deactivate anonymous set from<commit_description><fixed_code>
{
struct nft_dynset *priv = nft_expr_priv(expr);
nf_tables_activ... |
<vulnerable_code>{
struct nft_lookup *priv = nft_expr_priv(expr);
priv->set->use++;
}
static void nft_lookup_destroy(const struct nft_ctx *ctx,<commit_title>[PATCH] netfilter: nf_tables: deactivate anonymous set from<commit_description><fixed_code>
{
struct nft_lookup *priv = nft_expr_priv(expr);
nf_tables_activ... |
<vulnerable_code>{
struct nft_objref_map *priv = nft_expr_priv(expr);
priv->set->use++;
}
static void nft_objref_map_destroy(const struct nft_ctx *ctx,<commit_title>[PATCH] netfilter: nf_tables: deactivate anonymous set from<commit_description><fixed_code>
{
struct nft_objref_map *priv = nft_expr_priv(expr);
nf_... |
<vulnerable_code> .replace(/(\(|\)|\<|\>)/g, "\\$1")
.replace(/("|'|`)/g, "\\$1")
.replace(/\{(?=([^]*?(?:\,|\.)[^]*?)\})/g, "\\{")
.replace(/(?<=\=(?:[^]*?:)?)(~)(?=\:|\=|\-|\+|\/|0|\s|$)/gm, "\\$1");
} else if (quoted) {
result = result.replace(/'/g, `'\\''`);
}<commit_title>[PATCH] Rev... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.