text stringlengths 79 3.72M |
|---|
<vulnerable_code> uint64_t offset;
int bidx = (int) arg2;
assert(bidx <= PCI_BARMAX);
assert(pdi->bar[bidx].type == PCIBAR_MEM32 ||
pdi->bar[bidx].type == PCIBAR_MEM64);
assert(addr >= pdi->bar[bidx].addr &&
addr + size <= pdi->bar[bidx].addr + pdi->bar[bidx].size);
offset = addr - pdi->bar[bidx]... |
<vulnerable_code> prevChar = '';
}
keepPrevChar = false;
// escape
if (token = this.tokenizer.escape(src)) {
src = src.substring(token.raw.length);
continue;
}
//em & strong
if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
src = s... |
<vulnerable_code>
emStrong(src, maskedSrc, prevChar = '') {
let match = this.rules.inline.emStrong.lDelim.exec(src);
if (!match) {
return;
}
let lLength, rLength;
let delimTotal = 0;
let bothDelimTotal = 0;
let nextChar = match[1] || match[2] || '';
if(match[3] && prevChar.matc... |
<vulnerable_code> // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
// () Skip other delimiter (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# ... |
<vulnerable_code> return lookup.get_route_for_model(model, action)
@library.filter()
@register.filter()
def validated_viewname(model, action):
return None
@library.filter()
@register.filter()
def bettertitle(value):<commit_title>[PATCH 1/3] Adds link to Advanced tab to open in API browser<commit_descript... |
<vulnerable_code> "render_markdown",
"meta",
"viewname",
"validated_viewname",
"bettertitle",
"humanize_speed",
"tzoffset",<commit_title>[PATCH 1/3] Adds link to Advanced tab to open in API browser<commit_description><fixed_code>
... |
<vulnerable_code> self.assertEqual(helpers.validated_viewname(ExampleModel, "list"), "plugins:example_plugin:examplemodel_list")
self.assertIsNone(helpers.validated_viewname(ExampleModel, "notvalid"))
def test_bettertitle(self):
self.assertEqual(helpers.bettertitle("myTITle"), "MyTITle")
... |
<vulnerable_code> return lookup.get_route_for_model(model, action)
@library.filter()
@register.filter()
def api_viewname(model, action):
"""
Return the API view name for the given model and action. Does not perform any validation.
Args:
model (models.Model): Class or Instance of a Django Model... |
<vulnerable_code> "render_markdown",
"meta",
"viewname",
"api_viewname",
"validated_viewname",
"validated_api_viewname",
"bettertitle",<commit_title>[PATCH 1/3] Adds link to Advanced tab to open in API browser<commit_description><fixed_c... |
<vulnerable_code> self.assertEqual(helpers.validated_viewname(ExampleModel, "list"), "plugins:example_plugin:examplemodel_list")
self.assertIsNone(helpers.validated_viewname(ExampleModel, "notvalid"))
def test_api_viewname(self):
location = models.Location.objects.first()
self.asser... |
<vulnerable_code> bool warn;
uint_fast32_t mask;
if (roishift == 0 && bgshift == 0) {
return;
}
} else {
/* We are dealing with non-ROI (i.e., background) data. */
mag <<= bgshift;
mask = (1 << numbps) - 1;
/* Perform a basic sanity check on the sample value. */
/* Some implementations writ... |
<vulnerable_code>
int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *a)
{
return (tsfb->numlvls > 0) ? jpc_tsfb_synthesize2(tsfb,
jas_seq2d_getref(a, jas_seq2d_xstart(a), jas_seq2d_ystart(a)),
jas_seq2d_xstart(a), jas_seq2d_ystart(a), jas_seq2d_width(a),
jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->nu... |
<vulnerable_code> if (image->colorspace == LabColorspace)
DecodeLabImage(image,&image->exception);
DestroyTIFFInfo(&tiff_info);
if (image->exception.severity > ErrorException)
break;
DisableMSCWarning(4127)
if (0 && (image_info->verbose != MagickFalse))
RestoreMSCWarning
TIFFPrintDirect... |
<vulnerable_code> self._tf_ifft_for_rank(rank), re, im, result_is_complex=False,
rtol=tol, atol=tol)
@test_util.run_all_in_graph_and_eager_modes
class FFTShiftTest(test.TestCase, parameterized.TestCase):<commit_title>[PATCH 1/2] Add necessary check in fft ops to fix crash<commit_description>This PR tri... |
<vulnerable_code> return s;
}
static int anetListen(char *err, int s, struct sockaddr *sa, socklen_t len, int backlog) {
if (bind(s,sa,len) == -1) {
anetSetError(err, "bind: %s", strerror(errno));
close(s);
return ANET_ERR;
}
if (listen(s, backlog) == -1) {
anetSetError(... |
<vulnerable_code> # Late import to avoid very expensive in-direct import (~1 second) when this function
# is not called / used
import jinja2
undefined = jinja2.Undefined if allow_undefined else jinja2.StrictUndefined
env = jinja2.Environment( # nosec
undefined=undefined, trim_blocks=trim_bl... |
<vulnerable_code> if (rt->dst.error == -EAGAIN) {
ip6_rt_put_flags(rt, flags);
rt = net->ipv6.ip6_null_entry;
if (!(flags | RT6_LOOKUP_F_DST_NOREF))
dst_hold(&rt->dst);
}
<commit_title>[PATCH] ipv6: fix a typo in fib6_rule_lookup()<commit_description>Yi Ren reported an issue discovered by syzkaller, and bisec... |
<vulnerable_code>
GF_Err Media_CheckDataEntry(GF_MediaBox *mdia, u32 dataEntryIndex)
{
GF_DataEntryURLBox *entry;
GF_DataMap *map;
GF_Err e;
if (entry->flags == 1) return GF_OK;
//ok, not self contained, let's go for it...
//we don't know what's a URN yet
if (entry->type == GF_ISOM_BOX_TYPE_URN) return GF_NOT_... |
<vulnerable_code># See the License for the specific language governing permissions and
# limitations under the License.
import codecs
import itertools
import logging
import re
from typing import TYPE_CHECKING, Dict, Generator, Iterable, Optional, Set, Union
if TYPE_CHECKING:
from lxml import etree
from lxml i... |
<vulnerable_code> og = parse_html_to_open_graph(tree)
self.assertEqual(og, {"og:title": "ó", "og:description": "Some text."})
class MediaEncodingTestCase(unittest.TestCase):
def test_meta_charset(self) -> None:<commit_title>[PATCH] Merge pull request from GHSA-22p3-qrh9-cx32<commit_description>* Ma... |
<vulnerable_code> ) {
start = start == null ? 0L : start;
try {
JobIdentifier identifier = restfulService.findJob(pipelineName, pipelineCounter, stageName, stageCounter, buildName);
if (jobInstanceDao.isJobCompleted(identifier) && !consoleService.doesLogExist(identifier)) {
... |
<vulnerable_code> assertThat(((ResponseCodeView) modelAndView.getView()).getStatusCode(), is(SC_NOT_FOUND));
}
@Test
public void shouldFunnelAll_GET_calls() throws Exception {
final ModelAndView returnVal = new ModelAndView();<commit_title>[PATCH] #000 - Validate stage counter in GETs as wel... |
<vulnerable_code> : ClientProtocol::Message("SILENCE")
{
PushParam(mask);
PushParamRef(flags);
}
};
<commit_title>[PATCH] Copy the silence flags when sending update notifications.<commit_description>This fixes a crash bug in the silence module on some versions of GCC.<fixed_code>
: ClientProtocol::Message("SIL... |
<vulnerable_code>
if (ext_from_obj_p->u.array.u.hole_count < ECMA_FAST_ARRAY_HOLE_ONE)
{
ecma_extended_object_t *ext_to_obj_p = (ecma_extended_object_t *) new_array_p;
#if ENABLED (JERRY_ES2015)
ecma_value_t *to_buffer_p = ecma_fast_array_extend (new_array_p, copied_length);
#endif /* ENABLED (JERR... |
<vulnerable_code><commit_title>[PATCH] Fix Array.slice when using fast arrays<commit_description>When a fast array fas used during the Array.slice call and
the input array's properties were removed the property
list was used incorrectly.
Fixes: #3637
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.... |
<vulnerable_code> {
dasharray=(double *) AcquireQuantumMemory((size_t) n+1UL,
sizeof(*dasharray));
p=CurrentContext->dash_pattern;
q=dasharray;
for (i=0; i < (ssize_t) n; i++)
*q++=(*p++);
*q=0.0;
}
return(dasharray);
}<commit_title>[PATCH] https://github.com/Image... |
<vulnerable_code> png_get_IHDR(png_ptr, info_ptr, &mainprog_ptr->width, &mainprog_ptr->height,
&bit_depth, &color_type, NULL, NULL, NULL);
// For overflow safety reject images that won't fit in 32-bit
if (mainprog_ptr->width > INT_MAX/mainprog_ptr->height) {
png_destroy_read_struct(... |
<vulnerable_code> */
struct razer_report razer_chroma_standard_matrix_set_custom_frame(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char *rgb_data)
{
size_t row_length = (size_t) (((stop_col + 1) - start_col) * 3);
struct razer_report report = get_razer_report(0x03, 0x0B, 0... |
<vulnerable_code>import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import be.e_contract.dssp.client.exception.ClientRuntimeException;
import be.e_contract.dssp.client.exception.SubjectNotAuthorizedException;
} catch (Base64DecodingException e) {
throw new SecurityException(... |
<vulnerable_code>import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;
import be.e_contract.dssp.ws.jaxb.dssp.DigitalSignatureServiceDescriptorType;
import be.e_contract.dssp.ws.jaxb.metadata.EntityDescriptorType;
*/
public class DigitalSignatureServiceMetadata imple... |
<vulnerable_code> // Helpers.
$('.delete-button').click(showDeletePopup);
$('.add-all-button').click(showAddAllPopup);
$('.delete-branch-button').click(showDeletePopup);
return false;
}
function initVueComponents() {
const vueDelimeters = ['${', '}'];
<commit_title>[PATCH 1/7] Update JS dependencies (#104... |
<vulnerable_code> except Exception:
return False
return True<commit_title>[PATCH] validators: add uuid and agent_id validators<commit_description>Add valid_uuid and valid_agent_id validators, and tests for both.
Signed-off-by: Alberto Planas <aplanas@suse.com><fixed_code>
except Exception:
r... |
<vulnerable_code> self.assertFalse(validators.valid_hex("123xyz"))
if __name__ == "__main__":
unittest.main()<commit_title>[PATCH] validators: add uuid and agent_id validators<commit_description>Add valid_uuid and valid_agent_id validators, and tests for both.
Signed-off-by: Alberto Planas <aplanas@suse.c... |
<vulnerable_code> })
it('Can create a board', function() {
const board = 'Test'
cy.intercept({
method: 'POST',<commit_title>[PATCH] feat: add validators to check values in services<commit_description>Signed-off-by: Luka Trovic <luka@nextcloud.com><fixed_code>
})
it('Can create a board', function() {
cons... |
<vulnerable_code> const storedBoard = await apiClient.updateBoard(board)
commit('addBoard', storedBoard)
},
createBoard({ commit }, boardData) {
apiClient.createBoard(boardData)
.then((board) => {
commit('addBoard', board)
})
},
async cloneBoard({ commit }, boardData) {
try {<commit_titl... |
<vulnerable_code>
export const AuthButton = () => {
const [App, setApp] = useContext(AppContext);
const { isAuthenticated } = App;
const logout = () => {
sessionStorage.setItem('accessToken', '');
document.cookie = "tokenId='';"
setApp("accessToken",'');
setApp("tokenId",'');
setApp("isAuthen... |
<vulnerable_code>export const InteractiveGraph = ({ symbol, symbolName }) => {
const [history, setHistory] = useState([]);
const [App, setApp] = useContext(AppContext);
const { isAuthenticated, messages, accessToken } = App;
const lsDataPoints = JSON.parse(localStorage.getItem("dataPoints")) || {
EOD: true,... |
<vulnerable_code>
import React from 'react';
import { useEffect, useState, useContext } from 'react';
import { AppContext } from "../../context/AppContext";
import Select from 'react-select'; // https://react-select.com/home
import apiEndpoints from '../../endpoints.json';
export const SymbolChooser = ({ symbolChangeH... |
<vulnerable_code> name = '(max-width: ' + name.replace("w", "") + 'px)';
}
if (this.medias[name]) {
return;
}<commit_title>[PATCH] [Thumbnail] Validate media query name<commit_description><fixed_code>
name = '(max-width: ' + name.replace("w", "") + 'px)';
... |
<vulnerable_code>public class XWikiServletResponse implements XWikiResponse
{
private static final Logger LOGGER = LoggerFactory.getLogger(XWikiServletResponse.class);
private static final Pattern ABSOLUTE_URL_PATTERN = Pattern.compile("[a-z0-9]+://.*");
private HttpServletResponse response;
r... |
<vulnerable_code><commit_title>[PATCH] XWIKI-19994: False positive redirect checking<commit_description><fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms ... |
<vulnerable_code>
xfrm_probe_algs();
supp_skb = compose_sadb_supported(hdr, GFP_KERNEL);
if (!supp_skb) {
if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC)
pfk->registered &= ~(1<<hdr->sadb_msg_satype);<commit_title>[PATCH] af_key: add __GFP_ZERO flag for compose_sadb_supported in<commit_description><fixed_code>... |
<vulnerable_code> switch( macHdr.Bits.MType )
{
case FRAME_TYPE_JOIN_ACCEPT:
macMsgJoinAccept.Buffer = payload;
macMsgJoinAccept.BufSize = size;
getPhy.Datarate = MacCtx.McpsIndication.RxDatarate;
getPhy.Attribute = PHY_MAX_PAYLOAD;
phyParam = ... |
<vulnerable_code> return SECURE_ELEMENT_ERROR_NPE;
}
// Determine decryption key
KeyIdentifier_t encKeyID = NWK_KEY;
<commit_title>[PATCH] Added received buffer size checks.<commit_description><fixed_code>
return SECURE_ELEMENT_ERROR_NPE;
}
// Check that frame size isn't bigger than... |
<vulnerable_code> with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "libabrt.h"
/* Maximal length of backtrace. */
error_msg("Bad problem directory name '%s', should start with: '%s'", dirname, g_settings_dump_loca... |
<vulnerable_code> }
}
/* Open a fd to compat coredump, if requested and is possible */
if (setting_MakeCompatCore && ulimit_c != 0)
/* note: checks "user_pwd == NULL" inside; updates core_basename */
goto create_user_core;
}
/* use fsuid instead of uid, so we don't expose an... |
<vulnerable_code>bool g_settings_autoreporting = 0;
char * g_settings_autoreporting_event = NULL;
bool g_settings_shortenedreporting = 0;
void free_abrt_conf_data()
{
else
g_settings_shortenedreporting = 0;
GHashTableIter iter;
const char *name;
/*char *value; - alread... |
<vulnerable_code>{
load_abrt_conf();
struct dump_dir *dd = create_dump_dir_from_problem_data(pd, g_settings_dump_location);
char *problem_id = NULL;
if (dd)<commit_title>[PATCH] make the dump directories owned by root by default<commit_description>It was discovered that the abrt event scripts create a... |
<vulnerable_code> mode = DEFAULT_DUMP_DIR_MODE;
my_euid = geteuid();
}
pid_t my_pid = getpid();
unsigned idx = 0;<commit_title>[PATCH] make the dump directories owned by root by default<commit_description>It was discovered that the abrt event scripts create a user-readable
copy of a sosrepor... |
<vulnerable_code> mode = DEFAULT_DUMP_DIR_MODE;
my_euid = geteuid();
}
pid_t my_pid = getpid();
<commit_title>[PATCH] make the dump directories owned by root by default<commit_description>It was discovered that the abrt event scripts create a user-readable
copy of a sosreport file in abrt proble... |
<vulnerable_code> FILE *handle;
char str1[DLT_COMMON_BUFFER_LENGTH];
char apid[DLT_ID_SIZE], ctid[DLT_ID_SIZE];
PRINT_FUNCTION_VERBOSE(verbose);
return DLT_RETURN_ERROR;
}
/* Reset filters */
filter->counter = 0;
while (!feof(handle)) {
str1[0] = 0;
if (fscanf... |
<vulnerable_code> return 0;
}
#define SSH_DEFAULT_PORT "22"
static int _git_ssh_setup_conn(
if ((error = _git_ssh_session_create(&session, s->io)) < 0)
goto done;
if (t->owner->connect_opts.callbacks.certificate_check != NULL) {
git_cert_hostkey cert = {{ 0 }}, *cert_ptr;
const char *key;
size_t cert_len;
... |
<vulnerable_code> return 0;
}
static int _git_ssh_session_create(
LIBSSH2_SESSION **session,
git_stream *io)
{
int rc = 0;
LIBSSH2_SESSION *s;
git_socket_stream *socket = GIT_CONTAINER_OF(io, git_socket_stream, parent);
GIT_ASSERT_ARG(session);
s = libssh2_session_init();
if (!s) {
return -1;
}
do {
r... |
<vulnerable_code>#include <fastrtps/utils/IPFinder.h>
#include <fastrtps/log/Log.h>
#include <fstream>
#include <mutex>
#include <set>
using namespace eprosima::fastrtps;
using namespace eprosima::fastrtps::rtps;
const std::set<eprosima::fastdds::rtps::TransportReceiverInterface*>& receivers,
const ch... |
<vulnerable_code>
#define TAG FREERDP_TAG("core.orders")
const BYTE PRIMARY_DRAWING_ORDER_FIELD_BYTES[] = { DSTBLT_ORDER_FIELD_BYTES,
PATBLT_ORDER_FIELD_BYTES,
SCRBLT_ORDER_FIELD_BYTES,
... |
<vulnerable_code> orderInfo->controlFlags = ORDER_STANDARD;
orderInfo->controlFlags |= ORDER_TYPE_CHANGE;
length += 1;
length += PRIMARY_DRAWING_ORDER_FIELD_BYTES[orderInfo->orderType];
length += update_prepare_bounds(context, orderInfo);
return length;
}
Stream_Write_UINT8(s, orderInfo->orderType); /* orderType... |
<vulnerable_code> uint32_t option_length = 0;
uint32_t *x;
/* Initialize packet */
memset(coap_pkt, 0, sizeof(coap_packet_t));
<commit_title>[PATCH] [Bugzilla-577968] coap: Check data length before parsing CoAP<commit_description><fixed_code>
uint32_t option_length = 0;
uint32_t *x;
if (data_len < COAP_H... |
<vulnerable_code> throw new TypeError('option secretLength must be finite number > 1')
}
this.saltLength = saltLength
this.secretLength = secretLength
}
if (!secret || typeof secret !== 'string') {
throw new TypeError('argument secret is required')
}
return this._tokenize(secret, rndm(this.saltLeng... |
<vulnerable_code> assert(!this.tokens.verify(this.secret, 'hi'))
})
})
})<commit_title>[PATCH] Implemented basic validity checks<commit_description><fixed_code>
assert(!this.tokens.verify(this.secret, 'hi'))
})
})
describe('.create() and verify() with validity', function () {
before(functi... |
<vulnerable_code> {
void* ptr = __iotc_calloc( /*num=*/1, /*size=*/8);
tt_want_ptr_op(NULL, !=, ptr);
printf("DDB sizeofptr: %lu\n", sizeof(*ptr));
__iotc_free(ptr);
})
{
void* ptr = __iotc_calloc( /*num=*/255, /*size=*/55);
tt_want_ptr_op(NULL, !=, ptr);
printf("D... |
<vulnerable_code> expect(one.res.headers.get('Content-Disposition')).toBe(
`inline; filename="test.webp"`
)
let json1
await check(async () => {
json1 = await fsToJson(imagesDir)
return Object.keys(json1).length === 1 ? 'success' : 'fail'
}, 'success')
const two = await fetchWit... |
<vulnerable_code> }
}
}
}
if (LOG.isDebugEnabled())
LOG.debug("auth {}", authentication);
return authentication;
}
// If we can't send challenge.<commit_tit... |
<vulnerable_code>
import java.io.Serializable;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
throw new AuthenticationException("Authorized party claim value should be the client_id");
// Check that the ID token has not expired by checking the exp claim.
... |
<vulnerable_code>
package org.eclipse.jetty.security.openid;
import java.io.IOException;
import java.security.Principal;
import java.util.Map;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.client.HttpClient;... |
<vulnerable_code>package org.eclipse.jetty.security.openid;
import java.io.IOException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
im... |
<vulnerable_code>void check_overflow(unsigned int val1, unsigned int val2,
unsigned int val3)
{
if ((unsigned long long) val1 * (unsigned long long) val2 *
(unsigned long long) val3 > UINT_MAX) {
#ifdef DEBUG
fprintf(stderr, "%s: Overflow detected (%llu). Aborting...\n",
__FUNCTION__, (unsigned long lo... |
<vulnerable_code> ])
context.ensure_initialized()
@def_function.function
def run_all_reduce():
group_key = 10<commit_title>[PATCH] Fix for check failure in CollectiveGather op.<commit_description>The fix is required only for Eager mode, graph mode already checked for input shape in shape inference... |
<vulnerable_code> (void) ConcatenateString(&metadata,buffer);
}
if (metadata != (char *) NULL)
SetImageProperty(image,"vips:metadata",metadata,exception);
(void) CloseBlob(image);
if (status == MagickFalse)
return((Image *) NULL);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issu... |
<vulnerable_code> i--;
continue;
default:
unquoted.append(c);
}
*/
return c > 127 || // 8-bit characters
Character.isISOControl(c) || // control characters
... |
<vulnerable_code> return -1;
}
static cjwt_alg_t __cjwt_alg_str_to_enum( const char *alg_str )
{
int alg = cjwt_alg_str_to_enum (alg_str);
if (alg >= 0)
return alg;
else
return alg_none;
}
inline static void cjwt_delete_child_json( cJSON* j, const char* s )
{
if( sz_signed != out_size ) {
cj... |
<vulnerable_code>#include "../src/cjwt.h"
typedef struct {
bool expected;
const char *jwt_file_name;
bool is_key_in_file;
const char *key;
} test_case_t;
test_case_t test_list[] = {
{true, "jwtn.txt", false, "", "No Alg claims on on"},
{true, "jwtnx.txt", false, "", "No Alg claims off on"},
... |
<vulnerable_code>from rest_framework import permissions, status, viewsets
from rest_framework.permissions import AllowAny, IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
logger.exception(str(e))
return Response({"message": str(e)})
class Firs... |
<vulnerable_code> url(r"^", include(router.urls)),
url(r"^admin/", admin.site.urls),
url(r"^api/sitesettings", views.SiteSettingsView.as_view()),
url(r"^api/dirtree", user.RootPathTreeView.as_view()),
url(r"^api/labelfaces", faces.SetFacePersonLabel.as_view()),
url(r"^api/deletefaces", faces.Dele... |
<vulnerable_code>
TEST(pb_field_iter_next(&iter) && iter.tag == 60 && iter.pData == &msg.oneof.oneof_msg1 && iter.pSize == &msg.which_oneof )
TEST(pb_field_iter_next(&iter) && iter.tag == 61 && iter.pData == &msg.oneof.oneof_msg2 && iter.pSize == &msg.which_oneof )
TEST(iter.required_field... |
<vulnerable_code> * @deprecated Use SPECIAL_CHARS_IN_QUOTES
*/
@Deprecated
COMMA_NOT_VALID_OCTET("https://tools.ietf.org/html/rfc6265#section-4.1.1", "Comma not valid as cookie-octet or separator"),
/**
* A comma was found as separator between cookies.
* @depr... |
<vulnerable_code> reject = true;
}
unquoted.append(c);
continue;
}
}
else
if (tokenstart < 0)
... |
<vulnerable_code> }
}
class TestCutter implements CookieParser.Handler
{
CookieCutter cutter;
List<String> names = new ArrayList<>();<commit_title>[PATCH] Improved javadocs and other minor code cleanups.<commit_description>Signed-off-by: Simone Bordet <simone.bordet@gmail.com><fixed_... |
<vulnerable_code>/*
* Copyright (C)2009-2018 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
int align, int *height, int *pixelFormat,
... |
<vulnerable_code> spin_lock_bh(&net->nsid_lock);
peer = idr_find(&net->netns_ids, id);
if (peer)
get_net(peer);
spin_unlock_bh(&net->nsid_lock);
rcu_read_unlock();
<commit_title>[PATCH] net: Fix double free and memory corruption in<commit_description><fixed_code>
spin_lock_bh(&net->nsid_lock);
peer = idr_find(&... |
<vulnerable_code> len = STRLEN(y_array[y_size - 1]);
col = (colnr_T)len - lendiff;
if (col > 1)
curbuf->b_op_end.col = col - 1
- mb_head_off(y_array[y_size - 1],
y_array[y_size - 1] + len - 1);
else
curbuf->b_op_end.col = 0;
<commit_title>[PATCH] patch 8.2.5016: access before start of t... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5015,
/**/<commit_title>[PATCH] patch 8.2.5016: access before start of text with a put<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5016,
... |
<vulnerable_code> null,
null,
row);
cell.appendChild(document.createTextNode(contact["c_cn"]));
cell.title = contact["c_cn"];
... |
<vulnerable_code>}
static struct cifsSesInfo *
cifs_find_smb_ses(struct TCP_Server_Info *server, char *username)
{
struct list_head *tmp;
struct cifsSesInfo *ses;
write_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &server->smb_ses_list) {
ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
if (strncmp(se... |
<vulnerable_code> return self.request.META
def cookies(self):
# type: () -> Dict[str, str]
privacy_cookies = [
django_settings.CSRF_COOKIE_NAME,
django_settings.SESSION_COOKIE_NAME,
]
clean_cookies = {}
for (key, val) in self.request.COOKIES.i... |
<vulnerable_code>
#define read_uint8(p) TEMPLATE_READ_VALUE(uint8, p)
#define read_uint32(p) TEMPLATE_READ_VALUE(uint32, p)
#define read_bool(p) TEMPLATE_READ_VALUE(bool, p)
#define read_leb_int64(p, p_end, res) \
do { ... |
<vulnerable_code>handler500 = 'app.views.custom_error'
api_schema_view = get_swagger_view(title='PatrOwl Manager REST-API')
urlpatterns = [
url(r'^apis-doc', api_schema_view),<commit_title>[PATCH] Fix Unrestricted Upload of File with Dangerous Type (from<commit_description><fixed_code>
handler500 = 'app.views.cu... |
<vulnerable_code># -*- coding: utf-8 -*-
from django import forms
from .models import Finding, FINDING_SEVERITIES
)
class ImportFindingsForm(forms.Form):
class Meta:
fields = ['engine', 'min_level', 'file']
attrs={'class': 'form-control form-control-sm'},
choices=FINDING_SEVERITIES),
... |
<vulnerable_code>
import os
import sys
import pickle
import socket
import tempfile
# Do NOT use a hardcoded name here due to the danger from race conditions
# on NFS when multiple processes are accessing the same base directory in
# parallel. We use both hostname and pocess id for the prefix in an
# a... |
<vulnerable_code>
import sys
import os
from numpy.testing import TestCase, assert_
from scipy.weave import catalog
from weave_test_utils import clear_temp_catalog, restore_temp_catalog, \
empty_temp_dir, cleanup_temp_dir
class TestDefaultDir(TestCase):
def test_is_writable(self):
path = catalog.... |
<vulnerable_code>
/*
* ScriptFileProviderLoader.java
*
* User: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
* Created: 4/13/11 10:07 AM
*
*/
package com.dtolabs.rundeck.core.plugins;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
import jav... |
<vulnerable_code> chunked = 1;
}
}
while(header_buf[i]=='\r' || header_buf[i] == '\n')
i++;
linestart = i;
colon = linestart;<commit_title>[PATCH] miniwget.c: fixed potential buffer overrun<commit_description><fixed_code>
chunked = 1;
}
}
while((i < (int)head... |
<vulnerable_code>import jenkins.model.DirectlyModifiableTopLevelItemGroup;
import jenkins.model.Jenkins;
import jenkins.security.NotReallyRoleSensitiveCallable;
import org.acegisecurity.Authentication;
import jenkins.util.xml.XMLUtils;
import org.apache.tools.ant.taskdefs.Copy;
import org.xml.sax.SAXException;
import... |
<vulnerable_code> acl.checkPermission(Item.CREATE);
Jenkins.getInstance().getProjectNamingStrategy().checkName(name);
if (parent.getItem(name) != null) {
throw new IllegalArgumentException(parent.getDisplayName() + " already contains an item '" + name + "'");
}
// TOD... |
<vulnerable_code>import javax.annotation.Nonnull;
import jenkins.model.DirectlyModifiableTopLevelItemGroup;
import org.apache.commons.io.FileUtils;
/**
throw new IllegalArgumentException();
}
String name = item.getName();
if (destination.getItem(name) != null) {
throw n... |
<vulnerable_code>
package hudson.model;
import java.io.File;
import java.util.Arrays;
import org.junit.Test;
import static org.junit.Assert.*;
assertFalse(new File(tmp, "foo/test/1").exists());
assertTrue(new File(tmp, "bar/test/1").exists());
}
}<commit_title>[PATCH 2/2] Restoring relevant expla... |
<vulnerable_code> if (this.name.equals(newName))
return;
Items.verifyItemDoesNotAlreadyExist(parent, newName, this);
File oldRoot = this.getRootDir();<commit_title>[PATCH 2/2] Restoring relevant explanatory comment.<commit_description><fixed_code>
... |
<vulnerable_code> char tmp[16];
snprintf(tmp, sizeof(tmp), "%X\r\n", (unsigned int)res->buffer_pos);
if ((w = write(req, tmp, strlen(tmp))) <= 0) {
ONION_WARNING("Error writing chunk encoding length (%X) %s. Aborting write.",
(unsigned int)res->buffer_pos, strerror(errno));
return OCS_CLOS... |
<vulnerable_code> return M_TRUE;
}
static M_bool M_fs_check_overwrite_allowed(const char *p1, const char *p2, M_uint32 mode)
{
M_fs_info_t *info = NULL;
if (type != M_FS_TYPE_DIR) {
/* File exists at path. */
if (M_fs_perms_can_access(p2, M_FS_PERMS_MODE_NONE) == M_FS_ERROR_SUCCESS)
{
ret = M_FALSE;
go... |
<vulnerable_code> sys_type = M_fs_path_get_system_type(sys_type);
/* Remove any empty parts (except for the first part which denotes an abs path on Unix
* or a UNC path on Windows). */
parts = M_list_str_duplicate(path);
for (i=len-1; i>0; i--) {
part = M_list_str_at(parts, i);
}
/* Hidden. Check if the fir... |
<vulnerable_code> if (IS_UNION_ST (tree))
{
tree = sqlp_view_def (NULL, tree, 1);
tree = sqlc_union_dt_wrap (tree);
*ptree = tree;
}
sqlc_top_select_wrap_dt (sc, tree);<commit_title>[PATCH] Fixed non-terminal in union branch is not supported (fixes<commit_description><fixed_code>
if (IS_U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.