text stringlengths 79 3.72M |
|---|
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3846,
/**/<commit_title>[PATCH] patch 8.2.3847: illegal memory access when using a lambda<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
384... |
<vulnerable_code> return -EFAULT;
/* Not even root can pretend to send signals from the kernel.
Nor can they impersonate a kill(), which adds source info. */
if (info.si_code >= 0)
return -EPERM;
info.si_signo = sig;
/* POSIX.1b doesn't mention process groups. */
return -EINVAL;
/* Not even root can ... |
<vulnerable_code> throw new Error('Version ' + this.version + ' of the signature is unsupported.');
}
const subpackets = bytes => {
// Two-octet scalar octet count for following subpacket data.
const subpacket_length = util.readNumber(bytes.subarray(0, 2));
let i = 2;
// subpacket data set (ze... |
<vulnerable_code>describe('Security', function () {
require('./message_signature_bypass');
});<commit_title>[PATCH] Don't trust unhashed signature subpackets<commit_description>Also, export packet.Signature.prototype.read_sub_packets.<fixed_code>
describe('Security', function () {
require('./message_signature_bypas... |
<vulnerable_code><commit_title>[PATCH] Don't trust unhashed signature subpackets<commit_description>Also, export packet.Signature.prototype.read_sub_packets.<fixed_code>
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
const { key, message, enums, packet... |
<vulnerable_code> &pi->picomps[pi->compno]; pi->compno < JAS_CAST(int, pchg->compnoend) && pi->compno < pi->numcomps; ++pi->compno,
++pi->picomp) {
pirlvl = pi->picomp->pirlvls;
pi->xstep = pi->picomp->hsamp * (1 << (pirlvl->prcwidthexpn +
pi->picomp->numrlvls - 1));
pi->ystep = pi->picomp->vsamp * (1 <<... |
<vulnerable_code> atomic_inc(&priv->active_tx_urbs);
err = usb_submit_urb(urb, GFP_ATOMIC);
if (unlikely(err))
goto failed;
else if (atomic_read(&priv->active_tx_urbs) >= MAX_TX_URBS)
/* Slow down tx path */
netif_stop_queue(netdev);
return NETDEV_TX_BUSY;
failed:
can_free_echo_skb(netdev, context->echo_... |
<vulnerable_code> int len;
tm = localtime(&t);
str = g_strdup(asctime(tm));
len = strlen(str);<commit_title>[PATCH 1/2] Check return value of localtime<commit_description>Fixes #10<fixed_code>
int len;
tm = localtime(&t);
if (tm == NULL)
return g_strdup("???");
str = g_strdup(asctime(tm));... |
<vulnerable_code>
static void nick_hash_remove(CHANNEL_REC *channel, NICK_REC *nick)
{
NICK_REC *list;
list = g_hash_table_lookup(channel->nicks, nick->nick);
if (list == NULL)
return;
if (list == nick || list->next == NULL) {
g_hash_table_remove(channel->nicks, nick->nick);
if (list->next != NULL) {
g_h... |
<vulnerable_code> """Implementation of the auth rules for m.room.create events
Args:
event: The event to be checked
Raises:
AuthError if the event does not pass the auth rules<commit_title>[PATCH] Update synapse/event_auth.py<commit_description>Co-authored-by: reivilibre <oliverw@matrix.or... |
<vulnerable_code># Imports
#-----------------------------------------------------------------------------
try:
from http.cookies import SimpleCookie # Py 3
except ImportError:
#-----------------------------------------------------------------------------
class ZMQStreamHandler(websocket.WebSocketHandler):
... |
<vulnerable_code> node = blk->bp->b_addr;
dp->d_ops->node_hdr_from_disk(&nodehdr, node);
btree = dp->d_ops->node_tree_p(node);
if (be32_to_cpu(btree->hashval) == lasthash)
break;
blk->hashval = lasthash;
btree[blk->index].hashval = cpu_to_be32(lasthash);<commit_title>[PATCH] xfs: fix directory hash orderi... |
<vulnerable_code> image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
image=DestroyImageList(image);
return((Image *) NULL);
}
read_info=CloneImageInfo(image_info);
SetImageInfoBlob(read_info,(void *) NULL,0)... |
<vulnerable_code> ltv_t *pLtv;
bool_t ltvAllocated = FALSE;
ENCSTRCT sEncryption;
#ifdef USE_WDS
hcf_16 hcfPort = HCF_PORT_0;
break;
case CFG_CNF_OWN_NAME:
memset(lp->StationName, 0, sizeof(lp->StationName));
memcpy((void *)lp->S... |
<vulnerable_code> var RE_DISPLAYMATH = /^([^\$]*?)\$\$([^\$]*?)\$\$(.*)$/m,
RE_INLINEMATH = /^([^\$]*?)\$([^\$]+?)\$(.*)$/m,
ESCAPED_DOLLAR = '@@ESCAPED_D@@',
ESCAPED_BACKSLASH = '@@ESCAPED_B@@';
/**
* Formats math and code chunks
return proce... |
<vulnerable_code>
def file_is_shared(self, user, virtualfilename, realfilename):
log.add_transfer("Checking if file %(virtual_name)s with real path %(path)s is shared", {
"virtual_name": virtualfilename,
"path": realfilename
})
if not os.access(realfilename, os.R_OK... |
<vulnerable_code> if (statusCode < 100 || statusCode > 999)
throw new RangeError(`Invalid status code: ${statusCode}`);
var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' +
this.statusMessage + CRLF;
<commit_title>[PATCH] http: check reason chars in writeHead<commit_description>Previo... |
<vulnerable_code><commit_title>[PATCH] http: check reason chars in writeHead<commit_description>Previously, the reason argument passed to ServerResponse#writeHead was
not being properly validated. One could pass CRLFs which could lead to
http response splitting. This commit changes the behavior to throw an
error in th... |
<vulnerable_code>}
NAN_METHOD(TxnWrap::putString) {
return putCommon(info, [](Nan::NAN_METHOD_ARGS_TYPE info, MDB_val &data) -> void {
CustomExternalStringResource::writeTo(Local<String>::Cast(info[2]), &data);
}, [](MDB_val &data) -> void {<commit_title>[PATCH] Perform argument check for putString<com... |
<vulnerable_code> switch (mode) {
case MPOL_PREFERRED:
/*
* Insist on a nodelist of one node only
*/
if (nodelist) {
char *rest = nodelist;
rest++;
if (*rest)
goto out;
}
break;
case MPOL_INTERLEAVE:<commit_title>[PATCH] mm: mempolicy: require at least one nodeid for MPOL_PREFERRED<commit_... |
<vulnerable_code>import org.wso2.carbon.identity.user.registration.stub.UserRegistrationAdminServiceStub;
import org.wso2.carbon.identity.user.registration.stub.dto.UserDTO;
import org.wso2.carbon.identity.user.registration.stub.dto.UserFieldDTO;
import org.wso2.carbon.registry.core.exceptions.RegistryException;
import... |
<vulnerable_code> var paramName = API_DESIGNER.api_doc.paths[operations][operation]['parameters'][i]['name'];
// @todo: param_string
jagg.message({content: 'Do you want to delete the parameter <strong>' + paramName + '</strong> ?',
type: 'confirm', title: i18n.t("Delete Parameter"),
... |
<vulnerable_code> $('#messageModal div.modal-body').html(i18n.t('Do you want to remove this reply?'));
$('#messageModal h3.modal-title').html(i18n.t('Confirm Delete'));
$('#messageModal a.btn-primary').html(i18n.t('Yes'));
$('#messageModal a.btn-other').html(i18n.t('Yes'));
$('#me... |
<vulnerable_code>/* POST home page. */
router.post('/new', function(req, res, next) {
var challenger_id = req.headers.challenger_id;
var challenged_id = req.headers.challenged_id;
var latitude = req.headers.latitude;
var longitude = req.headers.longitude;
var pic_path = req.files.fileUpload.path;
console.... |
<vulnerable_code> /* Register myself. */
rtadv_event (zvrf, RTADV_READ, sock);
len = rtadv_recv_packet (sock, buf, BUFSIZ, &from, &ifindex, &hoplimit);
if (len < 0)
{<commit_title>[PATCH] zebra: stack overrun in IPv6 RA receive code (CVE-2016-1245)<commit_description>The IPv6 RA code also receives ICMPv6 ... |
<vulnerable_code> static {
Set<String> s = new HashSet<String>();
// Courtesy of [https://github.com/kantega/notsoserial]:
// (and wrt [databind#1599]
s.add("org.apache.commons.collections.functors.InvokerTransformer");
s.add("org.apache.commons.collections.functors.Instantiat... |
<vulnerable_code>
package org.elasticsearch.common.io;
import org.elasticsearch.common.Classes;
import java.io.*;
/**
*
case ThrowableObjectOutputStream.TYPE_STACKTRACEELEMENT:
return ObjectStreamClass.lookup(StackTraceElement.class);
case ThrowableObjectOutputStream.TYPE_FAT... |
<vulnerable_code>
package org.elasticsearch.common.io;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
import java.io.OutputStream;
/**
*
}
}
}
}<commit_title>[PATCH] Restrict Exception deserialization to Core and JDK classes<commit_description... |
<vulnerable_code> @Override
public void sendResponse(Throwable error) throws IOException {
BytesStreamOutput stream = new BytesStreamOutput();
try {
writeResponseExceptionHeader(stream);
RemoteTransportException tx = new RemoteTransportException(targetTransport.nodeName(),... |
<vulnerable_code><commit_title>[PATCH] Restrict Exception deserialization to Core and JDK classes<commit_description>when 3rd party exceptions are deserialized they might carry
classes not present on the deserializing node. This causes hard
exceptions and looses the exception entirely. This commit restricts
the classes... |
<vulnerable_code> }
}
if (!cmark_node_set_type(parent_container, CMARK_NODE_TABLE)) {
free_table_row(parser->mem, header_row);
free_table_row(parser->mem, marker_row);
return parent_container;
}
if (header_row->paragraph_offset) {
try_inserting_table_header_paragraph(parser, parent_containe... |
<vulnerable_code>static void S_process_line(cmark_parser *parser, const unsigned char *buffer,
bufsize_t bytes);
static cmark_node *make_block(cmark_mem *mem, cmark_node_type tag,
int start_line, int start_column) {
cmark_node *e;
parser->refmap = cmark_refe... |
<vulnerable_code>cmark_node_type cmark_syntax_extension_add_node(int is_inline) {
cmark_node_type *ref = !is_inline ? &CMARK_NODE_LAST_BLOCK : &CMARK_NODE_LAST_INLINE;
if ((*ref & CMARK_NODE_VALUE_MASK) == CMARK_NODE_VALUE_MASK) {
assert(false);
return (cmark_node_type) 0;
}<commit_title>[PATCH 1/6] Keep... |
<vulnerable_code>// in parser. (Used to check that the counts in parser, which are updated incrementally, are
// correct.)
bool check_open_block_counts(cmark_parser *parser) {
cmark_parser tmp_parser = {0}; // Only used for its open_block_counts field.
add_open_block_counts(&tmp_parser, parser->root);
return memc... |
<vulnerable_code> const size_t n_para = read_open_block_count(&tmp_parser, CMARK_NODE_PARAGRAPH);
if (n_list + n_item + n_para == tmp_parser.total_open_blocks) {
if (parser->current->flags & CMARK_NODE__OPEN_BLOCK) {
if (S_type(parser->current) == CMARK_NODE_PARAGRAPH) {
contain... |
<vulnerable_code> continue;
}
if (parser->blank) {
const size_t n_list = read_open_block_count(&tmp_parser, CMARK_NODE_LIST);
const size_t n_item = read_open_block_count(&tmp_parser, CMARK_NODE_ITEM);
const size_t n_para = read_open_block_count(&tmp_parser, CMARK_NODE_PARAGRAPH);
i... |
<vulnerable_code>// Check to see if a node ends with a blank line, descending
// if needed into lists and sublists.
static bool S_ends_with_blank_line(cmark_node *node) {
if (S_last_line_checked(node)) {
return(S_last_line_blank(node));
} else if ((S_type(node) == CMARK_NODE_LIST ||
S_type(node) =... |
<vulnerable_code> int retval;
test_batch_runner *runner = test_batch_runner_new();
version(runner);
constructor(runner);
accessors(runner);<commit_title>[PATCH 1/6] Keep a count of the number of open blocks.<commit_description><fixed_code>
int retval;
test_batch_runner *runner = test_batch_runner_new();
... |
<vulnerable_code>#include "node.h"
#include "syntax_extension.h"
static void S_node_unlink(cmark_node *node);
#define NODE_MEM(node) cmark_node_mem(node)
}
static bool S_can_contain(cmark_node *node, cmark_node *child) {
cmark_node *cur;
if (node == NULL || child == NULL) {
return false;
}
return 0;
... |
<vulnerable_code>
// Initialize the certificates for first-time usage
if (!loadCerts()) {
if (!sslWarningShown) {
qWarning() << "SslServer: Unable to set certificate file\n"
<< " Quassel Core will still work, but cannot provide SSL for client connections.\n"<c... |
<vulnerable_code>import os
import tempfile
import urllib
from .__version__ import __title__, __version__
from .form import Form
from .utils import LinkNotFoundError
class Browser:
# If the enctype is not multipart, the filename is put in
# the form as a text input and the file is not... |
<vulnerable_code>import copy
import warnings
from bs4 import BeautifulSoup
from .utils import LinkNotFoundError
class InvalidFormMethod(LinkNotFoundError):
i = self.form.find("input", {"name": name})
if not i:
raise InvalidFormMethod("No input field named " + name)
... |
<vulnerable_code> StatefulBrowser).
"""
pass<commit_title>[PATCH] Merge pull request from GHSA-x456-3ccm-m6j4<commit_description>* Add suggested mitigation against malicious HTML form file input. Test cases and docs not updated.
* Make tests pass. Add test specifically for this vulnerability. Fix the `For... |
<vulnerable_code> else:
# Encoding doesn't allow sending the content, we expect
# the filename as a normal text field.
expected_content = pic_path.encode()
form.find("input", {"name": "pic"})["value"] = pic_path
browser = mechanicalsoup.Browser()
response = br... |
<vulnerable_code>
def test_upload_file(httpbin):
browser = mechanicalsoup.StatefulBrowser()
browser.open(httpbin + "/forms/post")
# Create two temporary files to upload
def make_file(content):
with open(path, "w") as fd:
fd.write(content)
return path
path1, path2 = (make... |
<vulnerable_code>
from redbot.core import checks, commands
__author__ = "tmerc"
log = logging.getLogger("red.tmerc.massdm")
for member in [m for m in role.members if not m.bot]:
try:
await member.send(message.format(member=member, role=role, server=ctx.guild, sender=ctx.author))
... |
<vulnerable_code><commit_title>[PATCH] fix(MassDM): only allow use of safe model attributes<commit_description><fixed_code>
import discord
class SafeMember:
def __init__(self, member: discord.Member) -> None:
self.name = str(member.name)
self.display_name = str(member.display_name)
self.ni... |
<vulnerable_code> private final Serializable defaultValue;
private final Class<? extends Serializable> clazz;
private final String description;
<T extends Serializable> ClickHouseCommandLineOption(String key, T defaultValue, String description) {
this.key = ClickHouseChecker.nonNull(key, "key");... |
<vulnerable_code>/*global xit,it,describe,before,after,beforeEach,afterEach*/
"use strict";
const { assert } = require("node-opcua-assert");
const async = require("async");
const should = require("should");
const sinon = require("sinon");<commit_title>[PATCH] fix message chunk overflow detection<commit_description>... |
<vulnerable_code>
beforeEach(function (done) {
client = OPCUAClient.create({
requestedSessionTimeout: 600 * 1000 // use long session time out
});
endpointUrl = test.endpointUrl;
done();
});
it("Q3-5 should return BadTooManyOperatio... |
<vulnerable_code>const async = require("async");
const should = require("should");
const chalk = require("chalk");
const {
VariableIds,
OPCUAClient,
resolveNodeId,
ClientMonitoredItem,
StatusCodes,
TimestampsToReturn,
MonitoringMode
} = require("node-opcua");
const { make_debugLog, make_erro... |
<vulnerable_code>/* eslint no-process-exit: 0 */
"use strict";
const argv = require("yargs")
.usage("Usage: $0 --portServer [num] --port [num] --hostname <hostname> -block")
.argv;
const net = require("net");
const opcua = require("node-opcua");
const s = require("../lib/datamodel/structures");
const cha... |
<vulnerable_code>
describe("testing message decryption", function() {
it("should decrypt an OPN packet and verify that the signature is correct", function() {
// extract the client certificate from the unencrypted part
// decrypt the encrypted part
const decrypted_part = crypto_utils.priv... |
<vulnerable_code>const should = require("should");
const { MessageBuilder } = require("..");
const { SecurityPolicy, MessageSecurityMode} = require("..");
const packets = require("node-opcua-transport/dist/test-fixtures");
const { redirectToFile } = require("node-opcua-debug/nodeJS");
const debugLog = require("node-... |
<vulnerable_code>const debugLog = require("node-opcua-debug").make_debugLog("TEST");
const { hexDump } = require("node-opcua-debug");
const { MessageSecurityMode } = require("node-opcua-service-secure-channel");
const crypto_utils = require("node-opcua-crypto");
const { make_lorem_ipsum_buffer } = require("node-opcua-... |
<vulnerable_code>const should = require("should");
const { ReadRequest } = require("node-opcua-types");
const { make_debugLog, checkDebugFlag } = require("node-opcua-debug");
const { ClientSecureChannelLayer, ServerSecureChannelLayer } = require("..");
});
holder.serverChannel = serverChannel;
... |
<vulnerable_code> .on("full_message_body", function(full_message_body) {
compare_buffers(fullBufferForVerif, full_message_body, 40);
})
.on("message", function(reconstructed_message) {
// messa... |
<vulnerable_code>const should = require("should");
const { StatusCodes } = require("node-opcua-status-code");
const { ServerSecureChannelLayer, MessageSecurityMode, SecurityPolicy } = require("..");
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const { DirectTransport } = require("node-opcu... |
<vulnerable_code>const should = require("should");
const MessageBuilder = require("..").MessageBuilder;
const packets = require("node-opcua-transport/dist/test-fixtures");
const { BinaryStream } = require("node-opcua-binary-stream");
xdescribe("testing with problematic packet", function () {
it("should raise a ... |
<vulnerable_code>"use strict";
const { makebuffer_from_trace } = require("node-opcua-debug");
exports.packet_ReadResponse= makebuffer_from_trace(function () {
/*
00000000: 01 00 7a 02 87 bb 66 e8 6e 19 d1 01 e0 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 ..z..;fhn.Q.`...................
... |
<vulnerable_code>"use strict";
const should = require("should");
const { assert } = require("node-opcua-assert");
const chalk = require("chalk");
const sinon = require("sinon");
const { StatusCodes, StatusCode } = require("node-opcua-status-code");
const { hexDump } = require("node-opcua-debug");
const { compare_buf... |
<vulnerable_code>"use strict";
const { BinaryStream } = require("node-opcua-binary-stream");
const { compare_buffers } = require("node-opcua-utils");
done();
});
builder.on("chunk", function (message_chunk) {
compare_buffers(message_chunk, original_message_chunk, original_messa... |
<vulnerable_code> debugLog("failed !", err.message);
});
transport.on("message", (messageChunk) => {
// console.log("message ", messageChunk);
done(new Error("Not expecting an message"));
});
function perform_sever_receiving_a_HEL_MESSAGE_followed_by_OpenC... |
<vulnerable_code> Quantum
*volatile quantum_scanline;
ssize_t
j;
pixel_info=(MemoryInfo *) NULL;
quantum_scanline = (Quantum *) NULL;
if (setjmp(png_jmpbuf(ping)))
{
quantum_scanline=(Quantum *) RelinquishMagickMemory(quantum_scanline);
#ifdef IMPNG_SETJMP_NOT_THREAD_SAFE
UnlockSe... |
<vulnerable_code> clone_info->composite_mask=CloneImage(draw_info->composite_mask,0,0,
MagickTrue,&draw_info->composite_mask->exception);
clone_info->render=draw_info->render;
clone_info->image_info=CloneImageInfo(draw_info->image_info);
clone_info->debug=draw_info->debug;
return(clone_info);
}<commit_... |
<vulnerable_code> }
*argend = 0;
if (strcmp(cmd, "deny") == 0) {
acl_rule = g_malloc(sizeof(*acl_rule));
if (strcmp(arg, "all") == 0) {
usage();
return EXIT_FAILURE;
}
/* parse default acl file */
QSIMPLEQ_INIT(&acl_list);<commit_title>[PATCH]... |
<vulnerable_code>
char *suhosin_encrypt_single_cookie(char *name, int name_len, char *value, int value_len, char *key TSRMLS_DC)
{
char buffer[4096];
char buffer2[4096];
char *buf = buffer, *buf2 = buffer2, *d, *d_url;
int l;
if (name_len > sizeof(buffer)-2) {
buf = estrndup(name, name_len);
} else {
m... |
<vulnerable_code>
/* Create open temporary file in safe way. Please notice that the
* file permissions are -rw------- by default. */
int xmkstemp(char **tmpname, char *dir)
{
char *localtmp;
char *tmpenv;
mode_t old_mode;
int fd, rc;
/* Some use cases must be capable of being moved atomically
* with rename(2)... |
<vulnerable_code>#else /* HAVE_LIBUSER */
/* write the new struct passwd to the passwd file. */
ctl->pw->pw_gecos = gecos;
if (setpwnam(ctl->pw) < 0) {
warn("setpwnam failed");
#endif
printf(_<commit_title>[PATCH] chsh, chfn, vipw: fix filenames collision<commit_description>The utils when compiled WITHOUT libuse... |
<vulnerable_code> errx(EXIT_FAILURE, _("Shell *NOT* changed. Try again later."));
#else
pw->pw_shell = info.shell;
if (setpwnam(pw) < 0)
err(EXIT_FAILURE, _("setpwnam failed\n"
"Shell *NOT* changed. Try again later."));
#endif<commit_title>[PATCH] chsh, chfn, vipw: fix filenames collision<commit_description>T... |
<vulnerable_code> * If the given username exists in the passwd file, the entry is
* replaced with the given entry.
*/
int setpwnam(struct passwd *pwd)
{
FILE *fp = NULL, *pwf = NULL;
int save_errno;
int contlen, rc;
char *linebuf = NULL;
char *tmpname = NULL;
char *atomic_dir = "/etc";
pw_init();
if ((fp = ... |
<vulnerable_code>{
FILE *fd;
char *tmpname = NULL;
char *dir = "/etc";
if ((fd = xfmkstemp(&tmpname, dir)) == NULL) {
ulckpwdf();
err(EXIT_FAILURE, _("can't open temporary file"));
}<commit_title>[PATCH] chsh, chfn, vipw: fix filenames collision<commit_description>The utils when compiled WITHOUT libuser then ... |
<vulnerable_code> from cps.kobo import kobo, get_kobo_activated
from cps.kobo_auth import kobo_auth
kobo_available = get_kobo_activated()
except ImportError:
kobo_available = False
try:<commit_title>[PATCH] Added handling for missing flask-wtf dependency Added CSRF<commit_description><fixed_code>
fr... |
<vulnerable_code>except ImportError:
lxml_present = False
mimetypes.init()
mimetypes.add_type('application/xhtml+xml', '.xhtml')
mimetypes.add_type('application/epub+zip', '.epub')
lm.anonymous_user = ub.Anonymous
lm.session_protection = 'strong'
ub.init_db(cli.settingspath)
# pylint: disable=no-member
config = c... |
<vulnerable_code>import babel, pytz, requests, sqlalchemy
import werkzeug, flask, flask_login, flask_principal, jinja2
from flask_babel import gettext as _
from . import db, calibre_db, converter, uploader, server, isoLanguages, constants
from .render_template import render_title_template
Flask=flask.__version__,
... |
<vulnerable_code>from sqlalchemy.sql import select
import requests
from . import config, logger, kobo_auth, db, calibre_db, helper, shelf as shelf_lib, ub
from .constants import sqlalchemy_version2
from .helper import get_download_link
from .services import SyncToken as SyncToken
return metadata
@kobo.route("/v... |
<vulnerable_code>
$(".datepicker").datepicker({
format: "yyyy-mm-dd",
language: language
}).on("change", function () {
// Show localized date over top of the standard YYYY-MM-DD date
var pubDate;<commit_title>[PATCH] Added handling for missing flask-wtf dependency Added CSRF<commit_description><fixed_co... |
<vulnerable_code> $("#form-upload").submit();
});
$(document).ready(function() {
var inp = $('#query').first()
if (inp.length) {
var preFilters = $.Callbacks();
$.ajaxPrefilter(preFilters.fire);
function restartTimer() {
$("#spinner").addClass("hidden");
$("#RestartDialog").modal("h... |
<vulnerable_code>
@app.after_request
def add_security_headers(resp):
resp.headers['Content-Security-Policy'] = "default-src 'self' 'unsafe-inline' 'unsafe-eval';"
if request.endpoint == "editbook.edit_book":
resp.headers['Content-Security-Policy'] += "img-src * data:"
resp.headers['X-Content-Type-Op... |
<vulnerable_code>/*
Global declarations.
*/
static ErrorHandler
error_handler = DefaultErrorHandler;
register const ExceptionInfo
*p;
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
if (exception->exceptions == (void *) NULL)
ResetLinkedListIterator... |
<vulnerable_code>% o quantum: the number of bytes in each quantum.
%
*/
static MagickBooleanType CheckMemoryOverflow(const size_t count,
const size_t quantum)
{
size_t
size;
size=count*quantum;
if ((count == 0) || (quantum != (size/count)))
{
errno=ENOMEM;
return(MagickTrue);
}
re... |
<vulnerable_code> status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
if ((image->columns == 0) && (image->rows == 0))
{
image->columns=(size_t) (metrics.width+draw_info->stroke_width+0.5);
image->rows=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
}
else
ret... |
<vulnerable_code>% o exception: return any errors or warnings in this structure.
%
*/
static MagickBooleanType CheckMemoryOverflow(const size_t count,
const size_t quantum)
{
size_t
size;
size=count*quantum;
if ((count == 0) || (quantum != (size/count)))
{
errno=ENOMEM;
return(MagickTru... |
<vulnerable_code>
int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config)
{
int is_rf64 = !strncmp (fourcc, "RF64", 4), got_ds64 = 0;
int64_t total_samples = 0, infilesize;
RiffChunkHeader riff_chunk_header;
ChunkHeader chunk_header;
e... |
<vulnerable_code> Wave64ChunkHeader chunk_header;
Wave64FileHeader filehdr;
WaveHeader WaveHeader;
uint32_t bcount;
infilesize = DoGetFileSize (infile);
if (!memcmp (chunk_header.ckID, fmt_guid, sizeof (fmt_guid))) {
int supported = TRUE, format;
chunk_header.ckSize ... |
<vulnerable_code> }
#endif
if(MATLAB_HDR.DataType!=miMATRIX) continue; /* skip another objects. */
MATLAB_HDR.unknown1 = ReadBlobXXXLong(image2);
MATLAB_HDR.unknown2 = ReadBlobXXXLong(image2);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/648<commit_description><fixed_code>
... |
<vulnerable_code> if (headers != currentHeaders) {
throw new IllegalStateException();
}
}
while (it != -1) {
HeaderValues values = headers.fiCurrent(it);
}
}
if(overflowing) {
... |
<vulnerable_code>
@Override
protected FrameHeaderData parseFrame(ByteBuffer data) throws IOException {
if (prefaceCount < PREFACE_BYTES.length) {
while (data.hasRemaining() && prefaceCount < PREFACE_BYTES.length) {
if (data.get() != PREFACE_BYTES[prefaceCount]) {
}
... |
<vulnerable_code><commit_title>[PATCH] [UNDERTOW-1979] CVE-2021-3859 continuation frames are not<commit_description><fixed_code>
/*
* JBoss, Home of Professional Open Source.
* Copyright 2021 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Versi... |
<vulnerable_code> *rx_enqueue = 1U;
}
} else {
/* Drop response with no Local initiated request. */
LL_ASSERT(pdu_data_rx->llctrl.opcode ==
PDU_DATA_LLCTRL_TYPE_LENGTH_RSP);
}
send_length_resp:<commit_title>[PATCH] Bluetooth: controller: legacy: Fix DLE duplicate requests<commit_description>Fix implemen... |
<vulnerable_code> }
int off = 0;
while (off < bin->ne_header->EntryTableLength) {
ut8 bundle_length = *(ut8 *)(bin->entry_table + off);
if (!bundle_length) {
break;
ut8 segnum = *(bin->entry_table + off);
off++;
ut16 segoff = *(ut16 *)(bin->entry_table + off);
entry->paddr = (ut64)bin->segment_... |
<vulnerable_code> console.log('SM: logIn');
var self = this;
req.session.regenerate(function(err) {
if (err) {
return cb(err);
if (!req.session[self._key]) {
req.session[self._key] = {};
}
req.session[self._key].user = obj;
cb();
});
});
}<commit_title>[PATCH] Sav... |
<vulnerable_code> req.session = { id: '1' };
req.session.regenerate = function(cb) {
req.session = { id: '2' };
process.nextTick(cb);
}
var error;
req.session = { id: '1' };
req.session.regenerate = function(cb) {
req.session = { id: '2' };
... |
<vulnerable_code>{
char* path = NULL;
int status;
UINT32 PathLength;
Stream_Seek(irp->input, 28);
/* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */
/* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */
Stream_Read_UINT32(irp->input, PathLength);
status = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)S... |
<vulnerable_code> return(-1); /* name goes past the end of the buffer */
ND_TCHECK2(*s, 1);
s += (*s) + 1;
}
return(PTR_DIFF(s, s0) + 1);
<commit_title>[PATCH] CVE-2017-12893/SMB/CIFS: Add a bounds check in name_len().<commit_description><fixed_code>
return(-1); /* name goes past the end of the buffe... |
<vulnerable_code> dest='cert_path',
type='str',
default='',
help = "Path to alternate certificate file."),
]<commit_title>[PATCH] shorter metavar for --cert-path<commit_description><fixed_code>
dest='cert_path',
type='str',
default='',
metavar='path',
... |
<vulnerable_code> commands = ["$exiv2 in $filename1 $filename2"]
stdout = [""]
stderr = [
"""$filename1: Could not write metadata to file: corrupted image metadata
"""]
retval = [1]<commit_title>[PATCH] Use $kerCorruptedMetadata, rather than hard-coded string.<commit_description><fixed_code>
commands... |
<vulnerable_code> help="Export all variables to JSON file",
type=argparse.FileType("w", encoding="UTF-8"),
)
# kerberos
ARG_PRINCIPAL = Arg(("principal",), help="kerberos principal", nargs="?")
name="import",
help="Import variables",
func=lazy_load_command("airflow.cli.commands.variable_... |
<vulnerable_code>from airflow.utils import cli as cli_utils
from airflow.utils.cli import suppress_logs_and_warning
from airflow.utils.providers_configuration_loader import providers_configuration_loaded
from airflow.utils.session import create_session
@suppress_logs_and_warning
@cli_utils.action_cli
@providers_conf... |
<vulnerable_code> """Import variables."""
try:
variable_dict = json.loads(request.files["file"].read())
except Exception:
self.update_redirect()
flash("Missing file or syntax error.", "error")
skipped = set()
suc_count = fail_count = 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.