text
stringlengths
79
3.72M
<vulnerable_code> fetch(piranha.baseUrl + "manager/api/site/save", { method: "post", headers: { "Content-Type": "application/json", }, body: JSON.stringify(model) }) .then(function (response) { return...
<vulnerable_code>piranha.siteedit=new Vue({el:"#siteedit",data:{loading:!0,id:null,typeId:null,languageId:null,title:null,internalId:null,culture:null,description:null,logo:{id:null,media:null},hostnames:null,isDefault:!1,siteTypes:[],languages:[],regions:[],isNew:!1,isConfirm:!1,confirmTitle:null,selectedRegion:{uid:"...
<vulnerable_code> var defaultOptions = { paramName: 'Uploads', url: piranha.baseUrl + "manager/api/media/upload", thumbnailWidth: 70, thumbnailHeight: 70, previewsContainer: selector + " .media-list",<commit_title>[PATCH 1/2] Updated manager security. F...
<vulnerable_code> self.loading = true; fetch(piranha.baseUrl + "manager/api/language", { method: "post", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ ...
<vulnerable_code> if (self.folderName !== "") { fetch(piranha.baseUrl + "manager/api/media/folder/save" + (self.filter ? "?filter=" + self.filter : ""), { method: "post", headers: { "Content-Type": "application/json", ...
<vulnerable_code> items: [], }, methods: { push: function (notification) { notification.style = {<commit_title>[PATCH 1/2] Updated manager security. Fixes #1741<commit_description><fixed_code> items: [], }, methods: { unauthorized: function() { thi...
<vulnerable_code> }, strLength: function (str) { return str != null ? str.length : 0; } }; Date.prototype.addDays = function(days) {<commit_title>[PATCH 1/2] Updated manager security. Fixes #1741<commit_description><fixed_code> }, strLength: function (str) { return str != null ? str....
<vulnerable_code> console.log(JSON.stringify(self.userModel)); fetch(piranha.baseUrl + "manager/user/save", { method: "post", headers: { "Content-Type": "application/json" }, body: JSON.stringify(self.userModel) ...
<vulnerable_code> onConfirm: function () { fetch(piranha.baseUrl + "manager/user/delete", { method: "delete", headers: { "Content-Type": "application/json" }, bo...
<vulnerable_code> piranha.alias.items = result.items; } if (result.status != 400) { // Push status to notification hub piranha.notifications.push(result.status); } else { self.items = ...
<vulnerable_code>piranha.alias=new Vue({el:"#alias",data:{loading:!0,siteId:null,siteTitle:null,sites:[],items:[],model:{id:null,aliasUrl:null,redirectUrl:null,isPermanent:!0}},methods:{load:function(a){var i=this;a||(a=""),fetch(piranha.baseUrl+"manager/api/alias/list/"+a).then(function(a){return a.json()}).then(funct...
<vulnerable_code> }) .then(function (response) { return response.json(); }) .then(function (result) { if (result.status != 400) { // Push status to notification hub piranha.notifications.push(result.status...
<vulnerable_code>piranha.config=new Vue({el:"#config",data:{loading:!0,model:{hierarchicalPageSlugs:null,expandedSitemapLevels:null,managerPageSize:null,archivePageSize:null,commentsApprove:null,commentsCloseAfterDays:null,commentsEnabledForPages:null,commentsEnabledForPosts:null,commentsPageSize:null,pagesExpires:null...
<vulnerable_code> return str != null ? str.length : 0; }, antiForgery: function () { const cookies = document.cookie.split(';'); for (let i = 0; i < cookies.length; i++) { let c = cookies[i].trim().split('='); if (c[0] === piranha.antiForgery.cookieName) { ...
<vulnerable_code> piranha.media.refresh(); } if (result.status != 400) { // Push status to notification hub piranha.notifications.push(result.status); } else { self.refresh(); ...
<vulnerable_code>Vue.component("folder-item",{props:["item","selected"],template:'\n<li class="dd-item expanded" :class="{ active: item.id === selected, expanded: item.isExpanded || item.items.length === 0 }" :data-id="item.id">\n <a v-if="!item.edit" class="droppable" v-on:click.prevent="piranha.media.load(item.id)...
<vulnerable_code> self.callback = null; } } else { if (result.status != 400) { // Push status to notification hub piranha...
<vulnerable_code>piranha.siteedit=new Vue({el:"#siteedit",data:{loading:!0,id:null,typeId:null,languageId:null,title:null,internalId:null,culture:null,description:null,logo:{id:null,media:null},hostnames:null,isDefault:!1,siteTypes:[],languages:[],regions:[],isNew:!1,isConfirm:!1,confirmTitle:null,selectedRegion:{uid:"...
<vulnerable_code> self.bind(result); } if (result.status != 400) { // Push status to notification hub piranha.notifications.push(result.status); } else { ...
<vulnerable_code> self.items = result.media; } if (result.status != 400) { // Push status to notification hub piranha.notifications.push(result.status); } else {<commit_title>[PATCH 1/2] U...
<vulnerable_code> } return out.toArray(new PushActionCategory[out.size()]); } /** * Adds actions to a push notification. This is called by the Push broadcast receiver probably before * Codename One is initialized for (PushAction action : category.getActions()) { ...
<vulnerable_code> public void registerForPush(String key) { Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER"); registrationIntent.setPackage("com.google.android.gms"); registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // ...
<vulnerable_code> public abstract PushCallback getPushCallbackInstance(); public abstract Class getStubClass(); @Override public void push(final String value) { final PushCallback callback = getPushCallbackInstance(); } else { NotificationManager nm = (NotificationMa...
<vulnerable_code> if (bgListenerClass != null) { intent.setData(Uri.parse("http://codenameone.com/a?" + bgListenerClass.getName())); } PendingIntent pendingIntent = PendingIntent.getService(context, 0, ...
<vulnerable_code> import android.text.TextUtils; import com.codename1.ui.Display; } private void initMediaSession() { ComponentName mediaButtonReceiver = new ComponentName(getApplicationContext(), MediaButtonReceiver.class); mMediaSessionCompat = new MediaSessionCompat(getApplicationCont...
<vulnerable_code> continue; } if (i >= strlen(s) - 1) return NULL; h1 = s[i + 1], h2 = s[i + 2]; if (!IS_HEX(h1) || !IS_HEX(h2)) { *d = '\0'; return d; } /** Canonize a URL component (with precomputed mask). * * This version does not flag error if *s contains character that should<com...
<vulnerable_code> class Ticketer(commands.Cog): """Ticketer""" __version__="1.0.0" async def red_delete_data_for_user(self, *, requester, user_id): # This cog stores no EUD return def format_help_for_context(self, ctx: commands.Context) -> str: #Thanks Sinbad! And Trusty in who...
<vulnerable_code> slots=settings.num_proc)) # Generate rankfile path = tempfile.mktemp() if path is None else path with open(path, 'w') as tmp: tmp.write('overlapping_rs: allow\n') tmp.write('cpu_index_using: logical\n')<commit_title>[PATCH] Replaced use of tempfile.mktemp() with...
<vulnerable_code> test(("HYDRA build details:\n" " Version: 3.3a2\n" " Configure options: 'MPICHLIB_CFLAGS=-g -O2'\n"), _MPICH_IMPL) test("Intel(R) MPI", _IMPI_IMPL) test("Unknown MPI v1.00", _UNKNOWN_IMPL)<commit_title>[PATCH] Replaced use of...
<vulnerable_code> @contextlib.contextmanager def temppath(): path = tempfile.mktemp() try: yield path finally: if os.path.exists(path): if os.path.isfile(path): os.remove(path) else: shutil.rmtree(path) @contextlib.contextmanager<comm...
<vulnerable_code>from rdiffweb.core.rdw_helpers import unquote_url def empty(): @cherrypy.expose def handler(): return None return handler def poppath(*args, **kwargs): """ A decorator for _cp_dispatch @cherrypy.expose @cherrypy.tools.auth_form(on=False) @cherrypy.tools.sess...
<vulnerable_code> # Then the request is accepted with 200 OK self.assertStatus(200) self.assertHeaderItemValue('X-Frame-Options', 'DENY')<commit_title>[PATCH] Add more secure headers: Cache-control, Referrer-Policy,<commit_description><fixed_code> # Then the request is accepted with 200 O...
<vulnerable_code> http.cookies.Morsel._reserved['samesite'] = 'SameSite' def set_headers(): """ This tool provide CSRF mitigation. * Define Cookies SameSite=Lax * Define Cookies Secure when https is detected * Validate `Origin` and `Referer` on POST, PUT, PATCH, DELETE Ref.: https://c...
<vulnerable_code> } form.parse(req, function (err, fields, files) { if (err || !files.image || !files.image.path) { logger.error(`formidable error: ${err}`) errors.errorForbidden(res) } else { logger.debug(`SERVER received uploadimage: ${JSON.stringify(files.image)}`) <commit_title>[PATCH ...
<vulnerable_code> if (err) { logger.error(`formidable error: ${err}`) return errors.errorForbidden(res) } else if (!files.image || !files.image.path) { logger.error(`formidable error: Upload didn't contain file)`) return errors.errorBadRequest(res)<commit_title>[PATCH 1/5] Fix arbitary fi...
<vulnerable_code> const Router = require('express').Router const formidable = require('formidable') const config = require('../../config') const logger = require('../../logger') const imageRouter = module.exports = Router() // upload image imageRouter.post('/uploadimage', function (req, res) { var form = new formi...
<vulnerable_code>'use strict' const URL = require('url').URL const path = require('path') const config = require('../../config') const logger = require('../../logger') return } callback(null, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href) }<commit_title>[PATCH 1/5] Fix arbitary file...
<vulnerable_code>const formidable = require('formidable') const path = require('path') const FileType = require('file-type') const config = require('../../config') const logger = require('../../logger') // upload image imageRouter.post('/uploadimage', function (req, res) { var form = new formidable.IncomingForm() ...
<vulnerable_code> const markedDownOutput = marked(withHash); return markedDownOutput; } return marked(this.message, { breaks: true, gfm: true }); } get formattedMessage() {<commit_title>[PATCH] fix: Handle unsanitized markup in DOM (#4110)<commit_description><fixed_code> const markedDownOu...
<vulnerable_code> const message = 'Chatwoot is an opensource tool. [Chatwoot](https://www.chatwoot.com)'; expect(new MessageFormatter(message).formattedMessage).toMatch( '<p>Chatwoot is an opensource tool. <a rel="noreferrer noopener nofollow" href="https://www.chatwoot.com" class="link" titl...
<vulnerable_code>#include "exec/ram_addr.h" #include "qemu/range.h" #include "uc_priv.h" typedef struct PhysPageEntry PhysPageEntry; assert(size != 0); /* it would hand out same offset multiple times */ if (QLIST_EMPTY(&uc->ram_list.blocks)) { return 0; } new_block->host = phys_mem_all...
<vulnerable_code> MemoryRegion *ram = g_new(MemoryRegion, 1); memory_region_init_ram(uc, ram, size, perms); if (ram->addr == -1) { // out of memory return NULL; } memory_region_init_ram_ptr(uc, ram, size, ptr); ram->perms = perms; if (ram->addr == -1) { // out of me...
<vulnerable_code> OK(uc_close(uc)); } TEST_LIST = {{"test_map_correct", test_map_correct}, {"test_map_wrapping", test_map_wrapping}, {"test_mem_protect", test_mem_protect}, {"test_mem_protect_map_ptr", test_mem_protect_map_ptr}, {"test_map_at_the_end", test_map_at...
<vulnerable_code> AString ContentType = "text/html"; AString Path = Printf(FILE_IO_PREFIX "webadmin/files/%s", FileURL.c_str()); // Return 404 if the file is not found, or the URL contains '../' (for security reasons) if (FileURL.find("../") == AString::npos && cFile::IsFile(Path)) { cFile File(Path, cFile::f...
<vulnerable_code> status=GetMultilineTypeMetrics(image,draw_info,&metrics); if ((image->columns == 0) && (image->rows == 0)) { image->columns=(size_t) (metrics.width+draw_info->stroke_width+0.5); image->rows=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); } else return((Image ...
<vulnerable_code>#include "magick/string_.h" #include "magick/utility.h" /* Forward declarations. */ register const ExceptionInfo *p; assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); if (exception->exceptions == (void *) NULL) ResetLinkedListIterator((Lin...
<vulnerable_code> std::string bookmark_cmd = cfg.get_configvalue("bookmark-cmd"); bool is_interactive = cfg.get_configvalue_as_bool("bookmark-interactive"); if (bookmark_cmd.length() > 0) { std::string cmdline = strprintf::fmt("%s '%s' %s %s %s", bookmark_cmd, ...
<vulnerable_code> 'log_explicit_levels', 'log_file', 'timeout', 'default_vcs', 'skip_requirements_regex', 'no_input', 'exists_action']: setattr(options, attr, getattr(initial_options, attr) or getattr(options, attr)) ...
<vulnerable_code> metavar='action', help="Default action when a path already exists: " "(s)witch, (i)gnore, (w)ipe, (b)ackup."), ]<commit_title>[PATCH] --cert-path and --no-ssl options<commit_description><fixed_code> metavar='action', help="Default action when a path alre...
<vulnerable_code>from pip.exceptions import InstallationError, CommandError from pip.backwardcompat import home_lib from pip.cmdoptions import make_option_group, index_group from pip.util import warn_if_no_ssl class InstallCommand(Command): mirrors=options.mirrors) def run(self, opti...
<vulnerable_code>from pip.exceptions import InstallationError from pip.util import (splitext, rmtree, format_size, display_path, backup_dir, ask_path_exists, unpack_file, create_download_cache_folder, cache_download) from pip.vcs import vcs from pip.log import logger from pip...
<vulnerable_code>from pip.backwardcompat import get_python_lib import pip.exceptions cert_path = os.path.join(os.path.dirname(__file__), 'cacert.pem') def running_under_virtualenv(): """<commit_title>[PATCH] --cert-path and --no-ssl options<commit_description><fixed_code> from pip.backwardcompat import get_python...
<vulnerable_code>import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand from pip.backwardcompat import(WindowsError, string_types, raw_input, console_to_str, user_site, ssl) from pip.locations import site_packages, running_under_virtuale...
<vulnerable_code>function processRows(rows) { $j.each(rows, function(ndx, row) { try { row.Message = decodeURIComponent(row.Message); } catch(e) { // ignore errors } });<commit_title>[PATCH] Escape <> in log messages to prevent html shenanigans. Fixes<commit_description><fixed_code> function...
<vulnerable_code> fieldLabel: t("bundle_ecommerce_pricing_config_action_cart_discount_amount"), name: "amount", width: 200, value: data.amount }, { xtype: "numberfield", fieldLabel: t("...
<vulnerable_code> static int Buffer_EscapeStringUnvalidated (JSONObjectEncoder *enc, const char *io, const char *end) { char *of = (char *) enc->offset; for (;;) if (count > 0) { // Reserve space for the indentation plus the newline and the closing // bracket. Buffer_Reserve (enc, enc...
<vulnerable_code> <rect x="0.5" y="0.5" width="494" height="99%" rx="4.5" fill="#FFFEFE" stroke="#E4E2E2"/> <text x="25" y="45" class="text">Something went wrong! file an issue at https://git.io/JJmN9</text> <text data-testid="message" x="25" y="55" class="text small"> <tspan x="25" dy="18">${message}<...
<vulnerable_code> A request handler for `GET /mlflow-artifacts/artifacts/<artifact_path>` to download an artifact from `artifact_path` (a relative path from the root artifact directory). """ validate_path_is_safe(validate_path_is_safe) tmp_dir = tempfile.TemporaryDirectory() artifact_repo = _get_...
<vulnerable_code># code freely inspired from @twiggy ; see #711 def build_char_map( font_name: str, space_width: float, obj: DictionaryObject ) -> Tuple[str, float, Dict[int, str], Dict]: #font_type,space_width /2, encoding, cmap ft: DictionaryObject = obj["/Resources"]["/Font"][font_name] # type: ignore ...
<vulnerable_code> def _debug_for_extract(self) -> str: out = "" for ope, op in ContentStream( self["/Contents"].getObject(), self.pdf,"bytes" ).operations: if op == b"TJ": s = [x for x in ope[0] if isinstance(x, str)] if "/Font" in resources_dic...
<vulnerable_code> else: return False def __repr__(self) -> str: return "True" if self.value else "False" def write_to_stream( x += b_("0") if len(x) == 2: txt += chr(int(x, base=16)) return createStringObject(b_(txt),forced_encoding) def readStringFromStre...
<vulnerable_code> page = PageObject() page.add_transformation(Transformation()) def test_multi_language(): reader = PdfReader(os.path.join(RESOURCE_ROOT, "multilang.pdf")) txt = reader.pages[0].extract_text() assert "Hello World" in txt,"English not correctly extracted" #Arabic is for the moment...
<vulnerable_code> # 6 instead of 5: as there is an issue in page 5 (missing objects) # and too complex to handle the warning without hiding real regressions (True, "https://arxiv.org/pdf/1601.03642.pdf", [0, 1, 5, 7]), (True, "https://github.com/mstamy2/PyPDF2/files/3796761/17343_2008_Ord...
<vulnerable_code>bool DBusService::activate(const QString& jsonConfig) { logger.debug() << "Activate"; if (!checkCallerAuthz()) { logger.error() << "Insufficient caller permissions"; return false; } bool DBusService::deactivate(bool emitSignals) { logger.debug() << "Deactivate"; if (!checkCallerAuth...
<vulnerable_code>/* Edge cases - SIZE_MAX Note: FreeRTOS heap size isn't large enough for SIZE_MAX allocations, so these tests are disabled for those targets. */ #ifndef IOTC_PLATFORM_IS_FREERTOS IOTC_TT_TESTCASE( utest__iotc_memory_calloc__num_1__size_max, {<commit_title>[PATCH] use IOTC_TARGET_FREERTOS ...
<vulnerable_code> } }); // Adds functions for filters and styling to a defined input grid-cluster-Layer function addFunctionsToClusterLayer(layer) { layer.on("click", function(e) { this.clearHighlight(); let properties = e.layer.properties; [e.layer.properties.bb_north, e.layer.properties.bb_east] ...
<vulnerable_code> nal_unit_type = m_reader.getBits(6); nuh_layer_id = m_reader.getBits(6); nuh_temporal_id_plus1 = m_reader.getBits(3); if (nuh_temporal_id_plus1 == 0) return 1; return 0; }<commit_title>[PATCH] [Bug] Buffer overflow with non-hevc stream<commit_desc...
<vulnerable_code> invalid_strings = [ b'-----BEGIN PUBLIC KEY-----', b'-----BEGIN CERTIFICATE-----', b'ssh-rsa' ] <commit_title>[PATCH] Throw if key is an PKCS1 PEM-encoded public key<commit_description><fixed_code> invalid_strings = [ b'-----BEGIN ...
<vulnerable_code> with open(key_path('testkey2_rsa.pub.pem'), 'r') as keyfile: algo.prepare_key(keyfile.read()) def test_hmac_jwk_should_parse_and_verify(self): algo = HMACAlgorithm(HMACAlgorithm.SHA256) <commit_title>[PATCH] Throw if key is an PKCS1 PEM-encoded public key<commit...
<vulnerable_code>namespace { std::wstring CreateUniqueTempDirectory() { // We need to put downloaded updates into a directory of their own, because // // This code creates a new randomized directory name and tries to create it; // this process is repeated if the directory already exists. wchar_t tm...
<vulnerable_code>/* * SPDX-FileCopyrightText: 2016-2016 CSSlayer <wengxt@gmail.com> * * SPDX-License-Identifier: LGPL-2.1-or-later * } // namespace class CheckInputMethodChanged; struct InputState : public InputContextProperty { FCITX_DEFINE_SIGNAL_PRIVATE(Instance, CommitFilter); FCITX_DEFINE_SIGNAL_PRI...
<vulnerable_code> ngx_string("Content-Length"); static ngx_int_t ngx_http_lua_set_content_length_header(ngx_http_request_t *r, off_t len); static ngx_int_t ngx_http_lua_adjust_subrequest(ngx_http_request_t *sr, ngx_uint_t method, int forward_body, ngx_http_request_body_t *body, unsigned vars_action, st...
<vulnerable_code> e.preventDefault(); const self = this; $.ajax( { url: '?lp-ajax=save-uploaded-user-avatar', data: this.$( '.lp-avatar-crop-image' ).serializeJSON(), type: 'post', success( response ) { return; } this.$().removeAttr( 'data-custom' ); this.$( '.profile-picture' ).to...
<vulnerable_code>/* $OpenBSD: authfile.c,v 1.121 2016/04/09 12:39:30 djm Exp $ */ /* * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. * u_char buf[1024]; size_t len; struct stat st; int r; if (fstat(fd, &st) < 0) return SSH_ERR_SYSTEM_ERROR; if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 &...
<vulnerable_code> })); this.host.testWait(ctx2); // Assume Jane's identity this.host.assumeIdentity(this.userServicePath); // add docs accessible by jane // reset the auth context OperationContext.setAuthorizationContext(null); // Assume Jane's id...
<vulnerable_code> redirect('/') } else { $toast.clear() $toast.info('Token expired please login to continue', { position: 'bottom-center' }).goAway(5000) redirect('/user/authentication/signin')<commit_title>[PATCH 1/7] script: add nc_017_add_user_toke...
<vulnerable_code> assert c.foo(100) == 31337 @pytest.mark.parametrize("typ", ["int128", "uint256"]) def test_return_inside_nested_repeater(get_contract, typ): code = f"""<commit_title>[PATCH] Merge pull request from GHSA-6r8q-pfpv-7cgj<commit_description>for loops of the form `for i in range(x, x+N)`, the rang...
<vulnerable_code> IRnode, append_dyn_array, check_assign, dummy_node_for_type, get_dyn_array_count, get_element_ptr, arg1 = self.stmt.iter.args[1] rounds = self._get_range_const_value(arg1.right) start = Expr.parse_value_expr(arg0, self.context) r = ro...
<vulnerable_code> "Referrer-Policy": "no-referrer", "X-DNS-Prefetch-Control": "off", "X-Content-Type-Options": "nosniff", "Cross-Origin-Resource-Policy": "same-origin", }, "got back headers"); }) ...
<vulnerable_code>extern gboolean cockpit_webserver_want_certificate; /* JSON dict snippet for headers that are present in every request */ #define STATIC_HEADERS "\"Cross-Origin-Resource-Policy\":\"same-origin\",\"Referrer-Policy\":\"no-referrer\",\"X-Content-Type-Options\":\"nosniff\",\"X-DNS-Prefetch-Control\":\"off...
<vulnerable_code>#define CHECKSUM_CSP "80921dc3cde9ff9f2acd2a5851f9b2a3b25ea7b4577128461d9e32fbdd671e16" /* JSON dict snippet for headers that are present in every request */ #define STATIC_HEADERS "\"X-DNS-Prefetch-Control\":\"off\",\"Referrer-Policy\":\"no-referrer\",\"X-Content-Type-Options\":\"nosniff\"...
<vulnerable_code> HEADER_REFERRER_POLICY = 1 << 5, HEADER_CONTENT_TYPE_OPTIONS = 1 << 6, HEADER_CROSS_ORIGIN_RESOURCE_POLICY = 1 << 7, }; static GString * return HEADER_CONTENT_TYPE_OPTIONS; if (g_ascii_strcasecmp ("Cross-Origin-Resource-Policy", name) == 0) return HEADER_CROSS_ORIGIN_RESOURCE_POL...
<vulnerable_code>#include <string.h> /* headers that are present in every request */ #define STATIC_HEADERS "X-DNS-Prefetch-Control: off\r\nReferrer-Policy: no-referrer\r\nX-Content-Type-Options: nosniff\r\nCross-Origin-Resource-Policy: same-origin\r\n\r\n" static gchar *srcdir; typedef struct {<commit_title>[PATCH] ...
<vulnerable_code> return globalLocale; } function loadLocale(name) { var oldLocale = null, aliasedRequire; locales[name] === undefined && typeof module !== 'undefined' && module && module.exports ) { try { oldLocale = globalLocale._abbr;<commit_tit...
<vulnerable_code> "groovy", "bsh", "dcb"); private static final java.nio.file.Path USERS_XML; static { try { USERS_XML = ConfigFileConstants.getFile(ConfigFileConstants.USERS_CONF_FILE_NAME).toPath(); } catch (IOException e) { throw new...
<vulnerable_code><commit_title>[PATCH] NMS-15704: Added tests<commit_description><fixed_code> /******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2023 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2023 The OpenNMS Group, ...
<vulnerable_code> * "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o * ======================================================================== * Author: Chris Brame * Updated: 2/14/19 12:07 AM * Copyright (c) 2014-2019. All rights reserved. */ router.post('/api/v2/token', cont...
<vulnerable_code> static int bgp_attr_print(netdissect_options *ndo, u_int atype, const u_char *pptr, u_int len) { int i; uint16_t af; ND_PRINT((ndo, "+%x", aflags & 0xf)); ND_PRINT((ndo, "]: ")); } /* FIXME che...
<vulnerable_code> def initialize_repo_template(self, template): venv_name = ".venv" cmd_init = [ f"git clone {template} {self.pipeline.repo}", f"cd {self.pipeline.repo}", "rm -rf .git", "git init --initial-branch main", f"python3 -m venv {ve...
<vulnerable_code> unsigned long src_addr, struct page **pagep) { int vm_shared = dst_vma->vm_flags & VM_SHARED; struct hstate *h = hstate_vma(dst_vma); pte_t _dst_pte; __SetPageUptodate(page); set_page_huge_active(page); /* * If shared, add to page cache */ if (vm_shared) { struct address_spa...
<vulnerable_code> "where dev_token_first_seen is null and " "username in (" + ("%s, " * (len(dev_tokens_users) - 1)) + "%s)" ) # print("update_new_dev_tokens_statement : " + update_new_dev_tokens_statement) update_dev_tokens_prep_cursor = db_connection.cursor(prepared=True) update_dev_...
<vulnerable_code> attr->value = NULL; attr->key = NULL; /* an attribute should start with the separator */ if (*pos != LF_ATTR_SEPARATOR_C) { DEBUG("Attribute should start with separator, found %c\n", *pos);<commit_title>[PATCH] clif: Don't access any data if input is empty<commit_description>Th...
<vulnerable_code> TEST_ASSERT_EQUAL_INT(strlen(input), r); } Test *tests_clif_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_clif_encode_links), new_TestFixture(test_clif_decode_links), new_TestFixture(test_clif_get_attr_missing_value), }; EMB_UNIT_TESTCALL...
<vulnerable_code> IMATH_NAMESPACE::Rand48 rand48 (0); const int N = 1000000; Array <unsigned short> raw (N); fill1 (raw, N, 1, rand48); // test various symbol distributions compressUncompress (raw, N); compressUncompressSubset (raw, N); fill1 (raw, N, 10, rand48); compressUncompress (raw, N); compressUncom...
<vulnerable_code> goto cleanup; } if (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr))) { rcode = -EINVAL; goto cleanup; }<commit_title>[PATCH] aacraid: prevent invalid pointer dereference<commit_description>It appears that driver runs into a problem here if fibsize is too small because we allocate us...
<vulnerable_code> self.evaluate(z) class FractionalAvgPoolGradTest(test.TestCase): """Tests for FractionalAvgPoolGrad.<commit_title>[PATCH] Fix security vulnerability with FractionalMax(AVG)Pool with<commit_description><fixed_code> self.evaluate(z) def testPoolingRatioHasMoreDimThanInput(self): ...
<vulnerable_code> nn_ops.fractional_max_pool( rand_mat, [1, 1.5, 1.5, 1], seed=1, seed2=1, deterministic=True) def testPoolingRatio(self): with self.cached_session() as _: with self.assertRaisesRegex( errors.InvalidArgumentError, name=None) self.evaluate(result)...
<vulnerable_code> attrs, play.libs.Scala.asJava( play.api.data.FormUtils.fromJson( play.api.libs.json.Json.parse(play.libs.Json.stringify(data)), maxChars)), allowedFields); } <commit_title>[PATCH] add depth limit for JSON form binding<commit_description><fixed_code>...
<vulnerable_code> this.directFieldAccess = directFieldAccess; } protected long maxJsonChars() { return config.getMemorySize("play.http.parser.maxMemoryBuffer").toBytes(); } protected Map<String, String> requestData(Http.Request request) { Map<String, String[]> urlFormEncoded = new HashMap<>(); ...
<vulnerable_code>"use strict"; var _ = require('underscore'); var TYPE_DELIMETER = ':' , PATH_REGEX = /^{[A-Za-z0-9_]+}$/<commit_title>[PATCH] feat & refactor: Change underscore to lodash<commit_description><fixed_code> 'use strict'; var _ = require('lodash'); var TYPE_DELIMETER = ':' , PATH_REGEX = /^{[A-Za-z0...