text
stringlengths
79
3.72M
<vulnerable_code>import org.apache.dolphinscheduler.api.dto.resources.filter.ResourceFilter; import org.apache.dolphinscheduler.api.dto.resources.visitor.ResourceTreeVisitor; import org.apache.dolphinscheduler.api.dto.resources.visitor.Visitor; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolp...
<vulnerable_code> package org.apache.dolphinscheduler.api.service.impl; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.ExecutorService; import org.apache.dolphinscheduler.api.service.TaskGroupQueueService; import org.apache.dolphinscheduler.api.service.TaskGroupServ...
<vulnerable_code> package org.apache.dolphinscheduler.api.service.impl; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.UdfFuncService; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolph...
<vulnerable_code>import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.SessionService; import org.apache.dolphinscheduler.api.service.UsersService; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.dao.DaoConfiguration; import org.apach...
<vulnerable_code> public void testViewResource() throws Exception { Result mockResult = new Result<>(); mockResult.setCode(Status.HDFS_NOT_STARTUP.getCode()); PowerMockito.when(resourcesService.readResource(Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(mockResult); ...
<vulnerable_code> package org.apache.dolphinscheduler.api.service; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.impl.MonitorServiceImpl; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.model.Server; import org.apache....
<vulnerable_code> package org.apache.dolphinscheduler.api.service; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.impl.ProjectServiceImpl; import org.apache.dolphinscheduler.common.Constants; User loginUser = getLoginUser(); loginUser.setId(1); ...
<vulnerable_code> import static org.mockito.ArgumentMatchers.eq; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.impl.ResourcesServiceImpl; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.d...
<vulnerable_code> package org.apache.dolphinscheduler.api.service; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.impl.TaskGroupServiceImpl; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.common.Constants; import org.apache...
<vulnerable_code> package org.apache.dolphinscheduler.api.service; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.service.impl.UdfFuncServiceImpl; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.d...
<vulnerable_code> QUEUE(10,"queue"), DATA_ANALYSIS(11,"data analysis"), K8S_NAMESPACE(12,"k8s namespace"), MONITOR(13,"montitor"); AuthorizationType(int code, String descp) { this.code = code; this.descp = descp;<commit_title>[PATCH] Reconstruction of permissions of resource center an...
<vulnerable_code> * key */ @TableId(value = "id", type = IdType.AUTO) private int id; /** * task_group name */<commit_title>[PATCH] Reconstruction of permissions of resource center and<commit_description><fixed_code> * key */ @TableId(value = "id", type = IdType.AUTO) pr...
<vulnerable_code> * @return resource page */ IPage<Resource> queryResourcePaging(IPage<Resource> page, @Param("userId") int userId, @Param("id") int id, @Param("type") int type, ...
<vulnerable_code> * @return udf function IPage */ IPage<UdfFunc> queryUdfFuncPaging(IPage<UdfFunc> page, @Param("userId") int userId, @Param("searchVal") String searchVal); /** * @param type type * @return udf functi...
<vulnerable_code> IPage<Resource> resourceIPage = resourceMapper.queryResourcePaging( page, 0, -1, resource.getType().ordinal(), "", ); IPage<Resource> resourceIPage1 = resourceMapper.queryResourcePaging( ...
<vulnerable_code> import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; UdfFunc udfFunc = insertOne(user); //queryUdfFuncPaging Page<UdfFunc> page = new Page(1, 3); IPage<UdfFunc> udfFuncIPage = udfFuncMapper.queryUdfFuncPaging(page, user.get...
<vulnerable_code>import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.slf4j.Logger; import java.util.Set; public interface ResourcePermissionCheckService<T>{ * @param logger * @return */ boolean resourcePermissionCheck(AuthorizationType authorizationType, T[] needChecks, in...
<vulnerable_code> } @Override public boolean resourcePermissionCheck(AuthorizationType authorizationType, Object[] needChecks, int userId, Logger logger) { if (Objects.nonNull(needChecks) && needChecks.length > 0){ Set<Object> originResSet = new HashSet<>(Arrays.asList(needChecks)); ...
<vulnerable_code>/** A result is ready, process it */ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length) { int i = 0; int q = 0; int curanswer, o; ResourceRecord rr;<commit_title>[PATCH 3/4] dns: more hardening<commit_description>- don't trust rr.rdlength - don't accept replies we know are impossible ...
<vulnerable_code>#include "configreader.h" #include "socket.h" /** Masks to mask off the responses we get from the DNSRequest methods */ enum QueryInfo /* Allocate the processing buffer */ DNSRequest::DNSRequest(DNS* dns, int rid, const std::string &original) : dnsobj(dns) { res = new unsigned char[512]; *res = 0; ...
<vulnerable_code> res[o] = 0; break; case DNS_QUERY_AAAA: memcpy(res,&header.payload[i],rr.rdlength); res[rr.rdlength] = 0; break; case DNS_QUERY_A: memcpy(res,&header.payload[i],rr.rdlength); res[rr.rdlength] = 0; break; default: memcpy(res,&header.payload[i],rr.rdlength); res[rr.rdleng...
<vulnerable_code> DNSRequest(DNS* dns, int id, const std::string &original); ~DNSRequest(); DNSInfo ResultIsReady(DNSHeader &h, int length); int SendRequests(const DNSHeader *header, const int length, QueryType qt); }; } /** A result is ready, process it */ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int...
<vulnerable_code> g_ptr_array_add (bwrap->argv, g_strdup (arg)); } void flatpak_bwrap_finish (FlatpakBwrap *bwrap) { } } gboolean flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap, int start,<commit_title>[PATCH] run: Convert all environment variables into bwrap arguments<commit...
<vulnerable_code> flatpak_run_add_system_dbus_args (bwrap, proxy_arg_bwrap, context, flags); flatpak_run_add_a11y_dbus_args (bwrap, proxy_arg_bwrap, context, flags); if (g_environ_getenv (bwrap->envp, "LD_LIBRARY_PATH") != NULL) { /* LD_LIBRARY_PATH is overridden for setuid helper, so pass it as cmdline...
<vulnerable_code> /* Strip off padding zero */ if ((entry->flags & SC_ASN1_UNSIGNED) && obj[0] == 0x00 && objlen > 1) { objlen--; obj++; }<commit_title>[PATCH] Fixed out of bounds access in ASN.1 Octet string<commit_description>Credit to OSS-Fuzz<fixed_code> /* Strip off padding zero */ if (...
<vulnerable_code> "$", "<", ">", NULL }; <commit_title>[PATCH] Do not allow enters/returns in arguments (thanks to Fabio<commit_description><fixed_code> "$", "<", ">", "\n", "\r", NULL };
<vulnerable_code> for ( name in options ) { copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } <commit_title>[PATCH] Core: Prevent Object.prototype pollution for $.extend( true,<commit_description><fixed_code> for ( name in options ) { copy = options...
<vulnerable_code> assert.ok( !Array.isArray( result.object ), "result.object wasn't paved with an empty array" ); } ); QUnit.test( "jQuery.each(Object,Function)", function( assert ) { assert.expect( 23 ); <commit_title>[PATCH] Core: Prevent Object.prototype pollution for $.extend( true,<commit_description><fixed_code...
<vulnerable_code> #define MAX_UNCYPHERED_WORDS (3) static bool enforce_wordlist; static bool dry_run; static bool awaiting_character; storage_reset(); } awaiting_character = false; memzero(mnemonic, sizeof(mnemonic)); memzero(cipher, sizeof(cipher)); /* Set to recovery cipher mode and gen...
<vulnerable_code> class HeaderProperty(object): def __init__(self, name, reader=None, writer=str, default=''): self.name, self.default = name, default self.reader, self.writer = reader, writer self.__doc__ = 'Current value of the %r header.' % name.title() def __get__(self, obj, cls): ...
<vulnerable_code> self.assertEqual('None', response['x-test']) def test_prevent_control_characters_in_headers(self): apis = 'append', 'replace', '__setitem__', 'setdefault' masks = '{}test', 'test{}', 'te{}st' tests = '\n', '\r', '\n\r', '\0' for api, mask, test in product(ap...
<vulnerable_code> } if (Options.encryption_iv_mode == ENCRYPTION_IV_MODE_FPS) { if (AP4_StringLength(Options.encryption_key_hex) != 64) { fprintf(stderr, "ERROR: 'fps' IV mode requires a 32 byte key value (64 characters in hex)\n"); return 1; }<commit_title>[PATCH] fi...
<vulnerable_code> spin_lock_irq (&dev->lock); value = -EINVAL; if (dev->buf) { kfree(kbuf); goto fail; } dev->buf = kbuf; <commit_title>[PATCH] usb: gadget: don't release an existing dev->buf<commit_description>dev->buf does not need to be released if it already exists before executing dev_config. Acked-by: Al...
<vulnerable_code><commit_title>[PATCH] XWIKI-20276: Improve escaping in the timezone displayer<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 ...
<vulnerable_code><commit_title>[PATCH] XWIKI-20276: Improve escaping in the timezone displayer<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 ...
<vulnerable_code> count = avio_rl32(pb); // markers count avio_rl16(pb); // reserved 2 bytes name_len = avio_rl16(pb); // name length for (i = 0; i < name_len; i++) avio_r8(pb); // skip the name for (i = 0; i < count; i++) { int64_t pres_time; int name_len; ...
<vulnerable_code> bit_chain_init_dat (&dat2, 12, dat); \ hdl_dat = &dat2; \ ENCODE_COMMON_HANDLES \ obj_flush_hdlstream (obj, dat, hdl_dat); /* common */ ...
<vulnerable_code> return -EIO; } // Set the file mode as of actual ipmi-pass file. if (fchmod(fileno((temp)()), st.st_mode) < 0) { log<level::DEBUG>("Error setting fchmod for temp file"); return -EIO;<commit_title>[PATCH] Use more restrictive permissions on /etc/ipmi-pass<commit_...
<vulnerable_code>void StelScriptOutput::saveOutputAs(const QString &name) { QFile asFile; QFileInfo outputInfo(outputFile); QDir dir=outputInfo.dir(); // will hold complete dirname QFileInfo newFileNameInfo(name); bool okToSaveToAbsolutePath=StelApp::getInstance().getSettings()->value("scripts/flag_script_allow_w...
<vulnerable_code>"""Chain that interprets a prompt and executes python code to do math.""" from typing import Dict, List from pydantic import BaseModel, Extra from langchain.chains.llm_math.prompt import PROMPT from langchain.llms.base import BaseLLM from langchain.prompts.base import BasePromptTemplate from langchain...
<vulnerable_code> You can do basic math, and your memorization abilities are impressive, but you can't do any complex calculations that a human could not do in their head. You also have an annoying tendency to just make up highly specific, but wrong, answers. So we hooked you up to a Python 3 kernel, and now you can e...
<vulnerable_code>import java.nio.file.Files; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.List; /** * Utility class. * @throws IOException if a file could not be created. */ public static File createTempFile() throws IOExcepti...
<vulnerable_code> interface = gr.Interface(lambda x: x, "text", "text") interface.root_urls = { "https://gradio-tests-test-loading-examples-private.hf.space", "https://google.com" } app.configure_app(interface) r = app.build_proxy_request(<commit_title>[PAT...
<vulnerable_code> return new Promise((resolve) => { process.nextTick(() => { let urlSanitized = util.sanitizeShellString(url).toLowerCase(); urlSanitized = urlSanitized.replace(/ /g, ''); urlSanitized = urlSanitized.replace(/\$/g, ''); urlSanitized = urlSanitized.replace(/\(/g, ''); ...
<vulnerable_code> return new Promise((resolve) => { process.nextTick(() => { const ifaceSanitized = util.sanitizeShellString(iface); let result = { iface: ifaceSanitized,<commit_title>[PATCH] security update (prototype pollution prevention)<commit_description><fixed_code> return new Promise...
<vulnerable_code> if (srvString === '') { srvString = '*'; } let srvs = srvString.split('|'); let result = []; let dataSrv = []; return new Promise((resolve) => { process.nextTick(() => { const procSanitized = util.sanitizeShellString(proc); let resul...
<vulnerable_code>} function sanitizeShellString(str) { let result = str || ''; result = result.replace(/>/g, ''); result = result.replace(/</g, ''); result = result.replace(/\*/g, ''); result = result.replace(/\?/g, ''); result = result.replace(/\[/g, ''); result = result.replace(/\]/g, ''); result = r...
<vulnerable_code> history: true, center: true, transition: 'none', dependencies: deps } // options from yaml meta const meta = JSON.parse($('#meta').text()) var options = meta.slideOptions || {} const view = $('.reveal') // text language if (meta.lang && typeof meta.lang === 'string') { view.attr('lang', me...
<vulnerable_code>_logger = logging.getLogger(pathlib.Path(__file__).name) def configure() -> None: """ This function is part of setting up _demo_uuid() to generate non-random UUIDs. See _demo_uuid() documentation for further setup notes. # environment. venv_original_path = pathlib.Path(env_ve...
<vulnerable_code> #include "basicio.hpp" #include "error.hpp" #include "futils.hpp" #include "image.hpp" #include "image_int.hpp" break; } } profileName_ = std::string(reinterpret_cast<char*>(chunkData.pData_), iccOffset - 1); ...
<vulnerable_code> if (p == q) break; swap=CloneImage(p,0,0,MagickTrue,exception); ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,exception)); ReplaceImageInList(&q,swap); *images=GetFirstImageInList(q);<commit_title>[PATCH] https://github.com/I...
<vulnerable_code> max_num_matches = MAXCOL; // If less than max_num_matches // found: all matches found. // If there already were some matches for the same name, move them // to the start. Avoids that the order changes when using // ":tnext" and jumping to another file.<commit_title>[PATCH] pat...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 388, /**/<commit_title>[PATCH] patch 9.0.0389: crash when 'tagfunc' closes the window<commit_description>Problem: Crash when 'tagfunc' closes the window. Solution: Bail out when the window was closed.<fixed_co...
<vulnerable_code> LOG_TEST_RET(ctx, SC_ERROR_UNKNOWN_DATA_RECEIVED, "Failed to add public key: no 'Label'"); } len = *(info_blob + offs + 1) + *(info_blob + offs) * 0x100; if (len) { if (len > sizeof(key_obj.label) - 1) len = sizeof(key_obj.label) - 1; memcpy(key_obj.label, info_blob + offs + 2, len);<comm...
<vulnerable_code>package com.fasterxml.jackson.datatype.jsr310; import java.math.BigDecimal; /** * Utilities to aid in the translation of decimal types to/from multiple parts. .append(seconds) .append('.'); // 14-Mar-2016, tatu: Although we do not yet (with 2.7) trim trailing zeroes, ...
<vulnerable_code> { case JsonTokenId.ID_NUMBER_FLOAT: BigDecimal value = parser.getDecimalValue(); long seconds = value.longValue(); int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); return Duration.ofSeconds(secon...
<vulnerable_code> protected final Function<FromDecimalArguments, T> fromNanoseconds; protected final Function<TemporalAccessor, T> parsedToValue; protected final BiFunction<T, ZoneId, T> adjust; /** replaceZeroOffsetAsZ = base.replaceZeroOffsetAsZ; _adjustToContextTZOverride = adju...
<vulnerable_code> checkExtractNanos(19827342231L, 999999999, value); } }<commit_title>[PATCH] Avoid latency problems converting decimal to time.<commit_description>Fixes https://github.com/FasterXML/jackson-databind/issues/2141<fixed_code> checkExtractNanos(19827342231L, 999999999, value); } ...
<vulnerable_code> * Numbers with very large exponents can take a long time, but still result in zero. * https://github.com/FasterXML/jackson-databind/issues/2141 */ @Test public void testDeserializationAsFloatEdgeCase08() throws Exception { String input = "1e10000000"; assertEq...
<vulnerable_code> pt = buffer; do { ch = getc(ttf); if ( pt<buffer+44 || (ch&0xf)==0xf || (ch&0xf0)==0xf0 ) { pt = addnibble(pt,ch>>4); pt = addnibble(pt,ch&0xf); /* Multiple master fonts can have Type2 operators here, particularly */ /* blend operators. We're ignoring that */ while ( ftell...
<vulnerable_code> in custom scripts are lowercased before they are sent. """, ) async def running(self): self.master = ctx.master<commit_title>[PATCH] security: reject whitespace in HTTP/1 header names<commit_description>This commit fixes GHSA-gcx2-gvj7-pxv3 by making mitmpro...
<vulnerable_code> read_response_head, connection_close, expected_http_body_size, ) from .assemble import ( assemble_request, assemble_request_head, "read_response_head", "connection_close", "expected_http_body_size", "assemble_request", "assemble_request_head", "assemble_response", "a...
<vulnerable_code> ) def expected_http_body_size( request: Request, response: Optional[Response] = None # a message downstream. # if "transfer-encoding" in headers: if "content-length" in headers: raise ValueError("Received both a Transfer-Encoding and a Conten...
<vulnerable_code> request_head = [bytes(x) for x in request_head] # TODO: Make url.parse compatible with bytearrays try: self.request = http1.read_request_head(request_head) expected_body_size = http1.expected_http_body_size(self.request) ...
<vulnerable_code> h2_conf_defaults = dict( header_encoding=False, validate_outbound_headers=False, validate_inbound_headers=True, normalize_inbound_headers=False, # changing this to True is required to pass h2spec normalize_outbound_headers=False, ) if self.debug:...
<vulnerable_code>from mitmproxy.net.http.http1.read import ( read_request_head, read_response_head, connection_close, expected_http_body_size, _read_request_line, _read_response_line, _read_headers, get_header_tokens ) from mitmproxy.test.tutils import treq, tresp assert r.content is None def test_ex...
<vulnerable_code> assert b"Received both a Transfer-Encoding and a Content-Length header" in err() def test_request_smuggling_te_te(tctx): """Test that we reject transfer-encoding headers that are weird in some way""" err = Placeholder(bytes)<commit_title>[PATCH] security: reject whitespace in HTTP/1 heade...
<vulnerable_code> assert "peer closed connection" in flow().error.msg @pytest.mark.xfail(reason="inbound validation turned on to protect against request smuggling") @pytest.mark.parametrize("normalize", [True, False]) def test_no_normalization(tctx, normalize): """Test that we don't normalize headers when ...
<vulnerable_code> char *line; int i; X509_NAME *subj; char common_name[FIELD_SIZE + 1]; SSL_set_verify(tunnel->ssl_handle, SSL_VERIFY_PEER, NULL); #ifdef HAVE_X509_CHECK_HOST // Use OpenSSL native host validation if v >= 1.0.2. // correctly check return value of X509_check_host if (X509_check_host(cert, commo...
<vulnerable_code> return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); }, /** * Sets the current directory name and updates the breadcrumb. * @param targetDir directory to display */ _setCurrentDir: function(targetDir, changeUrl) { targetDir = targetDir.repl...
<vulnerable_code> fileList.changeDirectory('/another\\subdir'); expect(fileList.getCurrentDirectory()).toEqual('/another/subdir'); }); it('switches to root dir when current directory does not exist', function() { fileList.changeDirectory('/unexist'); deferredList.reject(404);<commit_title>[PATCH] Ignore ...
<vulnerable_code> download_set = {} for pkg in download_list: remote = pkg.returnSimple('relativepath') rpmname = os.path.basename(remote) download_set[rpmname] = 1 for pkg in current_pkgs: remote_size = 0 if not opts.u...
<vulnerable_code> typedef struct { TIFF* tif; #ifndef LIBJPEG_ENCAP_EXTERNAL JMP_BUF exit_jmpbuf; #endif } sp->write_curstrile++; } return(1); } static int OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) { OJPEGState* sp=(OJPEGState*)tif->tif_data; (void)s; if (sp->libjpeg_jpeg_query_style==0) ...
<vulnerable_code> return mockMvcForEndpoint.perform(requestBuilder).andReturn().getResponse().getContentAsString(); } }<commit_title>[PATCH] code formatting<commit_description><fixed_code> return mockMvcForEndpoint.perform(requestBuilder).andReturn().getResponse().getContentAsString(); } }
<vulnerable_code> fclose(logFile); logFile = NULL; } if (fileName == NULL || fileName[0] == 0) return; if (initialLogFileName[0] == 0) strcpy(initialLogFileName, fileName); logFile = fopen(fileName, "a"); if (logFile == NULL && initialLogFileName[0] != 0)<commit_title>[PATCH] Check filename before coping to ini...
<vulnerable_code> GF_IsomInitialObjectDescriptor *iod; GF_IsomObjectDescriptor *od; GF_Err e; e = gf_isom_insert_moov(movie); if (e) return e; if (!movie->moov->iods) { } } movie->last_created_track_id = tkhd->trackID; if (!movie->keep_utc && !gf_sys_is_test_mode() ) { tkhd->modificationTime = now; m...
<vulnerable_code>var SqlTypes = require('./data_types').SqlTypes; var bigInt = require('big-integer'); var { XMLParser, XMLValidator } = require("fast-xml-parser"); var NULL_UPPERCASE = 'NULL'; { try { ret = JSON.parse(rawColumnValue); } catch (parseError) {<commit_title>[PATCH] Replace ev...
<vulnerable_code> for item in imports: try: logging.warning( 'Import named "%s" not found locally.' 'Trying to resolve it at the PyPI server.', item ) 'Package "%s" does not exist or network problems', item) c...
<vulnerable_code> */ import { get, head, patch, del, post, put } from "@tuleap/tlp-fetch"; export default KanbanService; } function removeKanban() { var message = gettextCatalog.getString("Kanban {{ label }} successfuly deleted", { label: SharedPropertiesService.getKanban().label, ...
<vulnerable_code> P [in/out] The point to map modulus The modulus of the field the ECC curve is in mp The "b" value from montgomery_setup() return MP_OKAY on success */ int ecc_map(ecc_point* P, mp_int* modulus, mp_digit mp) { #ifndef WOLFSSL_SP_MATH #ifdef WOLFSSL_SMALL_STACK mp_int *x, *y, *...
<vulnerable_code> return FP_OKAY; } /* d = a * b (mod c) */ int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d) { return fp_invmod(a, b, c); } /* this is a shell function that calls either the normal or Montgomery * exptmod functions. Originally the call to the montgomery code was * embedded in the normal...
<vulnerable_code> } else { unsigned label_len = *p; /* Check that label length is valid */ if (pkt+label_len > max) return PJLIB_UTIL_EDNSINNAMEPTR; p += (label_len + 1); ++label_len; *name_len += label_len; if (p >= max) return PJLIB_UTIL_EDNSINSIZE; } } ++p; } el...
<vulnerable_code> static char **pool; struct SWF_ACTIONPUSHPARAM *regs[256]; static char *getName(struct SWF_ACTIONPUSHPARAM *act); sprintf(t,"%ld", act->p.Integer ); return t; case PUSH_CONSTANT: /* CONSTANT8 */ t=malloc(strlenext(pool[act->p.Constant8])+3); /* 2 "'"s and a NULL */ strcpy(t,"'"); strcatex...
<vulnerable_code> html = super(AdminURLFieldWidget, self).render(name, value, attrs) if value: value = force_text(self._format_value(value)) final_attrs = {'href': mark_safe(smart_urlquote(value))} html = format_html( '<p class="url">{0} <a {1}>{2}</a><...
<vulnerable_code> w = widgets.AdminURLFieldWidget() self.assertHTMLEqual( conditional_escape(w.render('test', 'http://example-äüö.com')), '<p class="url">Currently:<a href="http://xn--example--7za4pnc.com">http://example-äüö.com</a><br />Change:<input class="vURLField" name="test"...
<vulnerable_code><commit_title>[PATCH] XWIKI-20267: Improved escaping in importinline.vm<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 te...
<vulnerable_code> int n = atoi((char *)cp); // Catch negative values, overflow and ridiculous big values. if (n < 0 || n > 9999) { semsg(_(e_invalid_argument_str), cp); vim_free(*array); emsg(_(e_argument_must_be_positive)); return; } if (new_ts < 0 || new_ts > 9999) { semsg(_(e_invalid_arg...
<vulnerable_code> errmsg = e_argument_must_be_positive; curbuf->b_p_ts = 8; } if (p_tm < 0) { errmsg = e_argument_must_be_positive; if (p_vsts && p_vsts != empty_option) (void)tabstop_set(p_vsts, &buf->b_p_vsts_array); else buf->b_p_vsts_array = 0; buf->b_p_vsts_nopaste = p_vsts_nopaste...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4244, /**/<commit_title>[PATCH] patch 8.2.4245: ":retab 0" may cause illegal memory access<commit_description>Problem: ":retab 0" may cause illegal memory access. Solution: Limit the value of 'tabstop' to 1000...
<vulnerable_code>import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; * Returns the absolute path to the temp directory. */ public static File createTempDir(int port) throws IOException { ...
<vulnerable_code>const express = require("express"); const { ApolloServer, gql } = require("apollo-server-express"); const expressPlayground = require("../../dist/index").default; const typeDefs = gql` type Query { schema { query: Query } `; const resolvers = { Query: { hello: () => "world" } }; con...
<vulnerable_code># # We would appreciate acknowledgement if the software is used. __version__ = "0.11.0" from . import local_uuid # noqa: F401<commit_title>[PATCH 01/28] Backport<commit_description>References: https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3 Signed-off-by: Alex Nelson <alexande...
<vulnerable_code># # We would appreciate acknowledgement if the software is used. __version__ = "0.12.0" from . import local_uuid # noqa: F401<commit_title>[PATCH 01/28] Backport<commit_description>References: https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3 Signed-off-by: Alex Nelson <alexande...
<vulnerable_code># # We would appreciate acknowledgement if the software is used. __version__ = "0.13.0" from . import local_uuid # noqa: F401<commit_title>[PATCH 01/28] Backport<commit_description>References: https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3 Signed-off-by: Alex Nelson <alexande...
<vulnerable_code># # We would appreciate acknowledgement if the software is used. __version__ = "0.14.0" from . import local_uuid # noqa: F401<commit_title>[PATCH 01/28] Backport<commit_description>References: https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3 Signed-off-by: Alex Nelson <alexande...
<vulnerable_code> V2i tileMin = V2i (minX + dx * tileDesc.xSize, minY + dy * tileDesc.ySize); Int64 tileMaxX = Int64(tileMin[0]) + tileDesc.xSize - 1; Int64 tileMaxY = Int64(tileMin[1]) + tileDesc.ySize - 1; V2i levelMax = dataWindowForLevel (tileDesc, minX, maxX, minY, maxY, lx, ly)....
<vulnerable_code> #define mxChunkFlag 0x80000000 //#define mxRoundSize(_SIZE) ((_SIZE + (sizeof(txChunk) - 1)) & ~(sizeof(txChunk) - 1)) #define mxRoundSize(_SIZE) ((_SIZE + (sizeof(txSize) - 1)) & ~(sizeof(txSize) - 1)) static void fxGrowChunks(txMachine* the, txSize theSize); static void fxGrowSlots(txMachine* the...
<vulnerable_code> max_packets=((image->columns+7UL) >> 3UL)*image->rows; else max_packets=(size_t) (number_pixels*viff_info.number_data_bands); pixels=(unsigned char *) AcquireQuantumMemory(max_packets, bytes_per_pixel*sizeof(*pixels)); if (pixels == (unsigned char *) NULL) ThrowReade...
<vulnerable_code> parser_line_counter_t start_line, /**< start line */ parser_line_counter_t start_column) /**< start column */ { context_p->source_p = context_p->token.lit_location.char_p; context_p->line = start_line; context_p->column = s...
<vulnerable_code>import os.path import random import string from celery.schedules import crontab def get_random_secret(length): secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4))) secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(l...