text stringlengths 79 3.72M |
|---|
<vulnerable_code> # We can add a new field to the derived instance.
d.z = 10
class TestDescriptors(unittest.TestCase):
def test_set_name(self):
# See bpo-33141.<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
# We can ... |
<vulnerable_code>__all__ = ["version", "bootstrap"]
_PACKAGE_NAMES = ('setuptools', 'pip')
_SETUPTOOLS_VERSION = "56.0.0"
_PIP_VERSION = "21.1"
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION, "py3"),
("pip", _PIP_VERSION, "py3"),<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097... |
<vulnerable_code> print(ssl.OPENSSL_VERSION)
args = [
sys.executable,
'-Werror', '-bb', # turn warnings into exceptions
'-m', 'test',
]
if not extra_args:<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
print(s... |
<vulnerable_code> tuple(f.name for f in std_init_fields))
if slots:
cls = _add_slots(cls)
abc.update_abstractmethods(cls)
return cls
def _add_slots(cls):
# Need to create a new class, since we can't set __slots__
# after a class has been created.
if qualn... |
<vulnerable_code> self.assertFalse(hasattr(A, "__slots__"))
self.assertTrue(hasattr(B, "__slots__"))
class TestDescriptors(unittest.TestCase):
def test_set_name(self):<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
self.asse... |
<vulnerable_code>
class NetworkedNNTPTestsMixin:
def test_welcome(self):
welcome = self.server.getwelcome()
self.assertEqual(str, type(welcome))
return False
return True
try:
server = self.NNTP_CLASS(self.NNTP_HOST,
... |
<vulnerable_code> #ifndef PY_SSL_DEFAULT_CIPHER_STRING
#error "Py_SSL_DEFAULT_CIPHERS 0 needs Py_SSL_DEFAULT_CIPHER_STRING"
#endif
#elif PY_SSL_DEFAULT_CIPHERS == 1
/* Python custom selection of sensible cipher suites
* DEFAULT: OpenSSL's default cipher list. Since 1.0.2 the list is in sensible order.
* !aNUL... |
<vulnerable_code> import warnings
warnings.warn(
"in 3.12 format() will use the enum member, not the enum member's value;\n"
"use a format specifier, such as :d for an IntEnum member, to maintain"
"the current display... |
<vulnerable_code> # Disabled as the connection will already be encrypted.
test_starttls = None
ssl_context = ssl._create_unverified_context()
ssl_context.set_ciphers("DEFAULT")
ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2
#
# Non-networked tests using a local server (or something mocking it... |
<vulnerable_code> logger.info('set_wakeup_fd(-1) failed: %s', nexc)
if exc.errno == errno.EINVAL:
raise RuntimeError(f'sig {sig} cannot be caught')
else:
raise
signal.signal(sig, handler)
except OSError as exc:
... |
<vulnerable_code> if fips_mode is not None:
self.assertIsInstance(fips_mode, int)
def test_disallow_instanciation(self):
constructors = []
try:
import _md5
constructors.append(_md5.md5)
except ImportError:
pass
try:
... |
<vulnerable_code> file = os.path.join(os.path.expanduser("~"), ".netrc")
self.hosts = {}
self.macros = {}
with open(file) as fp:
self._parse(file, fp, default_netrc)
def _parse(self, file, fp, default_netrc):
lexer = shlex.shlex(fp)<commit_title>[PATCH 003/413... |
<vulnerable_code> ):
HASHXOF()
class KDFTests(unittest.TestCase):
<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
):
HASHXOF()
def test_readonly_types(self):
for algorithm, constructors in self.const... |
<vulnerable_code> ):
C_HMAC()
@unittest.skipUnless(sha256_module is not None, 'need _sha256')
def test_with_sha256_module(self):
h = hmac.HMAC(b"key", b"hash this!", digestmod=sha256_module.sha256)<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<comm... |
<vulnerable_code> ssl.OP_NO_TLSv1_2
self.assertEqual(ssl.PROTOCOL_TLS, ssl.PROTOCOL_SSLv23)
def test_private_init(self):
with self.assertRaisesRegex(TypeError, "public constructor"):
with socket.socket() as s:<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io... |
<vulnerable_code>PyType_Spec blake2b_type_spec = {
.name = "_blake2.blake2b",
.basicsize = sizeof(BLAKE2bObject),
.flags = Py_TPFLAGS_DEFAULT,
.slots = blake2b_type_slots
};<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
PyType_Spec bla... |
<vulnerable_code>PyType_Spec blake2s_type_spec = {
.name = "_blake2.blake2s",
.basicsize = sizeof(BLAKE2sObject),
.flags = Py_TPFLAGS_DEFAULT,
.slots = blake2s_type_slots
};<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
PyType_Spec bla... |
<vulnerable_code> "_hashlib.HASH", /*tp_name*/
sizeof(EVPobject), /*tp_basicsize*/
0, /*tp_itemsize*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION,
EVPtype_slots
};
"_hashlib.HASHXOF", /*tp_name*/
sizeof(EVPobject), /*tp_basicsize*/
... |
<vulnerable_code> static PyType_Spec type_spec_obj = { \
.name = "_sha3." type_name, \
.basicsize = sizeof(SHA3object), \
.flags = Py_TPFLAGS_DEFAULT, \
.slots = type_slots \
}
<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><f... |
<vulnerable_code> "ssl.SSLError",
sizeof(PyOSErrorObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
sslerror_type_slots
};
"_ssl._SSLSocket",
sizeof(PySSLSocket),
0,
Py_TPFLAGS_DEFAULT,
PySSLSocket_slots,
};
"_ssl._SSLContext",
sizeof(PySSLContext),
0,
Py_TPF... |
<vulnerable_code> "_ssl.Certificate",
sizeof(PySSLCertificate),
0,
Py_TPFLAGS_DEFAULT,
PySSLCertificate_slots,
};<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fixed_code>
"_ssl.Certificate",
sizeof(PySSLCertificate),
0,
Py_TPFLA... |
<vulnerable_code>static PyType_Spec md5_type_spec = {
.name = "_md5.md5",
.basicsize = sizeof(MD5object),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = md5_type_slots
};
<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_description><fi... |
<vulnerable_code>static PyType_Spec sha1_type_spec = {
.name = "_sha1.sha1",
.basicsize = sizeof(SHA1object),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = sha1_type_slots
};
<commit_title>[PATCH 003/413] bpo-43651: Fix EncodingWarning in test_io (GH-25097)<commit_descriptio... |
<vulnerable_code> size_t ss_const = objc->_const->vsize;
const ut64 va_selrefs = objc->_selrefs->vaddr;
size_t ss_selrefs = objc->_selrefs->vsize;
// TODO: check if ss_const or ss_selrefs are too big before going further
size_t maxsize = R_MAX (ss_const, ss_selrefs);
maxsize = R_MIN (maxsize, objc->file_size);
... |
<vulnerable_code> :param num_mappers: Number of map tasks to import in parallel.
:param properties: Properties to set via the -D argument
:param libjars: Optional Comma separated jar files to include in the classpath.
"""
conn_name_attr = "conn_id"
hcatalog_table: str | None = None,
... |
<vulnerable_code> "hcatalog_database": "hive_database",
"hcatalog_table": "hive_table",
}
_config_export = {
"table": "export_data_to",
"export_dir": "/hdfs/data/to/be/exported",
"input_optionally_enclosed_by": '"',
"batch": True,
"relaxed_isolation": True,... |
<vulnerable_code><commit_title>[PATCH] Use spawn with git to avoid shell script vulnerabilities<commit_description><fixed_code>
const { spawn } = require('child_process');
/**
* Executes git with given arguments string. resolves with the output message
* @param {String} string
* @return {Promise}
*/
module.export... |
<vulnerable_code>const exec = require('async-execute');
const {
list,
modified,
remote,
reset,
* @type {Array[]}
*/
const outputs = [
[ 'branch', 'git rev-parse --abbrev-ref HEAD' ],
[ 'origin', 'git remote get-url origin' ],
];
/**
* @type {Array[]}
*/
const lists = [
[ 'changed', 'git diff-tree --no-comm... |
<vulnerable_code>module.exports = {
list: require('./list'),
modified: require('./modified'),
remote: require('./remote'),
reset: require('./reset'),<commit_title>[PATCH] Use spawn with git to avoid shell script vulnerabilities<commit_description><fixed_code>
module.exports = {
modified: require('./modified'),
re... |
<vulnerable_code>const exec = require('async-execute');
/**
* List the output lines from command
* @return {string[]}
*/
module.exports = async function list(command) {
const output = await exec(command);
return output
.split('\n')
.map(item => item.trim())
.filter(Boolean)
;
};<commit_title>[PATCH] Use s... |
<vulnerable_code>const { clean, override } = abuser(__filename);
const diff = `
line 1
line 2
line 3
line 5
`;
describe('lib/list', async() => {
const exec = stub();
let list;
before(() => {
clean('.');
override('async-execute', exec);
exec.returns(diff);
list = require('.').bind(null, 'some command'... |
<vulnerable_code>const { resolve } = require('path');
const exec = require('async-execute');
const exist = require('@does/exist');
/**
* Create and push a git tag with the last commit message
throw new Error(`Could not find file at path "${absolute}"`);
}
const ts = await exec(`git log -1 --format="%at" -- ${pat... |
<vulnerable_code>const exec = require('async-execute');
/**
* Get remote repo name and owner
* @return {string{}}
*/
module.exports = async function remote() {
const origin = await exec('git remote get-url origin');
const nosuffix = origin.replace(/\.git$/, '');
const [ match ] = nosuffix.match(/[\w-]*\/[\w-]+$/... |
<vulnerable_code>
function cleanup() {
clean('.');
clean('async-execute');
}
describe('lib/remote', () => {
'ssh://[username@]repo_owner1/repo-name',
].forEach(
format => it(`should find owner and repo name in ${format}`, async () => {
override('async-execute', () => format);
const remote = require('.');... |
<vulnerable_code>const exec = require('async-execute');
/**
* Reset current HEAD to the specified state
*/
module.exports = async function(destination, { hard = true } = {}) {
if (destination && typeof destination === 'string') {
return await exec(`git reset ${JSON.stringify(destination)} ${hard ? '--hard' : ''}`... |
<vulnerable_code>
before(() => {
clean('.');
override('async-execute', exec);
reset = require('.');
});
afterEach(() => exec.resetHistory());
});
it('Should hard reset to a given sha', async() => {
reset('shaid');
expect(exec.getCall(0).args[0]).to.equal('git reset "shaid" --hard');
});
it('Should ha... |
<vulnerable_code>const exec = require('async-execute');
/**
* Create and push a git tag with the last commit message
const { message, author, email } = this;
await Promise.all([
exec(`git config user.name "${await author}"`),
exec(`git config user.email "${await email}"`),
]);
await exec(`git tag -a ${JSON.s... |
<vulnerable_code>
before(() => {
clean('.');
override('async-execute', (...args) => dummy.stub(...args));
gitTag = require('.').bind({
message: 'this is a message',
dummy.stub = command => lines.push(command);
await gitTag('1.1.1');
expect(lines).to.include('git config user.name "boaty mcboatface"');
... |
<vulnerable_code>const exec = require('async-execute');
/**
* List all files that would be added by "add ."
* @return {string[]}
*/
module.exports = async function unadded() {
const output = await exec('git add --dry-run .');
return output
.split('\n')<commit_title>[PATCH] Use spawn with git to avoid shell scr... |
<vulnerable_code>
before(() => {
clean('.');
override('async-execute', () => `remove '.gitattributes'
add 'apps/post/index.js'
add 'new file.txt'
`);<commit_title>[PATCH] Use spawn with git to avoid shell script vulnerabilities<commit_description><fixed_code>
before(() => {
clean('.');
override('../../helper... |
<vulnerable_code>const exec = require('async-execute');
const { clean, override } = abuser(__filename);
const list = stub();
let git;
const is = Object.defineProperty(
before(async() => {
clean('.');
clean('./lib');
override('./lib/list', list);
override('./lib/unadded', list);
list.returns([ 'a', 'b', 'c'... |
<vulnerable_code>}
describe('vulnerabilities', async() => {
afterEach(async() => {
await wait(100);
await softly(unlink, 'HACKED');
await softly(git.reset, '; touch HACKED #');
expect(await exists('HACKED')).to.be.false;
});
it('shell injection in tag', async() => {
await softly(git.tag, '; touch HACKED #... |
<vulnerable_code><commit_title>[PATCH] Fix following symlinks when processing the fixup list<commit_description>The previous fix in b41daecb5 was incomplete. Fixup entries are
given the original path without calling cleanup_pathname().
To make sure we don't follow a symlink, we must strip trailing
slashes from the path... |
<vulnerable_code>/* Expect a valid multi-bulk command in the debugging client query buffer.
* On success the command is parsed and returned as an array of SDS strings,
* otherwise NULL is returned and there is to read more buffer. */
sds *ldbReplParseCommand(int *argcp) {
sds *argv = NULL;
int argc = 0;
i... |
<vulnerable_code> if (taglen < 0)
return(-1);
/* make a buffer to hold the tag datand snag it from the input stream */
str=(unsigned char *) AcquireQuantumMemory((size_t) (taglen+MagickPathExtent),
sizeof(*str));
if (str == (unsigned char *) NULL)
return(0);
for (tagindx=0; tagindx<... |
<vulnerable_code> elif operator == b'"':
process_operation(b"T*", [])
process_operation(b"TJ", operands)
elif operator == b"TJ":
for op in operands[0]:
if isinstance(op, (str, bytes)):<commit_title>[PATCH] TD operator forgotten<c... |
<vulnerable_code> mbedtls_snprintf( buf, buflen, "X509 - Read/write of file failed" );
if( use_ret == -(MBEDTLS_ERR_X509_BUFFER_TOO_SMALL) )
mbedtls_snprintf( buf, buflen, "X509 - Destination buffer is too small" );
#endif /* MBEDTLS_X509_USE_C || MBEDTLS_X509_CREATE_C */
// END g... |
<vulnerable_code> /* path_cnt is 0 for the first intermediate CA */
if( 1 + path_cnt > MBEDTLS_X509_MAX_INTERMEDIATE_CA )
{
*flags |= MBEDTLS_X509_BADCERT_NOT_TRUSTED;
return( MBEDTLS_ERR_X509_CERT_VERIFY_FAILED );
}
if( mbedtls_x509_time_is_past( &child->valid_to ) )
}
exit:
... |
<vulnerable_code>
Class.forName(type.getClassPath());
DriverManager.setLoginTimeout(10);
String dbURL = getDatabaseUrl(databaseConfiguration);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguratio... |
<vulnerable_code><commit_title>[PATCH] Properly escape JDBC URL components in database extension<commit_description><fixed_code>
package com.google.refine.extension.database;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
public class DatabaseConfigurationTest {
@Test
publ... |
<vulnerable_code>
static int mptcp_disconnect(struct sock *sk, int flags)
{
struct mptcp_subflow_context *subflow;
struct mptcp_sock *msk = mptcp_sk(sk);
inet_sk_state_store(sk, TCP_CLOSE);
mptcp_for_each_subflow(msk, subflow) {
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
__mptcp_close_ssk(sk, ssk, s... |
<vulnerable_code> case 0xfb: // calls
op->type = R_ANAL_OP_TYPE_CALL;
op->size = 7;
{
int oa = 3;
ut32 delta = buf[oa];
delta |= (ut32)(buf[oa + 1]) << 8;<commit_title>[PATCH] Fix oobread in VAX disassembler (tests_64920) ##crash<commit_description>Reported by giantbranch of NSFOCUS TIANJI Lab<fixed_code... |
<vulnerable_code> }
case FieldType::Struct: {
readStructBegin();
while (true) {
const auto fieldType = readFieldHeader().first;
if (fieldType == FieldType::Stop) {
break;
}
skip(fieldType);
}
readStructEnd();
break;
}
skipKVContain... |
<vulnerable_code>/* Generated by re2c 1.1.1 */
#include "ext_scanners.h"
#include <stdlib.h>
<commit_title>[PATCH 1/4] Rebuild `ext_scanners.c` with latest `re2c`.<commit_description><fixed_code>
/* Generated by re2c 1.3 */
#include "ext_scanners.h"
#include <stdlib.h>
|
<vulnerable_code>/* Generated by re2c 1.3 */
#include "ext_scanners.h"
#include <stdlib.h>
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
yych = *(marker = p);
if (yych <= '{') {
if (yych <= 0x1F) {
if... |
<vulnerable_code>static table_row *row_from_string(cmark_syntax_extension *self,
cmark_parser *parser, unsigned char *string,
int len) {
table_row *row = NULL;
bufsize_t cell_matched = 1, pipe_matched = 1, offset;
int cell_end_offset;
row = (t... |
<vulnerable_code> "unclosed links B":
("[a](b" * 30000,
re.compile("(\[a\]\(b){30000}")),
# "many references":
# ("".join(map(lambda x: ("[" + str(x) + "]: u\n"), range(1,5000 * 16))) + "[0] " * 5000,
# re.compile("(\[0\] ){4999}")),
parser.a... |
<vulnerable_code>}
bufsize_t _scan_table_cell(const unsigned char *p) {
const unsigned char *start = p;
{<commit_title>[PATCH 1/4] Rebuild `ext_scanners.c` with latest `re2c`.<commit_description><fixed_code>
}
bufsize_t _scan_table_cell(const unsigned char *p) {
const unsigned char *marker = NULL;
const unsi... |
<vulnerable_code>
table_row *row = NULL;
bufsize_t cell_matched = 1, pipe_matched = 1, offset;
int cell_end_offset;
int expect_more_cells = 1;
row = (table_row *)parser->mem->calloc(1, sizeof(table_row));
row->n_columns = 0;
pipe_matched = scan_table_cell_end(string, len, offset + cell_matched);
i... |
<vulnerable_code>{
AP4_Result result;
// check that we have a chunk offset table
if (m_StcoAtom == NULL && m_Co64Atom == NULL) {
return AP4_ERROR_INVALID_FORMAT;<commit_title>[PATCH] fixed possible crashes on malformed inputs.<commit_description><fixed_code>
{
AP4_Result result;
// check t... |
<vulnerable_code> for (unsigned int i=0; i<m_SequenceParameters.ItemCount(); i++) {
inspector.AddField("Sequence Parameter", m_SequenceParameters[i].GetData(), m_SequenceParameters[i].GetDataSize());
}
for (unsigned int i=0; i<m_SequenceParameters.ItemCount(); i++) {
inspector.AddField("Pictu... |
<vulnerable_code> int cursor = -1;
for (unsigned int i=0; i<track_count; i++) {
if (!cursors[i].m_EndReached &&
cursors[i].m_Locator.m_Sample.GetOffset() <= min_offset) {
min_offset = cursors[i].m_Locator.m_Sample.GetOffset();
... |
<vulnerable_code>);
var TooManyRedirectsError = createErrorType(
"ERR_FR_TOO_MANY_REDIRECTS",
"Maximum number of redirects exceeded"
);
var MaxBodyLengthExceededError = createErrorType(
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
// React to responses of native requests
var self = this;
this._onNativeResponse = func... |
<vulnerable_code> }))
.catch(function (error) {
assert(error instanceof Error);
assert(error instanceof TypeError);
assert.equal(error.message, "Unsupported protocol about:");
});
});
});
.catch(function (error) {
assert(!redirected);
... |
<vulnerable_code> [SPECIAL_GLYPH_LIGHT_SHADE] = "-",
[SPECIAL_GLYPH_DARK_SHADE] = "X",
[SPECIAL_GLYPH_SIGMA] = "S",
[SPECIAL_GLYPH_ARROW_RIGHT] = "->",
... |
<vulnerable_code> dump_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN);
dump_glyph(SPECIAL_GLYPH_CIRCLE_ARROW);
dump_glyph(SPECIAL_GLYPH_BULLET);
dump_glyph(SPECIAL_GLYPH_ARROW_RIGHT);
dump_glyph(SPECIAL_GLYPH_ARROW_UP);
dump_glyph(SPECIAL_GLYPH_ARROW_DOWN);<commit_title>[PATCH] ... |
<vulnerable_code> if (!settings->ClientProductId)
goto out_fail;
settings->ClientHostname = calloc(1, 32);
if (!settings->ClientHostname)
goto out_fail;
DWORD size = 31;
GetComputerNameA(ClientHostname, &size);
if (!freerdp_settings_set_string(settings, FreeRDP_ClientHostname, ClientHostname))
goto out_fai... |
<vulnerable_code>#endif
#include <winpr/crt.h>
#include <winpr/sspi.h>
#include <winpr/print.h>
#include <winpr/tchar.h><commit_title>[PATCH] Fixed backport compile problems<commit_description><fixed_code>
#endif
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/sspi.h>
#include <winpr/print.h>
#includ... |
<vulnerable_code>#include "../../log.h"
#define TAG WINPR_TAG("sspi.NTLM")
static const char NTLM_SIGNATURE[8] = { 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0' };
const char* ntlm_get_negotiate_string(UINT32 flag)
*message = empty;
s = Stream_StaticInit(&sbuffer, buffer->pvBuffer, buffer->cbBuffer);
if (!s)
return... |
<vulnerable_code> *elem_rtrn = NULL;
*field_rtrn = xkb_atom_text(ctx, expr->ident.ident);
*index_rtrn = NULL;
return true;
case EXPR_FIELD_REF:
*elem_rtrn = xkb_atom_text(ctx, expr->field_ref.element);
*field_rtrn = xkb_atom_text(ctx, expr->field_ref.field);<commit_tit... |
<vulnerable_code>
openCL_library->clGetProgramBuildInfo(device->program,device->deviceID,
CL_PROGRAM_BUILD_LOG,0,NULL,&log_size);
log=(char*)AcquireMagickMemory(log_size);
openCL_library->clGetProgramBuildInfo(device->program,device->deviceID,
CL_PROGRAM_BUILD_LOG,log_size,log,&log_size);
<commit_title>[P... |
<vulnerable_code> sprintf(id,"..##PE%d_%d_%d",k,i,j);
ImGui::PushStyleColor(ImGuiCol_Text,inactiveColor);
} else {
sprintf(id,"%.2X##PE%d_%d_%d",pat->data[i][index],k,i,j);
if (pat->data[i][index]<0x10) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[pa... |
<vulnerable_code>char *
guestfs___first_line_of_file (guestfs_h *g, const char *filename)
{
CLEANUP_FREE char **lines = NULL; /* sic: not CLEANUP_FREE_STRING_LIST */
int64_t size;
char *ret;
ret = lines[0]; /* caller frees */
return ret;
}
<commit_title>[PATCH] inspection: Fix double-free whe... |
<vulnerable_code>{
while (gf_list_count(writers)) {
TrackWriter *writer = (TrackWriter*)gf_list_get(writers, 0);
gf_isom_box_del(writer->stco);
gf_isom_box_del((GF_Box *)writer->stsc);
gf_free(writer);<commit_title>[PATCH] fixed #1661<commit_description><fixed_code>
{
while (gf_list_count(writers)) {
TrackW... |
<vulnerable_code> int aligned_height;
if (!c->framebuf || c->old_width < c->width || c->old_height < c->height) {
c->framebuf_stride = FFALIGN(c->width * 3, 16);
aligned_height = FFALIGN(c->height, 16);
av_free(c->framebuf);
c->framebuf = av_mallocz(c->framebuf_stride * al... |
<vulnerable_code> case COMPRESSION_ADOBE_DEFLATE: image->compression=ZipCompression; break;
default: image->compression=RLECompression; break;
}
/*
Allocate memory for the image and pixel buffer.
*/
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo ... |
<vulnerable_code> spin_lock(&sl->lock);
if (netif_queue_stopped(dev)) {
if (!netif_running(dev))
goto out;
/* May be we must check transmitter timeout here ?<commit_title>[PATCH] drivers: net: slip: fix NPD bug in sl_tx_timeout()<commit_description>When a slip driver is detaching, the slip_close() will act to... |
<vulnerable_code> e = gf_bifs_dec_sf_field(codec, bs, node, &sffield, GF_FALSE);
if (e) return e;
}
} else {
last = NULL;
for (i=0; i<nbFields; i++) {
GF_Node *new_node = gf_bifs_dec_node(codec, bs, field->NDTtype);
if (new_node) {
e = gf_node_register(new_node, is_mem_com ? NULL : node);
if (... |
<vulnerable_code><commit_title>[PATCH] Regression test for<commit_description><fixed_code>
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors
class ImagePrintIFDStructure(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/ex... |
<vulnerable_code>
ArenaAllocator tempAllocator(_u("ClassMemberNames"), m_nodeAllocator.GetPageAllocator(), Parser::OutOfMemory);
ParseNodePtr pnodeClass = nullptr;
if (buildAST)
{
pnodeClass = CreateNode(knopClassDecl);
CHAKRATEL_LANGSTATS_INC_LANGFEATURECOUNT(Class, m_scriptContext);
... |
<vulnerable_code> LPCUTF8 pbStart = pFuncBody->GetSource(_u("ScriptFunction::EnsureSourceString"));
BufferStringBuilder builder(cch, scriptContext);
utf8::DecodeOptions options = pFuncBody->GetUtf8SourceInfo()->IsCesu8() ? utf8::doAllowThreeByteSurrogates : utf8::doDefault;
... |
<vulnerable_code><commit_title>[PATCH] [CVE-2017-0230] Fix incorrect byte offset values for the<commit_description><fixed_code>
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. Se... |
<vulnerable_code> sp;
png_uint_32
length,
nibbles;
13,14,15};
sp=text[ii].text+1;
length=text[ii].text_length;
/* look for newline */
while ((*sp != '\n') && length--)
sp++;
/* look for length */
while (((*sp == '\0' || *sp == ' ' || *sp == '\n')) && length--)
sp++... |
<vulnerable_code>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <utype.h>
#include "utype.c"
#define ACUTE 0x1
char buffer[400], buffer2[400];
out = fopen("gdrawbuildchars.c","w");
fprintf(out,"#include \"gdrawP.h\"\n\n" );
for ( i=0; names[i].name!=NULL; ++i )
fprintf( out, "#... |
<vulnerable_code> *
* Copyright 2020-2022 Nicolas Mora <mail@babelouest.org>
*
* Version 20220425
*
* The MIT License (MIT)
*
*/
#include <pthread.h>
#include <zlib.h>
#include <string.h>
#include <ulfius.h>
static int callback_static_file_uncompressed (const struct _u_request * request, struct _u_response * re... |
<vulnerable_code> return;
}
cil_reset_classperms_list(cp->classperms);
}
static void cil_reset_classperms_set(struct cil_classperms_set *cp_set)<commit_title>[PATCH] libsepol/cil: Destroy classperms list when resetting<commit_description><fixed_code>
return;
}
cil_list_destroy(&cp->classperms, CIL_FALSE);
}
... |
<vulnerable_code> bitmapCache->settings = settings;
bitmapCache->update = ((freerdp*)settings->instance)->update;
bitmapCache->context = bitmapCache->update->context;
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;
bitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapCache->maxCells, sizeof(BITMAP_V2_CELL));... |
<vulnerable_code> // care of many other things
BlockAsyncRendererConfiguration configuration = createBlockAsyncRendererConfiguration(null, xdom, context);
// Configure the Transformation Context XDOM depending on the mode asked.
configuration.setXDOM(getXDOM(referencedDocReference, param... |
<vulnerable_code> tag=((unsigned int) ReadBlobLSBShort(image) << 16) |
ReadBlobLSBShort(image);
length=(size_t) ReadBlobLSBLong(image);
if (tag == 0xFFFEE0DD)
break; /* sequence delimiter tag */
if (tag != 0xFFFEE000)<commit_title>[PATCH] https://github.com... |
<vulnerable_code>string sanitize_proprietary_tags(string input_string)
{
unsigned int i;
size_t input_string_size;
bool strip = false;
bool tag_open = false;
int tag_open_idx = 0; //Are we within < > ?
close_tagname[i] = 0;
}
input_string_size = input_string.size();
for (i = 0; i < input_string_si... |
<vulnerable_code> },
csp: {
enable: toBooleanConfig(process.env.CMD_CSP_ENABLE),
reportURI: process.env.CMD_CSP_REPORTURI
},
cookiePolicy: process.env.CMD_COOKIE_POLICY,
protocolUseSSL: toBooleanConfig(process.env.CMD_PROTOCOL_USESSL),<commit_title>[PATCH] Allow configuring Disqus & GA CSP with env var... |
<vulnerable_code><commit_title>[PATCH] Tests for #248<commit_description><fixed_code>
#include <stdio.h>
#include "gd.h"
#include "gdtest.h"
int main(int argc, char **argv)
{
gdImagePtr im;
FILE *fp = gdTestFileOpen("tga/bug00248.tga");
im = gdImageCreateFromTga(fp);
gdTestAssert(im == NULL);
fclo... |
<vulnerable_code> }
}
*state = CCS_VALUE;
*type = CCV_CLASS;
return 0;
}<commit_title>[PATCH 6/7] NEWS<commit_description><fixed_code>
}
}
if (*state != CCS_START)
*state = CCS_VALUE;
*type = CCV_CLASS;
return 0;
} |
<vulnerable_code>#include "iwl-trans.h"
/* priv->shrd->sta_lock must be held */
static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
{
if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE))
IWL_ERR(priv, "ACTIVATE a non DRIVER active station id %u "
"addr %pM\n",
IWL_DEBUG_ASSOC(priv, "Ad... |
<vulnerable_code>#endif
#define _MODULE_STRING _XSTR(MODULE_NAME)
/* Object references for the counter_shortcut */
static PyObject *_counter_module = NULL;
static PyTypeObject *PCT_CounterBEType = NULL;
}
memset(new->IV, 0, BLOCK_SIZE);
memset(new->oldCipher, 0, BLOCK_SIZE);
memcpy(new->IV, IV, IVlen);
new->mode ... |
<vulnerable_code> * buffers are same */
static void copyIPv6IfDifferent(void * dest, const void * src)
{
if(dest != src) {
memcpy(dest, src, sizeof(struct in6_addr));
}
}<commit_title>[PATCH] pcpserver.c: copyIPv6IfDifferent() check for NULL src<commit_description><fixed_code>
* buffers are same */
static void cop... |
<vulnerable_code> if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/(^|\s)(~|#)/g, "$1\\$2")... |
<vulnerable_code> },
title(_, { input, interpolation, quoted, shellName }) {
input = input
.replace(/\u0000/g, "U+0000")
.replace(/\t/g, "\\t")
.replace(/\n/g, "\\n")
.replace(/\v/g, "\\v")
.replace(/\f/g, "\\f")
.replace(/\r/g, "\\r")
.replace(/\u0085/g, "U+0085")
... |
<vulnerable_code> return hdrlen;
}
if (ndo->ndo_vflag)
ND_PRINT((ndo,"%04x:%04x ", panid, EXTRACT_LE_16BITS(p + 2)));
p += 2;
caplen -= 2;
hdrlen += 2;<commit_title>[PATCH] CVE-2017-13000/IEEE 802.15.4: Fix bug introduced two fixes<commit_description><fixed_code>
return hdrlen;
}
if (ndo->ndo_vfla... |
<vulnerable_code> makePredicate,
return_this,
string_template,
regexp_source_fix
} from "../utils/index.js";
import {
AST_Array,
def_eval(AST_RegExp, function (compressor) {
let evaluated = compressor.evaluated_regexps.get(this.value);
if (evaluated === undefined) {
try {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.