text stringlengths 79 3.72M |
|---|
<vulnerable_code> value = 'Unassigned';
}
$('#' + key + 'InputContainer span.help-inline').html(
'<a class="editval text-primary" onclick="page.toggleVal(this); return false;" data-tstate=n... |
<vulnerable_code>
const PORT = 8086;
const DEFAULT_INACTIVITY_TIMEOUT = 10000;
const [,, originalPath, flags] = process.argv;
let path = originalPath;
errorCount += result.failedExpectations.length;
}
reporter.specDone(result);
});
await page.exposeFunction('jasmineDone', async() => {
reporter.ja... |
<vulnerable_code> colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: true,
});
};<commit_title>[PATCH] Create an GH Actions workflow covering testing of<commit_description><fixed_code>
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
... |
<vulnerable_code> * @understands a source control repository and its configuration
*/
public abstract class ScmMaterialConfig extends AbstractMaterialConfig implements ParamsAttributeAware {
public static final String URL = "url";
public static final String USERNAME = "username";
protected GoCipher goCiph... |
<vulnerable_code> if (StringUtils.isBlank(getServerAndPort())) {
errors.add(SERVER_AND_PORT, "P4 port cannot be empty.");
}
validateEncryptedPassword();
}
@Override<commit_title>[PATCH] #000 - Validate URLs provided<commit_description>- Disallow URLs which are obviously not U... |
<vulnerable_code>
import java.net.URI;
import java.net.URISyntaxException;
import static com.thoughtworks.go.util.ExceptionUtils.bombIfNull;
import static org.apache.commons.lang3.StringUtils.isBlank;
@ConfigAttributeValue(fieldName = "url")
public class UrlArgument extends CommandArgument {
protected String url;... |
<vulnerable_code>import java.util.Collections;
import java.util.HashMap;
import static com.thoughtworks.go.config.materials.ScmMaterialConfig.AUTO_UPDATE;
import static com.thoughtworks.go.config.materials.ScmMaterialConfig.FOLDER;
import static org.assertj.core.api.Assertions.assertThat;
class ScmMaterialConfigTest ... |
<vulnerable_code> assertFalse(validating(gitMaterialConfig).errors().containsKey(GitMaterialConfig.URL));
}
private GitMaterialConfig validating(GitMaterialConfig git) {
git.validate(new ConfigSaveValidationContext(null));
return git;<commit_title>[PATCH] #000 - Valid... |
<vulnerable_code>import static com.thoughtworks.go.config.materials.AbstractMaterialConfig.MATERIAL_NAME;
import static com.thoughtworks.go.config.materials.ScmMaterialConfig.FOLDER;
import static com.thoughtworks.go.config.materials.ScmMaterialConfig.URL;
import static com.thoughtworks.go.helper.MaterialConfigsMother.... |
<vulnerable_code>import com.thoughtworks.go.config.materials.Filter;
import com.thoughtworks.go.config.materials.IgnoredFiles;
import com.thoughtworks.go.config.materials.ScmMaterialConfig;
import com.thoughtworks.go.config.materials.svn.SvnMaterialConfig;
import com.thoughtworks.go.domain.materials.MaterialConfig;
imp... |
<vulnerable_code>
import static com.thoughtworks.go.helper.MaterialConfigsMother.svn;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
class SvnMaterialConfigTest {
assertThat(svnMaterialConfig.errors().on(SvnMaterialConfig.FOLDER)).isEqualTo("Dest folder '../... |
<vulnerable_code>import static com.thoughtworks.go.helper.MaterialConfigsMother.tfs;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Mockito.*;
class TfsMaterialConfigTest {
assertThat(tfsMaterialConfig.errors().on(URL... |
<vulnerable_code> return tfs(goCipher, new UrlArgument(url), userName, domain, null, projectPath);
}
public static TfsMaterialConfig tfs(UrlArgument urlArgument, String password, String encryptedPassword, GoCipher goCipher) {
TfsMaterialConfig tfsMaterialConfig = tfs(goCipher, urlArgument, null,... |
<vulnerable_code> assertThat(result).doesNotContain("cce:password");
}
}
}<commit_title>[PATCH] #000 - Validate URLs provided<commit_description>- Disallow URLs which are obviously not URLs.<fixed_code>
assertThat(result).doesNotContain("cce:password");
}
}
@Nested
... |
<vulnerable_code>
public void checkConnection(UrlArgument repoUrl) {
final String ref = fullUpstreamRef();
final CommandLine commandLine = git().withArgs("ls-remote").withArg(repoUrl).withArg(ref);
final ConsoleResult result = commandLine.runOrBomb(new NamedProcessTag(repoUrl.forDisplay()));... |
<vulnerable_code>
@unittest.skipUnless(hasattr(os, 'setgroups'), 'no setgroups() on platform')
def test_extra_groups(self):
gid = os.getegid()
group_list = [65534 if gid != 65534 else 65533]
name_group = _get_test_grp_name()
perm_error = False
if grp is not None:
... |
<vulnerable_code>#endif
#ifdef HAVE_SETGROUPS
if (extra_group_size > 0)
POSIX_CALL(setgroups(extra_group_size, extra_groups));
#endif /* HAVE_SETGROUPS */
#ifdef HAVE_SETREGID
pid_t pid = -1;
int need_to_reenable_gc = 0;
char *const *argv = NULL, *const *envp = NULL;
Py_ssize_t extra_group... |
<vulnerable_code> *opacity++=ScaleQuantumToChar((Quantum) (GetPixelAlpha(image,p)));
p+=GetPixelChannels(image);
}
count+=EncodeImage(image,scanline,bytes_per_line & 0x7FFF,
packed_scanline);
if (image->previous == (Image *) NULL)
{
... |
<vulnerable_code> image->colors=viff_info.map_columns;
if (AcquireImageColormap(image,image->colors,exception) == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
viff_colormap=(unsigned char *) AcquireQuantumMemory(image->colors,
viff_info.map_r... |
<vulnerable_code> throw new NullPointerException();
}
if (offset < 0 || offset + length > b.length) {
throw new ArrayIndexOutOfBoundsException();
}
<commit_title>[PATCH] Fix integer overflow leading to out-of-bounds read/write<commit_description><fixed_code>
throw new NullPointerException(... |
<vulnerable_code>
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', "Test only valid in LMS")
@patch('django.core.mail.send_mail')
@ddt.data(('Crazy Awesome Site', 'Crazy Awesome Site'), (None, 'edX'))
@ddt.unpack
def test_reset_password_email_site(self, site_name, platform_name, send_email)... |
<vulnerable_code>
expect(await this.mock.quorumNumerator()).to.be.bignumber.equal(newRatio);
expect(await this.mock.quorumDenominator()).to.be.bignumber.equal('100');
expect(await time.latestBlock().then(blockNumber => this.mock.quorum(blockNumber.subn(1))))
.to.be.bignumber.equal(tokenSupply.... |
<vulnerable_code> gate_seal.seal(sealables, sender=sealing_committee)
with reverts("gate seal: expired"):
gate_seal.seal(sealables, sender=sealing_committee)<commit_title>[PATCH] test: raw_call returns actual success<commit_description><fixed_code>
gate_seal.seal(sealables, sender=sealing_committee)
... |
<vulnerable_code> size_t datalen, int macstate)
{
int rc = 0;
char *message = NULL;
char *language = NULL;
size_t message_len = 0;
size_t language_len = 0;
LIBSSH2_CHANNEL *channelp = NULL;
case SSH_MSG_DISCONNECT:
if(datalen >= 5) {
size_t... |
<vulnerable_code>
void iwjson_ftoa(long double val, char buf[static IWNUMBUF_SIZE], size_t *out_len) {
// TODO: review
int len = snprintf(buf, 64, "%.8Lf", val);
if (len <= 0) {
buf[0] = '\0';
*out_len = 0;<commit_title>[PATCH] * Fixed Github Vulnerability Report GHSL-2022-066<commit_description><fixed_co... |
<vulnerable_code>
for item in imports:
try:
logging.warning('Import named "%s" not found locally. Trying to resolve it at the PyPI server.', item)
response = requests.get(
"{0}{1}/json".format(pypi_server, item), proxies=proxy)
if response.status_code == 2... |
<vulnerable_code>};
#endif /* INFORMATION_ONLY */
static unsigned short get_ushort(const unsigned char *data)
{
unsigned short val = *(const unsigned short *)data;
#ifdef OPJ_BIG_ENDIAN
val = ((val & 0xffU) << 8) | (val >> 8);
#endif
return val;
}
#define TGA_HEADER_SIZE 18
id_len = tga[0];
/*cmap... |
<vulnerable_code> eq(self.object.read(3), b'bar')
eq(self.object.read(3), b'baz')
class TestCommand(object):
def setUp(self):<commit_title>[PATCH 2/5] mon/OSDMonitor: enforce caps for all remaining pool ops<commit_description>Signed-off-by: Jason Dillaman <dillaman@redhat.com><fixed_code>
e... |
<vulnerable_code> goto _cjose_jwe_decrypt_dat_aes_gcm_fail;
}
// set the expected GCM-mode authentication tag
if (EVP_CIPHER_CTX_ctrl(ctx, CJOSE_EVP_CTRL_GCM_SET_TAG, jwe->enc_auth_tag.raw_len, jwe->enc_auth_tag.raw) != 1)
{<commit_title>[PATCH] use fixed authentication tag length of 16 octets i... |
<vulnerable_code>}
END_TEST
START_TEST(test_cjose_jwe_decrypt_rsa)
{
struct cjose_jwe_decrypt_rsa
tcase_add_test(tc_jwe, test_cjose_jwe_self_encrypt_self_decrypt_large);
tcase_add_test(tc_jwe, test_cjose_jwe_self_encrypt_self_decrypt_many);
tcase_add_test(tc_jwe, test_cjose_jwe_decrypt_aes);
tcase_... |
<vulnerable_code> });
};
/**
* Encodes a string for a use in HTML.
*
}
// Focus on either username or password when empty.
var has_name = $('#login_name').val().length;
var password_box = $('#login_password').val();
var has_password = (password_box) ? password_box.length : 0;
if (!has_na... |
<vulnerable_code> conn_offset_us -= RADIO_TICKER_JITTER_US << 1;
conn_offset_us -= RADIO_TICKER_JITTER_US;
/* Stop Advertiser */
ticker_status = ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER... |
<vulnerable_code><commit_title>[PATCH 01/35] new version on hotfixes<commit_description><fixed_code>
/*!
* Buttons helper for fancyBox
* version: 1.0.2
* @requires fancyBox v2.0 or later
*
* Usage:
* $(".fancybox").fancybox({
* buttons: {
* position : 'top'
* }
* });
*
... |
<vulnerable_code><commit_title>[PATCH 01/35] new version on hotfixes<commit_description><fixed_code>
/*!
* Thumbnail helper for fancyBox
* version: 1.0.2
* @requires fancyBox v2.0 or later
*
* Usage:
* $(".fancybox").fancybox({
* thumbs: {
* width : 50,
* height : 50
* ... |
<vulnerable_code>/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All righ... |
<vulnerable_code>/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their... |
<vulnerable_code>/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Thei... |
<vulnerable_code><commit_title>[PATCH 01/35] new version on hotfixes<commit_description><fixed_code>
/*!
* fancyBox - jQuery Plugin
* version: 2.0.4 (12/12/2011)
* @requires jQuery v1.6 or later
*
* Examples at http://fancyapps.com/fancybox/
* License: www.fancyapps.com/fancybox/#license
*
* Copyright 2011 Jan... |
<vulnerable_code><commit_title>[PATCH 01/35] new version on hotfixes<commit_description><fixed_code>
/*! fancyBox v2.0.4 fancyapps.com | fancyapps.com/fancybox/#license */
(function(u,q,e){var l=e(u),r=e(q),a=e.fancybox=function(){a.open.apply(this,arguments)},s=!1,t=null;e.extend(a,{version:"2.0.4",defaults:{padding:1... |
<vulnerable_code>/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding delt... |
<vulnerable_code> ),
(os.path.join(RESOURCE_ROOT, "imagemagick-images.pdf"), None),
(os.path.join(RESOURCE_ROOT, "imagemagick-lzw.pdf"), None),
],
ids=[
"crazyones",
"libreoffice-writer-password",
"imagemagick-images",
"imagemagick-lzw",
],
)
def test_p... |
<vulnerable_code> char cmd[512];
char *inputline = NULL;
char *proxy_auth = NULL;
char debug_buff[512];
int remaining = sizeof(cmd) - 1;
remaining -= snprintf(cmd, sizeof(cmd), "CONNECT %s:%d HTTP/1.1\r\n", host, port);
remaining -= 2;
}
strncat(cmd, "\r\n", remaining);
#ifndef DEBUG
snprintf(debug_buff, siz... |
<vulnerable_code> break;
}
if (blob == (const void *) NULL)
ThrowReaderException(OptionError,"UnrecognizedImageFormat");
image=BlobToImage(blob_info,blob,extent,exception);
blob_info=DestroyImageInfo(blob_info);
if (image == (Image *) NULL)<commit_title>[PATCH] https://github.com/ImageMagick/Im... |
<vulnerable_code>
class CustomFieldDescriptionField(CommentField):
@property
def default_helptext(self):
return "Also used as the help text when editing models using this custom field.<br>" + super().default_helptext<commit_title>[PATCH] Ruff<commit_description><fixed_code>
class CustomFieldDescript... |
<vulnerable_code> # no image maps at present
"area",
"map",
# no document-level markup at present
"article",
"aside",
"footer",
"header",
"nav",
# miscellaneous out-of-scope for now
"data",
"dfn",<commit_title>[PATCH] Ruff<commit_description><fixed_code>
# no image m... |
<vulnerable_code> return;
}
function handleResponse(json) {
response = JSON.parse(json);
var found = [];
for (var idx in response) {
found.push({
$.ajax({
method: "POST",
url: "lint.php",
data: {
sql_query: text,
to... |
<vulnerable_code> writer.writerow(headers)
writer.writerow(csv_data)
with open(log_fp, "wb") as csvfile:
csvfile.write(utils.santize_for_csv(
encryptor.encrypt(
interface.encryption_key, output.getvalue().encode()... |
<vulnerable_code>
def santize_for_csv(data: str | List[str] | List[List[str]]):
""" Sanitizes data so that it can be safely written to a CSV file. """
def sanitize(item):
return "'" + item
unsafe_prefixes = ("+", "=", "-", "@")
if isinstance(data, str):
if data.startswith(... |
<vulnerable_code> json,
launch_analytics,
readme_to_html,
version_check,
santize_for_csv,
)
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
self.assertEquals(safe_data, [["abc", "'=abc"]])
if __name__ == "__main__":
unittest.main()<commit_title>[PATCH] formatting<commit_description>F... |
<vulnerable_code> $('#profile-mapper-alerts').html('');
$.post('/profile-mapper', {
code: code.getValue()
}).always(function() {
btn.button('reset');<commit_title>[PATCH 1/8] add CSRF protection in profile mapper settings post api<commit_description><fixed_code>
$('#profile-mapper-alerts').html('');
$.... |
<vulnerable_code>var path = require('path');
var archiver = require('archiver');
var cas = require('../lib/add_certs');
var os = require('os');
var fs = require('fs');
var http = require('http');
app.use(session({
secret: 'sojo sut ed oterces le'
}));
var detected_settings = {};
if (process.platform === 'win32') {
... |
<vulnerable_code> delete req.session.LDAP_RESULTS;
});
app.post('/ldap', set_current_config, function(req, res, next) {
// Convert ENABLE_WRITE_BACK and ENABLE_ACTIVE_DIRECTORY_UNICODE_PASSWORD to boolean.
req.body.ENABLE_WRITE_BACK = !!(req.body.ENABLE_WRITE_BACK && req.body.ENABLE_WRITE_BACK === 'on');
req.bo... |
<vulnerable_code> archive.finalize();
});
app.post('/import', set_current_config, multipart(), function(req, res, next) {
console.log('Importing configuration.');
if (!req.files || !req.files.IMPORT_FILE || req.files.IMPORT_FILE.size === 0) {<commit_title>[PATCH 1/8] add CSRF protection in profile mapper setting... |
<vulnerable_code> $("#logs-clear").click(function(e) {
e.preventDefault();
$.post('/logs/clear');
$('#logs').text('');
});
<commit_title>[PATCH 1/8] add CSRF protection in profile mapper settings post api<commit_description><fixed_code>
$("#logs-clear").click(function(e) {
e.preventDefault();
$.post('/log... |
<vulnerable_code> });
});
app.post('/logs/clear', function(req, res) {
fs.writeFile(__dirname + '/../logs.log', '', function(err) {
if (err) {
res.status(500);<commit_title>[PATCH 1/8] add CSRF protection in profile mapper settings post api<commit_description><fixed_code>
});
});
app.post('/logs/clear'... |
<vulnerable_code> $("#update-run-form").submit(function(e) {
e.preventDefault();
$.post('/updater/run');
update = 'Started';
$('#update-logs').text('');<commit_title>[PATCH 1/8] add CSRF protection in profile mapper settings post api<commit_description><fixed_code>
$("#update-run-form").submit(function(e) {
... |
<vulnerable_code> archive.finalize();
});
app.post('/updater/run', set_current_config, function(req, res) {
run(__dirname + '/../update-connector.cmd', [], function(data) {
res.writeHead(200, {
"Content-Type": "text/plain"<commit_title>[PATCH 1/8] add CSRF protection in profile mapper settings post ap... |
<vulnerable_code> });
}, merge_config);
app.post('/ticket', set_current_config, function(req, res, next) {
if (!req.body.PROVISIONING_TICKET) {
return res.render('index', xtend(req.current_config, {
ERROR: 'The ticket url ' + req.body.PROVISIONING_TICKET + ' is not vaild.'<commit_title>[PATCH 1/8] add CSR... |
<vulnerable_code> });
}, merge_config);
app.post('/server', multipart(), set_current_config, function(req, res, next) {
if (req.body.PORT || req.current_config.PORT) return next();
freeport(function(er, port) {
req.body.PORT = port;<commit_title>[PATCH 1/8] add CSRF protection in profile mapper settings post ... |
<vulnerable_code> // Trim the string
string = string.trim();
// Results
var stringMatch = string.match(PARSE_STRING_REGEXP);
var infMatch = string.match(PARSE_INF_REGEXP);<commit_title>[PATCH] fix(decimal128): add basic guard against REDOS attacks<commit_description>This is a naive approach to reducing the ef... |
<vulnerable_code> history.replaceState(null, null, newSearch);
}
const isDev = window.location.hostname.match(/localhost$/);
const api = isDev ? '/graphql' : '/.netlify/functions/schema-demo';
// Render <GraphiQL /> into the body.
// See the README in the top level of this module to learn more about
// additional ch... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-x4r7-m2q9-69c8<commit_description>This change fixes an XSS vulnerability that has been present since the first
commit of GraphiQL when used with an untrusted GraphQL server. It applies three
strategies to fix via defense-in-depth: HTML escaping a strin... |
<vulnerable_code>const path = require('path');
const { graphqlHTTP } = require('express-graphql');
const schema = require('./schema');
module.exports = function beforeDevServer(app, _server, _compiler) {
// GraphQL Server
app.post('/graphql', graphqlHTTP({ schema }));
app.get(
'/graphql',
graphqlHTTP({<... |
<vulnerable_code>const path = require('path');
const { graphqlHTTP } = require('express-graphql');
const schema = require('./schema');
const app = express();
// Server
app.post('/graphql', graphqlHTTP({ schema }));
}),
);
app.use(express.static(path.resolve(__dirname, '../')));
app.listen(process.env.PORT || 0, f... |
<vulnerable_code>
printk(banner);
if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) {
printk(KERN_INFO "ipip init: can't register tunnel\n");
return -EAGAIN;
}
err = register_pernet_device(&ipip_net_ops);
if (err)
xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
return err;
}
<commit_title>[PATCH] tunne... |
<vulnerable_code>{
int err;
if (xfrm6_tunnel_register(&ip4ip6_handler, AF_INET)) {
printk(KERN_ERR "ip6_tunnel init: can't register ip4ip6\n");
err = -EAGAIN;
goto out;
}
if (xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6)) {
printk(KERN_ERR "ip6_tunnel init: can't register ip6ip6\n");
err = -EAGAIN;
... |
<vulnerable_code>
printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n");
if (xfrm4_tunnel_register(&sit_handler, AF_INET6) < 0) {
printk(KERN_INFO "sit init: Can't add protocol\n");
return -EAGAIN;
}
err = register_pernet_device(&sit_net_ops);
if (err < 0)
xfrm4_tunnel_deregister(&sit_handler, AF_INET6);
... |
<vulnerable_code> return spi % XFRM6_TUNNEL_SPI_BYSPI_HSIZE;
}
static int __init xfrm6_tunnel_spi_init(void)
{
xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi",
sizeof(struct xfrm6_tunnel_spi),
0, SLAB_HWCACHE_ALIGN,
NULL);
if (!xfrm6_tunnel_spi_kmem)
return -ENOMEM;
return 0;... |
<vulnerable_code> bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t) (1UL <<
bmp_info.bits_per_pixel),4*sizeof(*bmp_colormap));
if (bmp_colormap == (unsigned char *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
q=bmp_colormap;
for ... |
<vulnerable_code>#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
return ret_val;
}
status = pam_end(local_auth, status);
if (status != PAM_SUCCESS) {
struct error_obj ret_val;<commit_title>[PATCH] auth/pam: Check for account/password expiry<commit_description>See GHSA... |
<vulnerable_code>
/*
Maddy Mail Server - Composable all-in-one email server.
Copyright © 2019-2020 Max Mazurov <fox.cpp@disroot.org>, Maddy Mail Server contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return r... |
<vulnerable_code>const D = require('os').platform().substring(0, 3).toLowerCase() === 'win' ? '"' : '\'';
const CMD_CONVERT = { gm: 'gm', im: 'convert', magick: 'magick' };
const CMD_CONVERT2 = { gm: 'gm convert', im: 'convert', magick: 'magick' };
var CACHE = {};
var middlewares = {};
!self.builder.length && self.m... |
<vulnerable_code> }
target = Paths.get(target).toFile().getCanonicalPath();
if (!followlinks.equals(FollowLinkType.NONE) && followlinks.equals(FollowLinkType.EXTERNAL) && !target.startsWith(localPath + Item.SEPARATOR) )
{
boolean foundLink = false;
for... |
<vulnerable_code> const errorFormatter = typeof opts.errorFormatter === 'function' ? opts.errorFormatter : defaultErrorFormatter
if (typeof opts.errorHandler === 'function') {
app.setErrorHandler(opts.errorHandler)
} else if (opts.errorHandler === true || opts.errorHandler === undefined) {
app.setErrorHan... |
<vulnerable_code>
t.equal(res.statusCode, 200)
})<commit_title>[PATCH] Fix regression in handling badly formed JSON<commit_description><fixed_code>
t.equal(res.statusCode, 200)
})
test('bad json', async (t) => {
const schema = `
type Query {
successful: String
}
`
const resolvers = {
Quer... |
<vulnerable_code>
for (Publisher _t : Descriptor.newInstancesFromHeteroList(req, json, "publisher", Jenkins.getInstance().getExtensionList(BuildTrigger.DescriptorImpl.class))) {
BuildTrigger t = (BuildTrigger) _t;
for (AbstractProject downstream : t.getChildProjects(this)) {
... |
<vulnerable_code> */
package hudson.tasks;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.maven.MavenModuleSet;
import hudson.maven.MavenModuleSetBuild;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.R... |
<vulnerable_code> if (msr->request_content_length == -1) {
/* There's no C-L, but is chunked encoding used? */
char *transfer_encoding = (char *)apr_table_get(msr->request_headers, "Transfer-Encoding");
if ((transfer_encoding != NULL)&&(strstr(transfer_encoding, "chunked") != NULL)) {
... |
<vulnerable_code> // then the socket needs to die!
setTimeout(function () {
if (socket.writable && socket.bytesWritten <= 0) {
return socket.end();
}
}, destroyUpgradeTimeout);<commit_title>[PATCH] fix: catch errors when destroying invalid upgrades<commit_descripti... |
<vulnerable_code>lou_setDataPath(const char *path) {
static char dataPath[MAXSTRING];
dataPathPtr = NULL;
if (path == NULL) return NULL;
strcpy(dataPath, path);
dataPathPtr = dataPath;
return dataPathPtr;<commit_title>[PATCH] Check the length of path before copying into dataPath<commit_description>See https://lwn... |
<vulnerable_code> return;
}
const auto foundFiles = findFileInLocalFolders(relPath, accountFound->account());
if (foundFiles.isEmpty()) {<commit_title>[PATCH] Make sure to check relPath and compare to canonical cleaned<commit_description><fixed_code>
return;
}
// We want to check t... |
<vulnerable_code> inp, grad, argmax, ksize=[1, 1, 1, 1], strides=[1, 1, 1, 1],
padding="VALID")
def GetMaxPoolFwdTest(input_size, filter_size, strides, padding):
<commit_title>[PATCH] Fix security vulnerability with AvgPoolGrad<commit_description>PiperOrigin-RevId: 461724457<fixed_code>
... |
<vulnerable_code># limitations under the License.
# ==============================================================================
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
... |
<vulnerable_code>
# Sanity check number of values
if not len(vals) <= len(self._dtypes):
raise ValueError(f"Unexpected number of inputs {len(vals)} vs"
f"{len(self._dtypes)}")
tensors = []<commit_title>[PATCH] Fix tf.raw_ops.StagePeek vulnerability with invalid `index`.<commit_... |
<vulnerable_code>
if(presentationDownloadSupportedProtocols.stream().noneMatch(p -> p.equalsIgnoreCase(protocol))) {
if(presentationDownloadSupportedProtocols.size() == 1 && presentationDownloadSupportedProtocols.get(0).equalsIgnoreCase("*")) {
log.info("Warning: All prot... |
<vulnerable_code> info->name, info->num_sections, info->max_decomp_size);
return DWG_ERR_VALUEOUTOFBOUNDS;
}
if (info->size > info->num_sections * info->max_decomp_size)
{
LOG_ERROR ("Invalid section %s size %lu > %u * " FORMAT_RL,
info->name, info->size, info->num... |
<vulnerable_code> GD2_DBG (printf ("%d Chunks vertically\n", *ncy));
if (gd2_compressed (*fmt)) {
nc = (*ncx) * (*ncy);
GD2_DBG (printf ("Reading %d chunk index entries\n", nc));<commit_title>[PATCH] Fix #354: Signed Integer Overflow gd_io.c<commit_description>GD2 stores the number of horizontal and vertical chu... |
<vulnerable_code><commit_title>[PATCH] Fix #354: Signed Integer Overflow gd_io.c<commit_description>GD2 stores the number of horizontal and vertical chunks as words (i.e. 2
byte unsigned). These values are multiplied and assigned to an int when
reading the image, what can cause integer overflows. We have to avoid
that,... |
<vulnerable_code> def test_oom(self, test_file):
with pytest.raises(UnidentifiedImageError):
with pytest.warns(UserWarning):
with Image.open(test_file) as im:
pass
@pytest.mark.skipif(not is_win32(), reason="Windows only")
class TestFileTiffW32:
def test... |
<vulnerable_code>
if samples_per_pixel > MAX_SAMPLESPERPIXEL:
# DOS check, samples_per_pixel can be a Long, and we extend the tuple below
logger.error("More samples per pixel than can be decoded: %s", samples_per_pixel)
raise SyntaxError("Invalid value for samples per pixel")... |
<vulnerable_code>
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage;
import org.xwiki.appwithinminutes.test.po.ApplicationCreatePage;
* @since 13.10RC1
*/
@UITest(properties =... |
<vulnerable_code>"""
import os
import cherrypy
from cherrypy.lib.static import mimetypes, serve_file
from rdiffweb.core.rdw_helpers import unquote_url
return decorated
def static(path):
"""
Create a page handler to serve static files. Disable authentication.
"""
assert isinstance(path, str)
... |
<vulnerable_code>@author: Patrik Dufresne
"""
import rdiffweb.test
self.assertStatus('200 OK')
self.assertInBody('/static/default.css')
class ControllerOrangeThemeTest(rdiffweb.test.WebCase):
default_config = {'DefaultTheme': 'orange'}
def test_theme(self):
"""
Check if t... |
<vulnerable_code>import rdiffweb.tools.secure_headers
from rdiffweb.controller import Controller
from rdiffweb.controller.api import ApiPage
from rdiffweb.controller.dispatch import static # noqa
from rdiffweb.controller.page_admin import AdminPage
from rdiffweb.controller.page_browse import BrowsePage
from rdiffweb.c... |
<vulnerable_code>/*! For license information please see workflowengine-workflowengine.js.LICENSE.txt */
(()=>{var M,z,b,p={94191:(M,z,b)=>{"use strict";var p=b(20144),O=b(20629),A=b(93664),c=b(43554),o=b(79753);const q=0===(0,c.j)("workflowengine","scope")?"global":"user",W=M=>(0,o.generateOcsUrl)("apps/workflowengine/... |
<vulnerable_code>#include <linux/module.h>
#include <linux/string.h>
#include <linux/types.h>
#include <asm/byteorder.h>
#define F1(x, y, z) (z ^ (x & (y ^ z)))
#define F2(x, y, z) F1(z, x, y)
#define F3(x, y, z) (x ^ y ^ z)
#define F4(x, y, z) (y ^ (x | ~z))
#define MD5STEP(f, w, x, y, z, in, s) \
(w += f(x, y, z) ... |
<vulnerable_code> sr[i].state = SRS_DEAD;
if (reg->optimize != OPTIMIZE_NONE) {
if (reg->dist_max != INFINITE_LEN) {
sch_range = (UChar* )range + reg->dist_max;
if (sch_range > end) sch_range = (UChar* )end;
if (forward_search(reg, str, end, s, sch_range, &low, &high, &low_prev)) {... |
<vulnerable_code> return Promise.reject("Invalid package file: "+data.files.package)
}
var root = data.files.package.substring(0,data.files.package.length-12);
this.paths.root = root;
this.paths['package.json'] = data.files.package;
globalProjec... |
<vulnerable_code> globalGitUser = gitConfig.user;
Projects.init(settings,runtime);
sshTools.init(settings);
projectsDir = fspath.join(settings.userDir,"projects");
if (!settings.readOnly) {
return ... |
<vulnerable_code>
const { getPodcastFeed, findMatchingEpisodes } = require('../utils/podcastUtils')
const { getFileTimestampsWithIno, filePathToPOSIX } = require('../utils/fileUtils')
const Scanner = require('../scanner/Scanner')
const CoverManager = require('../managers/CoverManager')
}
}
async getPodcastFee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.