text
stringlengths
79
3.72M
<vulnerable_code> } const host = nuclideUri.getHostname(pathString); const cwd = nuclideUri.createRemoteUri(host, hackRootString); const notification = atom.notifications.addInfo( startDebugger<commit_title>[PATCH] Ignore invalid hostnames in hhvm-attach deep link<commit_description>Summary: Provi...
<vulnerable_code> ValueError: if `input_signature` is not None and the `python_function`'s argspec has keyword arguments. """ self._lock = threading.Lock() self._python_function = python_function self._function_spec = function_lib.FunctionSpec.from_function_and_signature( python_fun...
<vulnerable_code>from six.moves import range from tensorflow.python.autograph.core import converter from tensorflow.python.eager import def_function from tensorflow.python.eager import lift_to_graph from tensorflow.python.framework import constant_op from tensorflow.python.framework import test_util from tensorflow.py...
<vulnerable_code> if self.input_signature is not None: self._hashable_input_signature = hash(self.flat_input_signature) self._lock = threading.Lock() # _descriptor_cache is a of instance of a class to an instance-specific # `Function`, used to make sure defun-decorated methods create different ...
<vulnerable_code> const forms = document.querySelectorAll( '.wp-block-form-block-form' ); for ( const form of forms ) { form.addEventListener( 'submit', submitForm ); } /** * Submit the form. * setSubmitMessage( form, 'error', formBlockData.i18n.backendError ); console.error( error ); } ...
<vulnerable_code> rar->range_dec.Stream = &rar->bytein; __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context); if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context, rar->dictionary_size, &g_szalloc)) {<commit_title>[PATCH] Issue 719: Fix for TALOS-CAN-154<commit_descr...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4978, /**/<commit_title>[PATCH] patch 8.2.4979: accessing freed memory when line is flushed<commit_description>Problem: Accessing freed memory when line is flushed. Solution: Make a copy of the pattern to sear...
<vulnerable_code> CHECK_CMDWIN; if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0) break; find_pattern_in_path(ptr, 0, len, TRUE, Prenum == 0 ? TRUE : FALSE, type, Prenum1, ACTION_SPLIT, (linenr_T)1, (linenr_T)MAXLNUM); curwin->w_set_curswant = TRUE; break; #endif<commit_title>[PATCH] patc...
<vulnerable_code> _defaultvalues[_member_idx(temp)].val = val; return true; } if(belongs_to_static_table) { SQInteger mmidx; if((sq_type(val) == OT_CLOSURE || sq_type(val) == OT_NATIVECLOSURE) &&<commit_title>[PATCH] check max member count in class<commit_description><fixed_code> ...
<vulnerable_code> contents: '<i class="fa fa-list-alt"/> File Manager', tooltip: 'elfinder', click: function () { elfinderDialog(); } }); <commit_title>[PATCH] Add Post Param at Hooks F...
<vulnerable_code>var path = require("path"); var fs = require("fs"); var util = require("util"); var exec = require("child_process").exec; function PDFImage(pdfFilePath, options) { if (!options) options = {}; PDFImage.prototype = { constructGetInfoCommand: function () { return util.format( "pdfinfo \"...
<vulnerable_code> }); it("should return correct convert command", function () { expect(pdfImage.constructConvertCommandForPage(1)) .equal('convert "/tmp/test.pdf[1]" "/tmp/test-1.png"'); }); it("should return correct convert command to combine images", function () { expect(pdfImage.constructCombi...
<vulnerable_code> AV_GET_BUFFER_FLAG_REF)) < 0) goto error; if (!s->edge_emu_buffer) s->edge_emu_buffer = av_malloc(9 * FFABS(s->current_frame.f->linesize[0])); if (s->keyframe) { if (!s->theora) {<commit_title>[PATCH] avcodec/vp3: Add missing che...
<vulnerable_code>from vantage6.common.task_status import TaskStatus from vantage6.server.default_roles import DefaultRole class _OnlyIdSchema(Schema): class ChangePasswordInputSchema(Schema): """ Schema for validating input for changing a password. """ current_password = fields.String(required=True, validat...
<vulnerable_code> if (current>0) { if (!ctx->opid) { if (ctx->bytes_in_header) { ctx->bytes_in_header -= current; } else { start += current; remain -= current; if (byte_offset != GF_FILTER_NO_BO) { gf_filter_pck_set_byte_offset(dst_pck, byte_offset - ctx->bytes_in_header); } ...
<vulnerable_code>import org.nmap4j.core.nmap.NMapProperties; import org.nmap4j.data.NMapRun; import org.nmap4j.parser.OnePassParser; /** * This is the simplified way to execute and parse Nmap output. This is the * easiest way to run Nmap from this API. Use of this class requires a little * more knowledge of Nma...
<vulnerable_code> import com.google.common.net.InternetDomainName; import java.util.regex.Pattern; public class HostsValidator { private final static String IP_REGEX = "^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])"; private final static String IP_CIDR = "(\\/([0-9]|[1-2][0-9]|3[0...
<vulnerable_code>package org.nmap4j.core.valid; public class ValidationTest { }<commit_title>[PATCH] Adding hosts validation fixing<commit_description><fixed_code> package org.nmap4j.core.valid; import org.junit.Test; import org.nmap4j.valid.HostsInputValidator; import static org.junit.Assert.assertFalse; import sta...
<vulnerable_code> break; } case OP_POP: { Jsi_Value *tval = _jsi_TOP; if ((interp->evalFlags&JSI_EVAL_RETURN) && (ip+1) >= end && (Jsi_ValueIsObjType(interp, tval, JSI_OT_ITER)==0 &&<commit_title>[PATCH] Fixes #60<commit_description...
<vulnerable_code> * * The allowed media can be set with "setAudioAllowed(bool)" and * "setVideoAllowed(bool)". If the audioInputId or videoInputId changed but that * media is currently not allowed the change will be ignored. * * Once the source is started "stop()" needs to be called to stop listening to * changes...
<vulnerable_code> }) }) describe('stop', () => { test('with audio and video tracks', async () => { getUserMediaAudioTrack = newMediaStreamTrackMock('audio', 'audio')<commit_title>[PATCH] Update tracks based on changes in the allowed media<commit_description><fixed_code> }) }) describe('allow and disallow ...
<vulnerable_code> code = """ struct Animal: location: address fur: uint256 struct Human: location: address height: uint256 @external def return_nested_tuple() -> (Animal, Human): animal: Animal = Animal({ location: 0x1234567890123456789012345678901234567890, fur: 123 }) ...
<vulnerable_code> ARG_UNUSED(argc); ARG_UNUSED(argv); char *device_id = k_malloc(DEVICE_ID_MAX_SIZE); char *firmware_version = k_malloc(BOOT_IMG_VER_STRLEN_MAX); updatehub_get_firmware_version(firmware_version, BOOT_IMG_VER_STRLEN_MAX); updatehub_get_device_identity(device_id, DEVICE_ID_MAX_SIZE); shell_fprint...
<vulnerable_code> static struct k_delayed_work updatehub_work_handle; static void wait_fds(void) { if (poll(ctx.fds, ctx.nfds, NETWORK_TIMEOUT) < 0) { { struct tc_sha256_state_struct sha256sum; unsigned char hash[TC_SHA256_DIGEST_SIZE]; char buffer[3]; int buffer_len = 0; if (tc_sha256_init(&sha256sum) == 0) { ...
<vulnerable_code> bool updatehub_get_device_identity(char *id, int id_max_len) { int i, id_len = 0; char buf[3]; u8_t hwinfo_id[id_max_len]; size_t length; length = hwinfo_get_device_id(hwinfo_id, sizeof(hwinfo_id) - 1); if (length <= 0) { return false; } memset(id, 0, id_max_len); for (i = 0; i < length;...
<vulnerable_code>import java.util.List; import java.util.Map; import org.apache.commons.lang3.NotImplementedException; import org.xwiki.component.annotation.Role; import org.xwiki.model.EntityType; */ void setAttachmentContent(AttachmentReference attachmentReference, byte[] attachmentData) throws Exception; ...
<vulnerable_code> */ package org.xwiki.officeimporter.document; import java.util.Map; public interface CompatibilityOfficeDocument { * as artifacts. * * @return a map containing artifacts for this document. * @deprecated Since 13.1RC1 use {@link OfficeDocument#getArtifactsFiles()}. */ @De...
<vulnerable_code>package org.xwiki.officeimporter.document; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.Set; import org.xwiki.officeimporter.converter.OfficeConverterResult; /** * Represents an office document being imported. * Artif...
<vulnerable_code><commit_title>[PATCH] XWIKI-20715: Don't use user-provided filenames in office<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> */ package org.xwiki.officeimporter.document; import java.io.File; import java.io.IOException; import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.rendering.renderer.printer.DefaultWikiPrinter; import org.xw...
<vulnerable_code> */ package org.xwiki.officeimporter.document; import java.io.File; import java.io.IOException; import java.util.Set; import org.w3c.dom.Document; import org.xwiki.officeimporter.converter.OfficeConverterResult; import org.xwiki.xml.html.HTMLUtils; /** /** * Artifacts for this office docume...
<vulnerable_code> */ package org.xwiki.officeimporter.internal; import java.io.File; import java.io.FileInputStream; import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.xwiki.bridge.DocumentAccessBridge; import org...
<vulnerable_code>import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.file.Files; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import org.xwik...
<vulnerable_code> } catch (ParseException ex) { throw new OfficeImporterException("Error: Could not parse xhtml office content.", ex); } return new XDOMOfficeDocument(xdom, xhtmlOfficeDocument.getArtifactsFiles(), this.componentManager, xhtmlOfficeDocument.getConverterResu...
<vulnerable_code> import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import ...
<vulnerable_code> OfficeConverterFileStorage storage = new OfficeConverterFileStorage(this.workDir, inputFileName, outputFileName); // Write out all the input streams. for (Map.Entry<String, InputStream> entry : inputStreams.entrySet()) { File temp = n...
<vulnerable_code>import java.io.File; import java.io.IOException; import java.util.UUID; import org.apache.commons.lang3.StringUtils; /** */ public class OfficeConverterFileStorage { /** * Top-level temporary working directory. */ // Realize the temporary directory hierarchy. this.rootD...
<vulnerable_code><commit_title>[PATCH] XWIKI-20715: Don't use user-provided filenames in office<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> htmlDocument.setUserData(EMBEDDED_IMAGES, new HashMap<String, byte[]>(), null); } List<Element> images = filterDescendants(htmlDocument.getDocumentElement(), new String[] {TAG_IMG}); for (Element image : images) { Attr source = image.getAttributeNode(ATT...
<vulnerable_code> */ package org.xwiki.officeimporter.internal.splitter; import java.io.File; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.xwiki.component.manager.ComponentLookup...
<vulnerable_code> { Parser parser = this.componentManager.getInstance(Parser.class, syntax); XDOM xdom = parser.parse(new StringReader(content)); return new XDOMOfficeDocument(xdom, Collections.emptySet(), this.componentManager, null); } }<commit_title>[PATCH] XWIKI-20715: Don't use user-...
<vulnerable_code> import java.io.File; import java.io.FileOutputStream; import java.util.Collections; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.Test; import org.xwiki.model.reference.AttachmentReference; import org.xwiki.model.reference.DocumentReference; import org.xwiki.officeimporter.docume...
<vulnerable_code>import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import javax.inject.Named; import org.xwiki.model.reference.EntityReferenceSerializer; import org.xwiki.officeimporter.converter.OfficeConverter; import org.xwiki.of...
<vulnerable_code> * @since 2.1M1 */ @ComponentTest public class DefaultXDOMOfficeDocumentBuilderTest extends AbstractOfficeImporterTest { /** * The name of an input file to be used in tests. * Test {@link OfficeDocument} building. */ @Test public void xdomOfficeDocumentBuilding() throws Exce...
<vulnerable_code>import java.io.FileOutputStream; import java.io.InputStream; import java.io.Reader; import java.nio.file.Files; import java.util.Arrays; import java.util.Collections; import org.xwiki.model.reference.EntityReferenceSerializer; import org.xwiki.officeimporter.converter.OfficeConverter; import org.xwiki....
<vulnerable_code><commit_title>[PATCH] XWIKI-20715: Don't use user-provided filenames in office<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>import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import org.xwiki.model.reference.AttachmentReference; import org.xwiki.model.reference.DocumentReference; import org...
<vulnerable_code> // Create xdom office document. XDOMOfficeDocument officeDocument = new XDOMOfficeDocument(xdom, Collections.emptySet(), this.componentManager, null); final DocumentReference baseDocument = new DocumentReference("xwiki", "Test", "Test"); // Add expectations...
<vulnerable_code> resultPage = importFile(testName, "ooffice.3.0/Test.odt"); assertTrue(StringUtils.contains(resultPage.getContent(), "This is a test document.")); WikiEditPage wikiEditPage = resultPage.editWiki(); String regex = "(?<imageName>Test_html_[\\w]+\\.png)"; Pattern pat...
<vulnerable_code>package org.xwiki.office.viewer.internal; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.net.URL; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import...
<vulnerable_code> import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import javax.inject.Named; import javax.inject.Provider; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.BeforeEac...
<vulnerable_code> setAttachmentContent(doc, attachmentReference.getName(), attachmentData, xcontext); } @Override @Deprecated public void setAttachmentContent(String documentReference, String attachmentFilename, byte[] attachmentData) private void setAttachmentContent(XWikiDocument doc, Str...
<vulnerable_code> */ package com.xpn.xwiki.doc; import org.junit.jupiter.api.Test; import org.xwiki.model.reference.DocumentReference; import org.xwiki.test.junit5.mockito.InjectMockComponents; import com.xpn.xwiki.test.MockitoOldcore; import com.xpn.xwiki.test.junit5.mockito.OldcoreTest; import static org.junit.jup...
<vulnerable_code> */ package org.xwiki.wysiwyg.internal.importer; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.util.Map; import java.util.Optional; import javax.inject.Provider; import javax.inject.Singleton; import org.apache.commons.io.IOUtils; import org.xwiki.bridge...
<vulnerable_code> import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.*; /** * Unit tests for {@link OfficeAttachmentImporter}. XDOMOfficeDocument xdomOfficeDocument = mock(XDOMOfficeDocument.class); ...
<vulnerable_code> s.close(); // Read all rows from source s = connSource.prepareStatement(currentStatement = "SELECT * FROM " + dbObject + (useSuffix ? "_" : "")); ResultSet rs = s.executeQuery(); if(rs != null) { ResultSetMetaData rsm = rs.getMetaData(); props.put("user", usernameSource); props...
<vulnerable_code> for (x=((ssize_t) number_pixels-7); x > 0; x-=8) { pixel=(unsigned char) *indexes++; *q=((pixel & 0x01) << 7); pixel=(unsigned char) *indexes++; *q|=((pixel & 0x01) << 6); pixel=(unsigned char) *indexes++; *q|=((pixel & 0x01) << 5); p...
<vulnerable_code>static volatile int internal_stop_logging= 0; static char incl_user_buffer[1024]; static char excl_user_buffer[1024]; static char *big_buffer= NULL; static size_t big_buffer_alloced= 0; static unsigned int query_log_limit= 0; static char servhost[256]; /* These belong to the service initialization */ ...
<vulnerable_code> @Value("${folio.system.username}") private String username; public String getTokenForSystemUser(String tenant, String url) { SystemUserParameters userParameters = .okapiUrl(url) .tenantId(tenant) .username(username) .password(username) ...
<vulnerable_code> @Value("${folio.system.username}") private String username; public void prepareSystemUser(String okapiUrl, String tenantId) { Optional<User> userOptional = getUser(username); authService.saveCredentials(SystemUserParameters.builder() .id(UUID.randomUUID()) .usernam...
<vulnerable_code>package org.folio.des; import org.folio.de.entity.JobCommand; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableFeignClients @EntityScan(basePackageClasses = JobCommand.class) public class ModDataExportSpringApplication { ...
<vulnerable_code>import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @FeignClient("authn") public interf...
<vulnerable_code> return CollectionUtils.isNotEmpty(token) && StringUtils.isNotBlank(token.get(0)); } public void saveCredentials(SystemUserParameters systemUserParameters) { authClient.saveCredentials(systemUserParameters); log.info("Saved credentials for user {}.", systemUserParameters.getUsername())...
<vulnerable_code> updateUser(user); } else { user = createUser(username); authService.saveCredentials(SystemUserParameters.builder() .id(UUID.randomUUID()) .username(username) .password(password) .okapiUrl(okapiUrl) .tenantId(tenantId) .bu...
<vulnerable_code> .withEnv("DB_PASSWORD", "password") .withEnv("DB_DATABASE", "postgres") .withEnv("KAFKA_HOST", "mykafka") .withEnv("KAFKA_PORT", "9092"); private static void mockPath(MockServerClient mockServerClient, String path, String jsonBody) { mockServerClient.when(request(path))<commit_ti...
<vulnerable_code><commit_title>[PATCH 2/7] Remove default password for system user; update README<commit_description>To avoid this vulnerability: CWE-1393: Use of Default Password https://cwe.mitre.org/data/definitions/1393.html<fixed_code> package org.folio.des; import static org.hamcrest.CoreMatchers.containsString;...
<vulnerable_code> if (userOptional.isPresent()) { user = userOptional.get(); updateUser(user); } else { user = createUser(username); } authService.setCredentials(SystemUserParameters.builder() .id(UUID.randomUUID()) .username(username) .password(password)<commit...
<vulnerable_code>package org.folio.des.security; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor; import static com.github.tomakehurst.wiremock.clien...
<vulnerable_code> if (userOptional.isPresent()) { user = userOptional.get(); updateUser(user); authService.deleteCredentials(user.getId()); } else { user = createUser(username); } authService.saveCredentials(SystemUserParameters.builder() .id(UUID.randomUUID()) .u...
<vulnerable_code> import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.delete; import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor; import static...
<vulnerable_code> * @api public */ req.logout = req.logOut = function(done) { var property = this._userProperty || 'user'; this[property] = null;<commit_title>[PATCH] Add optional options to login and logout.<commit_description><fixed_code> * @api public */ req.logout = req.logOut = function(options, done) { ...
<vulnerable_code> this._serializeUser = serializeUser; } SessionManager.prototype.logIn = function(req, user, cb) { console.log('SM: logIn'); if (!req.session) { return cb(new Error('Login sessions require session support. Did you forget to use `express-session` middleware?')); } }); } SessionManager.protot...
<vulnerable_code> import { testProp } from "@fast-check/ava"; import test from "ava"; import sinon from "sinon"; import { arbitrary } from "./_.js"; t.not(executable, linkedExecutable); t.not(resolvedExecutable, linkedExecutable); t.context = { executable, linkedExecutable, resolvedExecutable }; }); test.befor...
<vulnerable_code>from django.contrib.auth.models import AnonymousUser from django.utils.crypto import constant_time_compare from django.utils.encoding import force_str from rest_framework.authentication import BasicAuthentication, get_authorization_header from rest_framework.exceptions import AuthenticationFailed from ...
<vulnerable_code>from django.utils.decorators import method_decorator from django.views.decorators.cache import never_cache from rest_framework import serializers from rest_framework.authentication import SessionAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.request import Req...
<vulnerable_code> if (conf.enableGZIPEncoding && acceptEncodingHeader.includes("gzip") && mime && (!Array.isArray(mime) || Array.isArray(mime) && mime[1]) ) { res.writeHead(200, _getServerHeaders({ "Content-Type": Array.isArray(mime)?mime[0]:mime, "Content-Encoding": "gzip" }, stats)); rawStream.pipe(zlib.cre...
<vulnerable_code> var required = require('requires-port') , qs = require('querystringify') , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\// , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i , whitespace = '[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u20...
<vulnerable_code> , key; spec.protocol = get('protocol'); spec.hostname = get('hostname'); spec.pathname = get('pathname'); <commit_title>[PATCH] [security] More backslash fixes<commit_description><fixed_code> , key; spec.protocol = get('protocol'); spec.slashes = true; spec.hostname = get('host...
<vulnerable_code> , parsed = parse(url); assume(parsed.port).equals(''); assume(parsed.host).equals('example.com'); assume(parsed.hostname).equals('example.com'); assume(parsed.href).equals('http://example.com'); }); it('understands an / as pathname', function () { assume(parsed.hostname)...
<vulnerable_code> var url = $('#bookmark_add_url').val(); var tags = $('#bookmark_add_tags').val(); $.ajax({ url: 'ajax/addBookmark.php', data: 'url=' + encodeURI(url) + '&tags=' + encodeURI(tags), success: function(data){ <commit_title>[PATCH] Using POST instead of GET.<commit_description><fixed_code> var url...
<vulnerable_code> } $.ajax({ url: OC.filePath('bookmarks', 'ajax', 'updateList.php'), data: 'tag=' + encodeURIComponent($('#bookmarkFilterTag').val()) + '&page=' + bookmarks_page + '&sort=' + bookmarks_sorting, success: function(bookmarks){ } if (id == 0) { $.ajax({ url: OC.filePath('bookmarks', 'ajax', ...
<vulnerable_code> var jsFileLocation = $('script[src*=bookmarksearch]').attr('src'); jsFileLocation = jsFileLocation.replace('js/bookmarksearch.js', ''); $.ajax({ url: jsFileLocation + 'ajax/recordClick.php', data: 'url=' + encodeURI($(this).attr('href')), }); <commit_title>[PATCH] Using POST instead of GET.<com...
<vulnerable_code>package org.openhab.binding.exec.internal; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ThingTypeUID; /** * The {@link ExecBinding} class defines common constants, which are * used across the whole binding. * * @author Karel Goderis - Initial contrib...
<vulnerable_code> */ package org.openhab.binding.exec.internal; import static org.openhab.binding.exec.internal.ExecBindingConstants.THING_COMMAND; import java.util.Collections; import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.sm...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-w698-693g-23hv<commit_description>* fix arbitrary code execution vulnerability Signed-off-by: Jan N. Klug <jan.n.klug@rub.de> * Update bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java Co-Autho...
<vulnerable_code> */ package org.openhab.binding.exec.internal.handler; import static org.openhab.binding.exec.internal.ExecBindingConstants.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigDecimal; import java.time.ZonedDateTime; import java.util.Arr...
<vulnerable_code>import org.eclipse.smarthome.core.transform.TransformationException; import org.eclipse.smarthome.core.transform.TransformationService; import org.eclipse.smarthome.io.net.exec.ExecUtil; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; ...
<vulnerable_code>package org.openhab.transform.exec.internal.profiles; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.profiles.ProfileCallback; import org.eclipse.smarthome.core.thing.profiles.ProfileContext; * Pr...
<vulnerable_code> Sections[SectionsRead].Size = itemlen; Data = (uchar *)malloc(itemlen); if (Data == NULL){ ErrFatal("Could not allocate memory"); } return FALSE; } ThumbLen = 0; <commit_title>[PATCH] Just allocate 20 bytes extra at the end o...
<vulnerable_code> _exit(127); } if ((options->flags & UV_PROCESS_SETGID) && setgid(options->gid)) { uv__write_int(error_fd, -errno); perror("setgid()");<commit_title>[PATCH] unix: call setgoups before calling setuid/setgid<commit_description>Partial fix for #1093<fixed_code> _exit(127); } if (o...
<vulnerable_code>var profiles=[];function sendTestEmail(){var o=[];$.each($("#headersTable").DataTable().rows().data(),function(e,a){o.push({key:unescapeHtml(a[0]),value:unescapeHtml(a[1])})});var e={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input...
<vulnerable_code> }) .error(function (data) { $("#sendTestEmailModal\\.flashes").empty().append("<div style=\"text-align:center\" class=\"alert alert-danger\">\ <i class=\"fa fa-exclamation-circle\"></i> " + data.responseJSON.message + "</div>") $("#sendTestModalSubmit").html...
<vulnerable_code> // Check if this is an alpha message if (is_alphanumeric_page(flex)) mw1++; // does not account for long address/group/frag/etc parse_alphanumeric(flex, phaseptr, PhaseNo, mw1, len, frag, cont, flex_groupmessage, flex_groupbit); else if (is_numeric_page(flex)) parse_nume...
<vulnerable_code> connWrkr->parseState.iOctetsRemain = connWrkr->parseState.iOctetsRemain * 10 + ch - '0'; } // temporarily save this character into the message buffer connWrkr->pMsg[connWrkr->iMsg++] = ch; } else { const char *remoteAddr = ""; if (connWrkr->propRemoteAddr) {<commit_title>[PATCH 1/2...
<vulnerable_code> if(pThis->iOctetsRemain <= 200000000) { pThis->iOctetsRemain = pThis->iOctetsRemain * 10 + c - '0'; } *(pThis->pMsg + pThis->iMsg++) = c; } else { /* done with the octet count, so this must be the SP terminator */ DBGPRINTF("TCP Message with octet-counter, size %d.\n", pThis->iOctetsR...
<vulnerable_code> break; #endif case KVM_CAP_PPC_HTM: r = cpu_has_feature(CPU_FTR_TM_COMP) && is_kvmppc_hv_enabled(kvm); break; default: r = 0;<commit_title>[PATCH] KVM: PPC: Fix oops when checking KVM_CAP_PPC_HTM<commit_description>The following program causes a kernel oops: #include <sys/types.h> #inc...
<vulnerable_code> } getAnnotationURL(sourceMapString) { return sourceMapString.match(/\/\*\s*# sourceMappingURL=(.*)\*\//)[1].trim() } loadAnnotation(css) { let annotations = css.match(/\/\*\s*# sourceMappingURL=.*\*\//gm) if (annotations && annotations.length > 0) { // Locate the last sourc...
<vulnerable_code> "%s CAPABILITY has action: %d, code: %u, length %u", peer->host, action, hdr->code, hdr->length); /* Capability length check. */ if ((pnt + hdr->length + 3) > end) { zlog_info("%s Capability length error", peer->host);<commit_title>[PATCH] bgpd: Make sure hdr length is at a minimum of w...
<vulnerable_code>This allows inner functions to be edited, and is used when edit() is called on an inner function. */ void jswrap_function_replaceWith(JsVar *oldFunc, JsVar *newFunc) { if (!jsvIsFunction(newFunc)) { jsExceptionHere(JSET_TYPEERROR, "First argument of replaceWith should be a function - ignoring");...
<vulnerable_code> */ if (net->rx_ready == 0) { net->rx_ready = 1; vq->used->flags |= VRING_USED_F_NO_NOTIFY; } } <commit_title>[PATCH] dm: NULL check of vq->used in virtio_net_ping_rxq<commit_description>Add a check on this place to avoid NULL access issue. Tracked-On: #6100 Signed-off-by: Jie Deng <jie.deng@in...