text stringlengths 79 3.72M |
|---|
<vulnerable_code><commit_title>[PATCH 2/2] =?UTF-8?q?=E6=94=B9=E5=81=9A=E7=94=A8format=5Fhtml?=<commit_description><fixed_code>
from django.test.testcases import TestCase
from tuitse import kiamtsa
from tuitse.html import tuitse_html
class TuaLiongTuiTse(TestCase):
def test_tuitse(self):
tsusin = kiamts... |
<vulnerable_code>
def tuitse_html(kiamtsa_tinliat):
html = ''
htmlsu = ''
kam_ting_tsit_hing_si_lomaji = False
kam_ting_tsit_im_si_lomaji = False
for ji in kiamtsa_tinliat:
if ji[2] == THAU_JI:
# Thòo sû ê html
if htmlsu:
html += "<ruby>{}</ruby>".for... |
<vulnerable_code> }).done(function (result) {
if (typeof result === undefined) {
$.growl.error({message: "No answer received from server"});
} else {
var moduleTechName = Object.keys(result)[0];
if (result[moduleTechName].status === false) {
if (typeof result[moduleTech... |
<vulnerable_code> * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
(0,window.$)(function(){var e=new l.default;new u.default,new a.default(e)})},4:function(e,t)... |
<vulnerable_code> * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
(0,t.$)(function(){(new o.default).init()})}).call(e,n(1))},4:function(t,e){!function(){t.exp... |
<vulnerable_code> unsigned char cmd = *delta++;
if (cmd & 0x80) {
/* cmd is a copy instruction; copy from the base. */
size_t off = 0, len = 0;
#define ADD_DELTA(o, shift) { if (delta < delta_end) (o) |= ((unsigned) *delta++ << shift); else goto fail; }
if (cmd & 0x01) ADD_DELTA(off, 0UL);
if (!len) ... |
<vulnerable_code>
private static boolean isNamespaceAware = true;
/**
* Construct a new builder object that wraps the given XML document.
* This constructor is for internal use only.
}
}
/**
* Construct an XML Document with a default namespace with the given
* root element.... |
<vulnerable_code> super(myNode, parentNode);
}
/**
* Construct a builder for new XML document with a default namespace.
* The document will be created with the given root element, and the builder
public static XMLBuilder create(String name, String namespaceURI)
throws ParserConfigu... |
<vulnerable_code> * the name of the document's root element.
* @param namespaceURI
* default namespace URI for document, ignored if null or empty.
* @return
* a builder node that can be used to add more nodes to the XML document.
* @throws XMLBuilderRuntimeException
* to wrap {@link Pa... |
<vulnerable_code>import java.io.StringWriter;
import java.util.Properties;
import javax.xml.transform.OutputKeys;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
"parse", InputSource.class).invoke(null, source);
}
protected BaseXMLBuilder XMLBuilder_parse(St... |
<vulnerable_code> l_current_pi->include = 00;
if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U)))
{
l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
}
if<commit_title>[PATCH] Cast to size_t before multiplication<commit_description>Need to cast to size_t befo... |
<vulnerable_code> return SocketFactory.getDefault();
}
try {
return (SocketFactory) ObjectFactory.instantiate(socketFactoryClassName, info, true,
PGProperty.SOCKET_FACTORY_ARG.get(info));
} catch (Exception e) {
throw new PSQLException(
return new LibPQFactory(info);
}
... |
<vulnerable_code> } else {
AuthenticationPlugin authPlugin;
try {
authPlugin = (AuthenticationPlugin) ObjectFactory.instantiate(authPluginClassName, info,
false, null);
} catch (Exception ex) {
LOGGER.log(Level.FINE, "Unable to load Authentication Plugin " + ex.toString(... |
<vulnerable_code> String sslpasswordcallback = PGProperty.SSL_PASSWORD_CALLBACK.get(info);
if (sslpasswordcallback != null) {
try {
cbh = (CallbackHandler) ObjectFactory.instantiate(sslpasswordcallback, info, false, null);
} catch (Exception e) {
throw new PSQLException(
GT.... |
<vulnerable_code> sslhostnameverifier = "PgjdbcHostnameVerifier";
} else {
try {
hvn = (HostnameVerifier) instantiate(sslhostnameverifier, info, false, null);
} catch (Exception e) {
throw new PSQLException(
GT.tr("The HostnameVerifier class provided {0} could not be ins... |
<vulnerable_code> * @throws IllegalAccessException if something goes wrong
* @throws InvocationTargetException if something goes wrong
*/
public static Object instantiate(String classname, Properties info, boolean tryString,
@Nullable String stringarg)
throws ClassNotFoundException, SecurityExcept... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-v7wg-cpwc-24m4<commit_description>This ensures arbitrary classes can't be passed instead of
AuthenticationPlugin, SocketFactory, SSLSocketFactory, CallbackHandler, HostnameVerifier<fixed_code>
/*
* Copyright (c) 2022, PostgreSQL Global Development Gro... |
<vulnerable_code>%
*/
static inline void CopyPixels(PixelPacket *destination,
const PixelPacket *source,const MagickSizeType number_pixels)
{
#if !defined(MAGICKCORE_OPENMP_SUPPORT) || (MAGICKCORE_QUANTUM_DEPTH <= 8)
(void) memcpy(destination,source,(size_t) number_pixels*sizeof(*source));
#else
{
register M... |
<vulnerable_code> }
$('<strong/>', {
'text': service.name
}).appendTo($serviceDescription);
if (service.description) {<commit_title>[PATCH] Escape the legal settings, service and category name in the<commit_description><fixed_code>
}
$('<strong/>', {
... |
<vulnerable_code> # Copy pythonXY.dll (or pythonXY_d.dll)
ver = sys.version_info
dll = f'python{ver.major}{ver.minor}'
if debug_build(sys.executable):
dll += '_d'
dll += '.dll'
dll = os.path.join(os.path.d... |
<vulnerable_code> memcpy(vl->data, d, vl->size);
d+=16;
break;
}
switch (PROP_ID(mp->id)) {<commit_title>[PATCH] avoid infinite loop for malicious input files<commit_description><fixed_code>
memcpy(vl->data, d, vl->size);
d+=16;
break;
default:
print... |
<vulnerable_code> self.evaluate(bincount_ops.sparse_bincount(x, weights=weights, axis=-1))
@test_util.run_all_in_graph_and_eager_modes
@test_util.disable_tfrt
class RawOpsTest(test.TestCase, parameterized.TestCase):<commit_title>[PATCH] Fix heap out of bounds error in<commit_description><fixed_code>
self.e... |
<vulnerable_code>#endif
expand_T xpc;
long *b_im_ptr = NULL;
cmdline_info_T save_ccline;
int did_save_ccline = FALSE;
int cmdline_type;
b_im_ptr = &curbuf->b_p_iminsert;
else
b_im_ptr = &curbuf->b_p_imsearch;
if (*b_im_ptr == B_IMODE_LMAP)
State |= MODE_LANGMAP;
#ifdef HAVE_INPUT_... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
489,
/**/<commit_title>[PATCH] patch 9.0.0490: using freed memory with cmdwin and BufEnter<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
49... |
<vulnerable_code> }
if (bwt_idx == -1) {
if (data_size - 8 > 64) {
state->last_error = BZ3_ERR_MALFORMED_HEADER;
return -1;
}<commit_title>[PATCH] store mode: check for truncation<commit_description><fixed_code>
}
if (bwt_idx == -1) {
if (data_size - 8 > ... |
<vulnerable_code> it('reverts', async function () {
await expectRevert(
transferFunction.call(this, other, other, tokenId, { from: owner }),
'ERC721: transfer of token that is not own',
);
});
});<commit_title>[PATCH 1/5] Fix a typo in erc20... |
<vulnerable_code> if (dma_mapping_error(&adapter->pdev->dev,
rbi->dma_addr)) {
dev_kfree_skb_any(rbi->skb);
rq->stats.rx_buf_alloc_failure++;
break;
}
if (dma_mapping_error(&adapter->pdev->dev,
rbi->dma_addr)) {
put_page(rbi->page);
rq->stats.rx_buf_alloc_fail... |
<vulnerable_code> }
case AndEvaluateOperator:
{
result=(MagickRealType) ((size_t) pixel & (size_t) (value+0.5));
break;
}
case CosineEvaluateOperator:
}
case LeftShiftEvaluateOperator:
{
result=(MagickRealType) ((size_t) pixel << (size_t) (value+0.5));
break;
}... |
<vulnerable_code>
@DDMFormField(
label = "%allow-multiple-selections",
properties = {"showAsSwitcher=true"}, visibilityExpression = "FALSE"
)
public boolean multiple();
<commit_title>[PATCH] Revert "LPS-70780 Remove multiple select switch"<commit_description>This reverts commit c2af35f4e5bf724e621f574a0bfd300d5c... |
<vulnerable_code> bb->failbb->prev = NULL;
bb->failbb = NULL;
}
R_FREE (bb);
}
R_API RList *r_anal_bb_list_new() {<commit_title>[PATCH] Fix #10293 - Use-after-free in r_anal_bb_free()<commit_description><fixed_code>
bb->failbb->prev = NULL;
bb->failbb = NULL;
}
if (bb->next) {
// avoid double free
bb->n... |
<vulnerable_code> unsigned long flags;
spin_lock_irqsave(&task->task_state_lock, flags);
if (!(task->task_state_flags & SAS_TASK_STATE_DONE))
task->task_state_flags |= SAS_TASK_STATE_ABORTED;
spin_unlock_irqrestore(&task->task_state_lock, flags);
complete(&task->slow_task->completion);
}
static void smp_task_d... |
<vulnerable_code> // to prevent filter to update while downloading
downloadingClusters = true;
show_loading_cluster();
update_centroids_data(function(data, centroids_file_key, cluster_type){
var centroids = convert_light_json_to_geojson(data, cluster_type)
// Creat... |
<vulnerable_code>
return (!_cups_strcasecmp(con->clientname, "localhost") ||
!_cups_strcasecmp(con->clientname, "localhost.") ||
#ifdef __linux
!_cups_strcasecmp(con->clientname, "localhost.localdomain") ||
#endif /* __linux */
!strcmp(con->clientname, "127.0.0.1") ||
!strcmp(con->clientn... |
<vulnerable_code> EXPECT_EQ(offset, 0);
}
catch (std::bad_alloc& err) {
GTEST_SKIP() << "Unable to allocate memory for overflow tests\n";
}
}
<commit_title>[PATCH] Update tests<commit_description>Replace call to GTEST_SKIP with output to stderr. Remove the
redResponseOversize test since out-of-memory error... |
<vulnerable_code> EXPECT_EQ(a._request.length(), 0);
}
catch (std::bad_alloc& err) {
GTEST_SKIP() << "Unable to allocate memory for overflow test\n";
}
}
Expect_close(8);
}
// Test to fail when content-length is too large
TEST_F(MockSocketTest, readHeader_oversize) {
XmlRpcClientForTest a("localhost"... |
<vulnerable_code>
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream):... |
<vulnerable_code>
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
from emitter import *
from serializer import *
default_flow_style=default_flow_style)
Resolver.__init__(self)
class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver):
def __init__(self, stream,
default... |
<vulnerable_code>
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from reader import *
from scanner import *
BaseConstructor.__init__(self)
BaseResolver.__init__(self)
class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver):
def __init__(self, stream):
Reader.__ini... |
<vulnerable_code> NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict, \
FixedOffset, today, execute
class MyLoader(yaml.Loader):
pass
class MyDumper(yaml.Dumper):
pass
class MyTestClass1:
sys.modules['test_constructor'] = sys.modules['__ma... |
<vulnerable_code> value2 = None
output2 = None
try:
output1 = yaml.dump(value1)
value2 = yaml.load(output1)
output2 = yaml.dump(value2)
assert output1 == output2, (output1, output2)
finally:
if verbose:
if __name__ == '__main__':
import test_appliance
test_... |
<vulnerable_code> */
abstract class JsonNumberImpl implements JsonNumber {
private int hashCode;
private final int bigIntegerScaleLimit;
@Override
public BigInteger bigIntegerValue() {
BigDecimal bd = bigDecimalValue();
if (bd.scale() <= bigIntegerScaleLimit) {
return bd.to... |
<vulnerable_code>public interface JsonConfig {
/**
* Configuration property to limit maximum value of BigInteger scale value.
* This property limits maximum value of scale value to be allowed
* in {@link jakarta.json.JsonNumber#bigIntegerValue()}
* and {@link jakarta.json.JsonNumber#bigIntegerV... |
<vulnerable_code> } catch (UnsupportedOperationException e) {
// UnsupportedOperationException is expected to be thrown
assertEquals(
"Scale value 50001 of this BigInteger exceeded maximal allowed value of 50000",
e.getMessage());
}
... |
<vulnerable_code> } catch (UnsupportedOperationException e) {
// UnsupportedOperationException is expected to be thrown
assertEquals(
"Scale value 100001 of this BigInteger exceeded maximal allowed value of 100000",
e.getMessage());
}
}
... |
<vulnerable_code> ifr.onload = function() {
if (ifr.contentWindow.document.readyState == 'complete')
setTimeout(function() {
ifr.contentDocument.getElementById("google_translate_element").innerHTML = text;
if (text.length)
ifr.contentDocument.getElementById("div_btn").classList.remove("hid... |
<vulnerable_code>
self._oauth2.getOAuthAccessToken(code, params,
function(err, accessToken, refreshToken, params) {
if (err || !accessToken) { return self.error(self._createOAuthError('Failed to obtain access token', err)); }
self._loadUserProfile(accessToken, function(err, profile) {... |
<vulnerable_code> });
}); // that errors due to token request error, in node-oauth object literal form with text body
describe('that errors due to verify callback supplying error', function() {
var strategy = new OAuth2Strategy({
authorizationURL: 'https://www.example.com/oauth2/authoriz... |
<vulnerable_code> Convert stripped TIFF image.
*/
extent=TIFFStripSize(tiff)+sizeof(uint32);
strip_pixels=(unsigned char *) AcquireQuantumMemory(extent,
sizeof(*strip_pixels));
if (strip_pixels == (unsigned char *) NULL)<commit_title>[PATCH] https://github.com/ImageMag... |
<vulnerable_code> chunk = []
for room_result in room_results:
room_id = room_result["room_id"]
assert isinstance(room_id, str)
joined_users = await self.store.get_users_in_room(room_id)
entry = await self.room_list_handler.generate_room_entry(<commit_title... |
<vulnerable_code># See the License for the specific language governing permissions and
# limitations under the License.
from typing import Any, Dict, List, Optional, Tuple, Union
from synapse.api.errors import SynapseError
from synapse.storage._base import SQLBaseStore, db_to_json
_DEFAULT_CATEGORY_ID = ""
_DEFAULT_R... |
<vulnerable_code> return (kvm_apic_get_reg(apic, APIC_ID) >> 24) & 0xff;
}
static void recalculate_apic_map(struct kvm *kvm)
{
struct kvm_apic_map *new, *old = NULL;
if (apic_x2apic_mode(apic)) {
new->ldr_bits = 32;
new->cid_shift = 16;
new->cid_mask = new->lid_mask = 0xffff;
} else if (kvm_apic_sw_enabl... |
<vulnerable_code> if (s_den == 0) {
return 0;
} else {
return php_ifd_get32s(value, motorola_intel) / s_den;
}
case TAG_FMT_SSHORT: return php_ifd_get16u(value, motorola_intel);<commit_title>[PATCH] Fix bug #73737 FPE when parsing a tag format<commit_description><fixed_code>
if (s_den == 0) {
... |
<vulnerable_code> struct ieee80211_radiotap_header *radiotap_header,
int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns)
{
/* Linux only supports version 0 radiotap format */
if (radiotap_header->it_version)
return -EINVAL;
*/
if ((unsigned long)iterator->_arg -
(unsigned long)it... |
<vulnerable_code> vs_param_set->header.len =
cpu_to_le16((((u16) priv->vs_ie[id].ie[1])
& 0x00FF) + 2);
memcpy(vs_param_set->ie, priv->vs_ie[id].ie,
le16_to_cpu(vs_param_set->header.len));
*buffer += le16_to_cpu(vs_param_set->header.len) +<commit_title>[PATCH] mwifiex: Fix possible buffer over... |
<vulnerable_code> },
)
class DownloadResourceTestCase(GeoNodeBaseTestSupport):
def setUp(self):<commit_title>[PATCH] Merge pull request from GHSA-rmxg-6qqf-x8mr<commit_description>* - Fixes "Server Side Request forgery"
* Fixes IP or domain extraction
* fixed formatting
* - Bump ipaddress to... |
<vulnerable_code>from geonode.upload.models import Upload
from geonode.base.models import ResourceBase
from geonode.storage.manager import storage_manager
from geonode.utils import resolve_object, check_ogc_backend, get_headers, http_client, json_response
from geonode.base.enumerations import LINK_TYPES as _LT
from ge... |
<vulnerable_code>import requests
import tempfile
import importlib
import itertools
import traceback
import subprocess
return url
def get_xpath_value(
element: etree.Element, xpath_expression: str, nsmap: typing.Optional[dict] = None
) -> typing.Optional[str]:<commit_title>[PATCH] Merge pull request from GHSA-... |
<vulnerable_code>
return jsonify(success=True, message=gettext("Thanks for signing up!"))
@app.route("/presale/join", methods=["POST"], strict_slashes=False)
def join_presale():
full_name = request.form["full_name"]
email = request.form["email"]
desired_allocation = request.form["desired_allocation"]
... |
<vulnerable_code>
int width = (_ifd->maxX - _ifd->minX + 1);
copyIntoDeepFrameBuffer (readPtr, slice.base,
(char*) (&_ifd->sampleCount[0][0]
- _ifd->minX
... |
<vulnerable_code> // if no channels are being read that are present in file, cachedBuffer will be empty
//
if (ifd->cachedBuffer->begin() != ifd->cachedBuffer->end())
{
ifd->tFile->readTiles (0, ifd->tFile->numXTiles (0) - 1, j, j);
}<commit_ti... |
<vulnerable_code> else return (T*) _data->_inputFiles[partNumber];
}
template InputFile* MultiPartInputFile::getInputPart<InputFile>(int);
template TiledInputFile* MultiPartInputFile::getInputPart<TiledInputFile>(int);<commit_title>[PATCH] add exrcheck binary and function in IlmImfUtil<commit_description>Signe... |
<vulnerable_code> {
if (!isTiled (_data->version))
throw IEX_NAMESPACE::ArgExc ("Expected a tiled file but the file is not tiled.");
}
else
{<commit_title>[PATCH] add exrcheck binary and function in IlmImfUtil<commit_description>Signed-off-by: Peter Hillman <peterh@wetafx.co.... |
<vulnerable_code><commit_title>[PATCH] add exrcheck binary and function in IlmImfUtil<commit_description>Signed-off-by: Peter Hillman <peterh@wetafx.co.nz><fixed_code>
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenEXR Project.
#include "ImfCheckFile.h"
#include "Iex.h"
#include "ImfRgba... |
<vulnerable_code><commit_title>[PATCH] add exrcheck binary and function in IlmImfUtil<commit_description>Signed-off-by: Peter Hillman <peterh@wetafx.co.nz><fixed_code>
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenEXR Project.
#include <ImfCheckFile.h>
#include <iostream>
#include <fs... |
<vulnerable_code>static void *callbackValDup(void *privdata, const void *src) {
((void) privdata);
redisCallback *dup = malloc(sizeof(*dup));
memcpy(dup,src,sizeof(*dup));
return dup;
}
void redisAsyncSetTimeout(redisAsyncContext *ac, struct timeval tv) {
if (!ac->c.timeout) {
ac->c.timeout ... |
<vulnerable_code>/* Create a new hash table */
static dict *dictCreate(dictType *type, void *privDataPtr) {
dict *ht = malloc(sizeof(*ht));
_dictInit(ht,type,privDataPtr);
return ht;
}
n.size = realsize;
n.sizemask = realsize-1;
n.table = calloc(realsize,sizeof(dictEntry*));
/* Copy all the... |
<vulnerable_code>
int mingw_open (const char *filename, int oflags, ...)
{
typedef int (*open_fn_t)(wchar_t const *wfilename, int oflags, ...);
va_list args;
unsigned mode;
return -1;
}
if ((oflags & O_APPEND) && !is_local_named_pipe_path(filename))
open_fn = mingw_open_append;
else
open_fn = _wopen;
HAN... |
<vulnerable_code> # unroutable addresses.
self.url_preview_ip_range_blacklist = generate_ip_set(
config["url_preview_ip_range_blacklist"],
["0.0.0.0", "::"],
config_path=("url_preview_ip_range_blacklist",),
)
<commit_title>[PATCH] Update... |
<vulnerable_code>
# Always blacklist 0.0.0.0, ::
self.ip_range_blacklist = generate_ip_set(
ip_range_blacklist, ["0.0.0.0", "::"], config_path=("ip_range_blacklist",)
)
self.ip_range_whitelist = generate_ip_set(
# Always blacklist 0.0.0.0, ::
self.federation_... |
<vulnerable_code>from tlsfuzzer.messages import Connect, ClientHelloGenerator, \
ClientKeyExchangeGenerator, ChangeCipherSpecGenerator, \
FinishedGenerator, ApplicationDataGenerator, AlertGenerator, \
TCPBufferingEnable, TCPBufferingDisable, TCPBufferingFlush, fuzz_mac
from tlsfuzzer.expect import ExpectSer... |
<vulnerable_code> if (hostname_or_ip[0] == '[' &&
(port = strchr(hostname_or_ip, ']')) != NULL) {
len = (size_t)(port - hostname_or_ip - 1);
/* inet_pton() will not parse the IP correctly unless it is in a
* separate string.<commit_title>[PATCH] address: fix buffer overflow<comm... |
<vulnerable_code> goto delete;
xas_store(&xas, xa_mk_value(v));
} else {
if (!test_bit(bit, bitmap->bitmap))
goto err;
__clear_bit(bit, bitmap->bitmap);
xas_set_mark(&xas, XA_FREE_MARK);<commit_title>[PATCH] ida: Fix crash in ida_free when the bitmap is empty<commit_description>The IDA usually detects dou... |
<vulnerable_code> IDA_BUG_ON(ida, !ida_is_empty(ida));
}
static DEFINE_IDA(ida);
static int ida_checks(void)
ida_check_leaf(&ida, 1024 * 64);
ida_check_max(&ida);
ida_check_conv(&ida);
printk("IDA: %u of %u tests passed\n", tests_passed, tests_run);
return (tests_run != tests_passed) ? 0 : -EINVAL;<commit_title... |
<vulnerable_code>bittok2str_internal(register const struct tok *lp, register const char *fmt,
register u_int v, const char *sep)
{
static char buf[256]; /* our stringbuffer */
int buflen=0;
register u_int rotbit; /* this is the bit we rotate through all bitpositions */
register u_int... |
<vulnerable_code># express or implied. See the License for the specific language governing
# permissions and limitations under the License.
__version__ = '2.3.21'<commit_title>[PATCH] CHANGELOG.<commit_description><fixed_code>
# express or implied. See the License for the specific language governing
# permissions and ... |
<vulnerable_code> if (error == 0)
{
init_stream(s, 8192);
rfbEncryptBytes(s->data, v->password);
s->p += 16;
s_mark_end(s);
error = trans_force_write_s(v->trans, s);
{
v->delay_... |
<vulnerable_code>
/*****************************************************************************/
static int APP_CC
xrdp_mm_setup_mod2(struct xrdp_mm *self)
{
char text[256];
char *name;
self->mod->mod_set_param(self->mod, "hostname", name);
g_snprintf(text, 255, "%d", self->wm->session->client_... |
<vulnerable_code> if (jsvGetBoolAndUnLock(jsvObjectGetChild(options, "vertical_byte", 0))) {
if (gfx.data.bpp==1)
gfx.data.flags = (JsGraphicsFlags)(gfx.data.flags | JSGRAPHICSFLAGS_ARRAYBUFFER_VERTICAL_BYTE);
else
jsWarn("vertical_byte only works for 1bpp ArrayBuffers\n");
}
JsVa... |
<vulnerable_code> unsigned int mask = (unsigned int)(1<<gfx->data.bpp)-1;
unsigned int existing = (unsigned int)*ptr;
unsigned int bitIdx = (gfx->data.flags & JSGRAPHICSFLAGS_ARRAYBUFFER_MSB) ? 8-(idx+gfx->data.bpp) : idx;
*ptr = (char)((existing&~(mask<<bitIdx)) | ((col&mask)<<bitIdx));
if... |
<vulnerable_code>
static void cil_reset_perm(struct cil_perm *perm)
{
cil_reset_classperms_list(perm->classperms);
}
static inline void cil_reset_classperms(struct cil_classperms *cp)<commit_title>[PATCH] libsepol/cil: Destroy classperm list when resetting map perms<commit_description>Map perms share the same struct ... |
<vulnerable_code> ASSERT_STRCASEEQ(checksumstr.c_str(),
"ddc5b39c4292120745eb86a67eaa331032cc05a0dafaf6e28ec9aa0f189c408d");
}<commit_title>[PATCH] test: EKU test, testcase<commit_description>Signed-off-by: William Woodruff <william@trailofbits.com><fixed_code>
ASSERT_STRCASEEQ(checksumstr.c_str()... |
<vulnerable_code> /* Set swap file protection bits after creating it. */
if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL
&& curbuf->b_ml.ml_mfp->mf_fname != NULL)
(void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
#endif
}
<commit_title>[PATCH] patch 8.0.1263: others can read the swap fi... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1262,
/**/<commit_title>[PATCH] patch 8.0.1263: others can read the swap file if a user is<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
12... |
<vulnerable_code> mutability,
internal,
nonreentrant_key,
sig,
func_ast_code,
is_from_json,
):
self.output_type = output_type
self.mutability = mutability
self.internal = internal
self.sig = sig
self.gas = None
self.nonre... |
<vulnerable_code>from vyper.ast.signatures.function_signature import FunctionSignature
# Generate default argument function signatures.
# TODO dead code
def generate_default_arg_sigs(code, interfaces, global_ctx):
# generate all sigs, and attach.
total_default_args = len(code.args.defaults)
if total_defaul... |
<vulnerable_code> )
def is_return_from_function(node):
if isinstance(node, vy_ast.Expr) and node.get("value.func.id") == "selfdestruct":
return True
)
def _return_check(node):
if is_return_from_function(node):
return True<commit_title>[PATCH] wip<commit_description><fi... |
<vulnerable_code> self,
name: str,
arguments: OrderedDict,
min_arg_count: int,
max_arg_count: int,
return_type: Optional[BaseTypeDefinition],<commit_title>[PATCH] wip<commit_description><fixed_code>
self,
name: str,
arguments: OrderedDict,
#... |
<vulnerable_code> /* Conversion to Y,U,V buffer */
yuv_width = (width + 1) >> 1;
yuv_height = (height + 1) >> 1;
yuv_nbytes = width * height + 2 * yuv_width * yuv_height;
if ((Y = (unsigned char *)gdCalloc(yuv_nbytes, sizeof(unsigned char))) == NULL) {<commit_title>[PATCH] Fix #73003: Integer Overflow ... |
<vulnerable_code>from langchain.prompts.base import BasePromptTemplate
from langchain.utilities import PythonREPL
DEFAULT_CODE_VALIDATIONS = {'solution_function': 'solution', 'allow_imports': False, 'allow_non_solution_root_scope_expressions': False, 'allow_non_math_operations': True}
class PALChain(Chain):
"""Im... |
<vulnerable_code>
from pydantic import BaseModel, Field
class PythonREPL(BaseModel):
"""Simulates a standalone Python REPL."""
globals: Optional[Dict] = Field(default_factory=dict, alias="_globals")
locals: Optional[Dict] = Field(default_factory=dict, alias="_locals")
def run(self, command: str) -> s... |
<vulnerable_code>"""Test LLM PAL functionality."""
import sys
sys.path.append(r"C:\projects\langchain")
import pytest
from langchain.chains.pal.base import PALChain
from langchain.chains.pal.math_prompt import MATH_PROMPT
from langchain.schema import OutputParserException
from tests.unit_tests.llms.fake_llm import Fa... |
<vulnerable_code>{
var current = parseVersionString(pmaversion);
var latest = parseVersionString(data['version']);
var version_information_message = PMA_messages['strLatestAvailable'] + ' ' + data['version'];
if (latest > current) {
var message = $.sprintf(PMA_messages['strNewerVersion'], data['... |
<vulnerable_code>
if (!info->dirlen)
return;
dp = fn + info->dirlen;
if (info->diridx != cbdata->lastdiridx)
{
cbdata->lastdiridx = info->diridx;<commit_title>[PATCH] Don't set values that are never read<commit_description><fixed_code>
if (!info->dirlen)
return;
if (info->diridx != cbdata->... |
<vulnerable_code>{
struct parsedata *pd = xmlp->userdata;
Pool *pool = pd->pool;
Solvable *s = pd->solvable;
const char *type;
/* ignore all language tags */<commit_title>[PATCH] Don't set values that are never read<commit_description><fixed_code>
{
struct parsedata *pd = xmlp->userdata;
Pool *pool = pd-... |
<vulnerable_code>{
struct parsedata *pd = xmlp->userdata;
Pool *pool = pd->pool;
Solvable *s = pd->solvable;
switch(state)
{<commit_title>[PATCH] Don't set values that are never read<commit_description><fixed_code>
{
struct parsedata *pd = xmlp->userdata;
Pool *pool = pd->pool;
Solvable *s;
switch... |
<vulnerable_code> continue;
if (strncmp(pool_id2str(pool, s->name), "pattern:", 8) != 0)
continue;
dp = s->repo->idarraydata + s->requires;
for (dp = s->repo->idarraydata + s->requires; *dp; dp++)
FOR_PROVIDES(p, pp, *dp)
if (pool->solvables[p].repo == installed)<commit_title>[PATCH] Don't... |
<vulnerable_code> return;
dp->dirs = solv_extend_resize(dp->dirs, dp->ndirs, sizeof(Id), DIR_BLOCK);
dirtraverse = solv_calloc_block(dp->ndirs, sizeof(Id), DIR_BLOCK);
for (parent = 0, i = 0; i < dp->ndirs; i++)
{
if (dp->dirs[i] > 0)
continue;<commit_title>[PATCH] Don't set values that are never re... |
<vulnerable_code>#if 0
printf("do %s [%d]\n", pool_solvid2str(pool, te->p), temedianr[i]);
#endif
s = pool->solvables + te->p;
for (j = te->edges; od.invedgedata[j]; j++)
{
struct s_TransactionElement *te2 = od.tes + od.invedgedata[j];<commit_title>[PATCH] Don't set values that are never read<commit_des... |
<vulnerable_code> litlen -= 32;
}
}
litofs = 0;
}
return oo;
}<commit_title>[PATCH] Don't set values that are never read<commit_description><fixed_code>
litlen -= 32;
}
}
}
return oo;
} |
<vulnerable_code> DWORD nSize = 0;
CHAR* computerName;
if (!Workstation)
{
if (GetComputerNameExA(ComputerNameNetBIOS, NULL, &nSize) ||
static int ntlm_SetContextServicePrincipalNameW(NTLM_CONTEXT* context, LPWSTR ServicePrincipalName)
{
if (!ServicePrincipalName)
{
context->ServicePrincipalName.Buffer = NUL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.