text
stringlengths
79
3.72M
<vulnerable_code> import javax.servlet.http.HttpServletRequest; public interface Authenticator { /** * Verifying legality via username and password * @param username user name * @param password user password * @param extra extra info * @return result object */ Result<Map<String, ...
<vulnerable_code>import org.apache.dolphinscheduler.dao.entity.Session; import org.apache.dolphinscheduler.dao.entity.User; import java.util.HashMap; import java.util.Map; import java.util.Objects; import javax.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.facto...
<vulnerable_code>import org.apache.dolphinscheduler.api.security.impl.AbstractAuthenticator; import org.apache.dolphinscheduler.dao.entity.User; import org.springframework.beans.factory.annotation.Autowired; public class LdapAuthenticator extends AbstractAuthenticator { LdapService ldapService; @Override ...
<vulnerable_code>public class PasswordAuthenticator extends AbstractAuthenticator { @Override public User login(String userId, String password, String extra) { return userService.queryUser(userId, password); } }<commit_title>[PATCH] Expire session when update user password (#15219)<commit_descripti...
<vulnerable_code> import javax.servlet.http.HttpServletRequest; import org.casbin.casdoor.entity.CasdoorUser; import org.casbin.casdoor.service.CasdoorAuthService; import org.springframework.beans.factory.annotation.Autowired; private String adminUserName; @Override public User login(String state, String ...
<vulnerable_code>import org.apache.dolphinscheduler.dao.entity.Session; import org.apache.dolphinscheduler.dao.entity.User; import javax.servlet.http.HttpServletRequest; /** * session service */ public interface SessionService { /** * get user session from request * * @param request request ...
<vulnerable_code> */ Result queryUserList(User loginUser, String searchVal, Integer pageNo, Integer pageSize); /** * updateProcessInstance user * * * @param loginUser * @param userId user id * @param userName user name * @param userPassword user password * @param ema...
<vulnerable_code> package org.apache.dolphinscheduler.api.service.impl; import org.apache.dolphinscheduler.api.controller.BaseController; import org.apache.dolphinscheduler.api.service.SessionService; import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.dao.entity.Session; ...
<vulnerable_code>import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ServiceException; import org.apache.dolphinscheduler.api.service.MetricsCleanUpService; import org.apache.dolphinscheduler.api.service.UsersService; import org.apache.dolphinscheduler.api.utils.CheckU...
<vulnerable_code>import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.dao.DaoConfiguration; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.commons.lang3.StringUtils; import org.apache.curator.test.T...
<vulnerable_code> package org.apache.dolphinscheduler.api.security.impl.ldap; import static org.mockito.Mockito.when; import org.apache.dolphinscheduler.api.controller.AbstractControllerTest; @Test public void testAuthenticate() { when(ldapService.ldapLogin(ldapUid, ldapUserPwd)).thenReturn(ldapEmail)...
<vulnerable_code> package org.apache.dolphinscheduler.api.security.impl.pwd; import static org.mockito.Mockito.when; import org.apache.dolphinscheduler.api.controller.AbstractControllerTest; @Test public void testLogin() { when(usersService.queryUser("test", "test")).thenReturn(mockUser); User...
<vulnerable_code> @Test public void testAuthenticate() { when(usersService.getUserByUserName(casdoorUsername)).thenReturn(mockUser); when(sessionService.createSession(mockUser, ip)).thenReturn(mockSession.getId()); when(casdoorAuthService.getOAuthToken(code, state)).thenReturn(token); ...
<vulnerable_code>package org.apache.dolphinscheduler.api.service; import org.apache.dolphinscheduler.api.service.impl.SessionServiceImpl; import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.common.enums.UserType; import org.apache.dolphinscheduler.common.utils.DateUtils; i...
<vulnerable_code> package org.apache.dolphinscheduler.api.service; import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.USER_MANAGER; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import org.apache.commons.collections4.CollectionUtils; ...
<vulnerable_code> import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; /** * session */ @TableName("t_ds_session") public class Session { /** * id */ @TableId(value = "id...
<vulnerable_code> import org.apache.dolphinscheduler.dao.entity.Session; import org.apache.ibatis.annotations.Param; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * session mapper interface */ public interface SessionMapper extends BaseMapper<Session> { /** * query s...
<vulnerable_code> import lombok.NonNull; import com.baomidou.mybatisplus.core.mapper.BaseMapper; public abstract class BaseDao<ENTITY, MYBATIS_MAPPER extends BaseMapper<ENTITY>> implements IDao<ENTITY> { return mybatisMapper.selectBatchIds(ids); } @Override public int insert(@NonNull ENTITY model...
<vulnerable_code> */ List<Entity> queryByIds(Collection<? extends Serializable> ids); /** * Insert the entity. */ */ boolean deleteByIds(Collection<? extends Serializable> ids); }<commit_title>[PATCH] Expire session when update user password (#15219)<commit_description><fixed_code> ...
<vulnerable_code><commit_title>[PATCH] Expire session when update user password (#15219)<commit_description><fixed_code> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding cop...
<vulnerable_code><commit_title>[PATCH] Expire session when update user password (#15219)<commit_description><fixed_code> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding cop...
<vulnerable_code>import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; public class SessionMapperTest extends BaseDaoTest { @Autowired @Test public void testQueryByUserId() { Session session = insertOne(); List<Session> sessions = sessionMapper.q...
<vulnerable_code> return_value=MOCK_CONF_WITH_SENSITIVE_VALUE, ) @conf_vars({("webserver", "expose_config"): "non-sensitive-only"}) def test_should_respond_200_text_plain_with_non_sensitive_only(self, mock_as_dict): response = self.client.get( "/api/v1/config/section/core/option/s...
<vulnerable_code> author.setBooks(Sets.newHashSet(book)); PersistentResource<Book> resource = new PersistentResource<>(book, null, "", scope); //First test collecting the predicates in a Set VerifyFieldAccessFilterExpressionVisitor visitor = new VerifyFieldAccessFilterExpressionVisitor(r...
<vulnerable_code> d.addCallback(cbFinished) return d def test_badConnect(self): """<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> d.addCallback(cbFinished) return d if os.environ.get("INFRASTRUCTURE") == "MSVSHOSTED": ...
<vulnerable_code> from __future__ import division, absolute_import from twisted.trial import unittest from twisted.python.compat import intToBytes<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> from __future__ import division, absolute_import import os from twisted...
<vulnerable_code> # accept should be tried next. self.assertEqual(port.numberAccepts, 1) def test_permissionFailure(self): """<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> # accept should be tried next. self.assertEqual(por...
<vulnerable_code> d.addCallback(cbFinished) return d if os.environ.get("INFRASTRUCTURE") == "MSVSHOSTED": test_connectionRefused.skip = "Hangs on MSVS Hosted due to firewall" def test_badConnect(self):<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description>...
<vulnerable_code> if self.finished: raise RuntimeError('Request.write called on a request after ' 'Request.finish was called.') if not self.startedWriting: self.startedWriting = 1 version = self.clientproto<commit_title>[PATCH 01/33] make...
<vulnerable_code> self.assertRaises(RuntimeError, req.finish) def test_reprUninitialized(self): """ L{Request.__repr__} returns the class name, object address, and<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> self.assertRaises(Runt...
<vulnerable_code> self.assertTrue(request._disconnected) self.assertTrue(request.channel is None) # An attempt to write should at this point raise an exception. self.assertRaises(AttributeError, request.write, b"third chunk") # Check that everything is fine. # We expect ...
<vulnerable_code> if self._disconnected: # Don't attempt to write any data to a disconnected client. # The RuntimeError exception will be thrown as usual when # request.finish is called return <commit_title>[PATCH 01/33] make pems not convert and skip a test<comm...
<vulnerable_code> """ Pass the loseConnection through to the underlying channel. """ self.channel.loseConnection() def __eq__(self, other):<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> """ Pass the loseConnection th...
<vulnerable_code> def test_writeAfterConnectionLost(self): """ Calling L{Request.write} after L{Request.connectionLost} has been called should not throw an exception. L{RuntimeError} will be raised when finish is called on the request. """ channel = DummyChannel()<comm...
<vulnerable_code> # accept should be tried next. self.assertEqual(port.numberAccepts, 1) def test_permissionFailure(self): """ skipMsg = 'This test only applies to reactors that implement IReactorFDset' PlatformAssumptionsTests.skip = skipMsg SelectReactorTests.skip = skipMsg <c...
<vulnerable_code> d.addCallback(cbFinished) return d if os.environ.get("INFRASTRUCTURE") == "MSTSHOSTED": test_connectionRefused.skip = "Hangs on MSTS Hosted due to firewall" def test_badConnect(self):<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description>...
<vulnerable_code> return d if os.environ.get("INFRASTRUCTURE") == "AZUREPIPELINES": test_connectionRefused.skip = "Hangs on Azure Pipelines due to firewall" def test_badConnect(self):<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> retur...
<vulnerable_code> del reapProcessHandlers[pid] def detectLinuxBrokenPipeBehavior(): """ On some Linux version, write-only pipe are detected as readable. This function is here to check if this bug is present or not. See L{ProcessWriter.doRead} for a more detailed explanation. @return: C{True}...
<vulnerable_code>import gc import os import io import select import signal import stat import sys<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> import gc import os import io import signal import stat import sys
<vulnerable_code> class MulticastTests(unittest.TestCase): def setUp(self): self.server = Server() self.client = Client()<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> class MulticastTests(unittest.TestCase): if ( os.environ.get("INFR...
<vulnerable_code> Otherwise, an 'appropriate' interface is one for which its class has been registered as an adapter for my class according to the rules of getComponent. @return: the list of appropriate interfaces """ for iface in declarations.providedBy(component): ...
<vulnerable_code> del reapProcessHandlers[pid] class ProcessWriter(abstract.FileDescriptor): """ (Internal) Helper class to write into a Process's input pipe.<commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> del reapProcessHandlers[pid] class ProcessWr...
<vulnerable_code> from incremental import Version from twisted.python.deprecate import deprecatedModuleAttribute from collections import OrderedDict deprecatedModuleAttribute( Version("Twisted", 15, 5, 0), "Use collections.OrderedDict instead.", "twisted.python.compat", "OrderedDict") if _PY3: ...
<vulnerable_code> class OrderedDictTests(unittest.TestCase): """ Tests for L{twisted.python.compat.OrderedDict}. """ def test_deprecated(self): """ L{twisted.python.compat.OrderedDict} is deprecated. """ from twisted.python.compat import OrderedDict OrderedDict ...
<vulnerable_code>/* Generated by Cython 0.28.5 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) ...
<vulnerable_code> """ Pass the loseConnection through to the underlying channel. """ if self.channel: self.channel.loseConnection() <commit_title>[PATCH 01/33] make pems not convert and skip a test<commit_description><fixed_code> """ Pass the loseConnection th...
<vulnerable_code> @rtype: see L{ClientService.__init__}'s C{retryPolicy} argument. """ def policy(attempt): return min(initialDelay * (factor ** attempt), maxDelay) + jitter() return policy _defaultPolicy = backoffPolicy() <commit_title>[PATCH 01/33] make pems not convert and skip a test<commit...
<vulnerable_code> asyncio = None from twisted.application import service, internet, app, reactors from twisted.internet import interfaces, defer, protocol, reactor from twisted.persisted import sob from twisted.plugins import twisted_reactors self.assertRaises(SystemExit, options.opt_help_reactors) ...
<vulnerable_code> class BackoffPolicyTests(unittest.TestCase): """Tests of L{twisted.application.internet.backoffPolicy}""" def test_calculates_correct_values(self): """Test that backoffPolicy() calculates expected values""" pol = backoffPolicy(1.0, 60.0, 1.5, jitter=lambda: 1) self.ass...
<vulnerable_code> [b"t \ta \tb"], ) def test_tooManyHeaders(self): """ C{HTTPChannel} enforces a limit of C{HTTPChannel.maxHeaders} on the ] ) def test_duplicateContentLengthsWithPipelinedRequests(self): """ Two pipelined requests, the fir...
<vulnerable_code> self.setRawMode() elif line[0] in b" \t": # Continuation of a multi line header. self.__header = self.__header + b"\n" + line # Regular header line. # Processing of header line is delayed to allow accumulating multi # line headers....
<vulnerable_code> Line folded headers are handled by L{HTTPChannel} by replacing each fold with a single space by the time they are made available to the L{Request}. Any leading whitespace in the folded lines of the header value is preserved. See RFC 7230 section 3.2.4. "...
<vulnerable_code> return False header = header.lower() data = data.strip() if not self._maybeChooseTransferDecoder(header, data): return False<commit_title>[PATCH 01/13] Some tests for GHSA-c2jg-hw38-jrqq<commit_description><fixed_code> return False ...
<vulnerable_code> # Can this header determine the length? if header == b"content-length": try: length = int(data) except ValueError:<commit_title>[PATCH 01/13] Some tests for GHSA-c2jg-hw38-jrqq<commit_description><fixed_code> # Can this header determine ...
<vulnerable_code> p.dataReceived(b"3; x-foo=bar\r\nabc\r\n") self.assertEqual(L, [b"abc"]) def test_oversizedChunkSizeLine(self): """ L{_ChunkedTransferDecoder.dataReceived} raises http._MalformedChunkedDataError, p.dataReceived, b"-3\r\nabc\r\n" ) def test_m...
<vulnerable_code>import time import warnings from io import BytesIO from typing import AnyStr, Callable, Optional from urllib.parse import ( ParseResultBytes, unquote_to_bytes as unquote, return (networkString(f"{len(data):x}"), b"\r\n", data, b"\r\n") def fromChunk(data): """ Convert chunk to str...
<vulnerable_code> transport.value().splitlines(), [b": ".join([sanitizedBytes, sanitizedBytes])], )<commit_title>[PATCH 01/13] Some tests for GHSA-c2jg-hw38-jrqq<commit_description><fixed_code> transport.value().splitlines(), [b": ".join([saniti...
<vulnerable_code> """ Convert chunk to string. @type data: C{bytes} @return: tuple of (result, remaining) - both C{bytes}.<commit_title>[PATCH 01/13] Some tests for GHSA-c2jg-hw38-jrqq<commit_description><fixed_code> """ Convert chunk to string. Note that this function is not specification...
<vulnerable_code> except ValueError: raise _MalformedChunkedDataError("Chunk-size must be an integer.") if length < 0: raise _MalformedChunkedDataError("Chunk-size must not be negative.") elif length == 0: self.state = "TRAILER" else: self....
<vulnerable_code> and 0-9. """ for c in b: if c not in b'0123456789abcdefABCDEF': return False return bool(b) maxChunkSizeLineLength = 1024 class _ChunkedTransferDecoder: """ Protocol for decoding I{chunked} Transfer-Encoding, as defined by RFC 7230, except ValueErr...
<vulnerable_code> This is a potential request smuggling vector: see GHSA-c2jg-hw38-jrqq. """ for b in [*range(0, 0x09), *range(0x10, 0x21), *range(0x74, 0x80)]: data = b"3; " + bytes((b,)) + b"\r\nabc\r\n" p = http._ChunkedTransferDecoder( lambda b: None, ...
<vulnerable_code> for c in b: if c not in b"0123456789abcdefABCDEF": return False return bool(b) def _hexint(b: bytes) -> int: """ Characters that are valid in a chunk extension. See RFC 7230 section 4.1.1: chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) chunk-ex...
<vulnerable_code> # Send a mail notification body = self.app.templates.compile_template( "access_token_added.html", **{"header_name": self.app.cfg.header_name, 'user': userobj, 'name': name} ) self.bus.publish('queue_mail', to=userobj.email, subject=_("A new access token has ...
<vulnerable_code> self.listener.queue_email.assert_called_once_with( to='test@test.com', subject='Notification', message="<html>\n <head></head>\n <body>\n Hey admin,\n <p>\n You are receiving this email to notify you about your backups. The\n following repos...
<vulnerable_code> def __init__(self): self.compute_api = compute.API() def _affinity_host(self, context, instance_id): return self.compute_api.get(context, instance_id)['host'] class DifferentHostFilter(AffinityFilter): if isinstance(affinity_uuids, basestring): affinity_uu...
<vulnerable_code> neighbor1 = stl->neighbors_start[facet].neighbor[edge1]; neighbor2 = stl->neighbors_start[facet].neighbor[edge2]; if(neighbor1 == -1) { stl_update_connects_remove_1(stl, neighbor2); } if(neighbor2 == -1) { stl_update_connects_remove_1(stl, neighbor1); } neighbor3 = stl->neighbo...
<vulnerable_code> """ self.xmlstream.removeObserver('/failure', self.onFailure) ctx = ssl.CertificateOptions() self.xmlstream.transport.startTLS(ctx) self.xmlstream.reset() self.xmlstream.sendHeader()<commit_title>[PATCH] Use optionsForClientTLS to verify server certifica...
<vulnerable_code>from twisted.internet import defer, task from twisted.internet.error import ConnectionLost from twisted.internet.interfaces import IProtocolFactory from twisted.python import failure from twisted.python.compat import unicode from twisted.test import proto_helpers self.savedSSL = xmlstream.ssl ...
<vulnerable_code> 'certfile': os.path.join(CERTS_PATH, 'server.ipv6addr.crt'), 'keyfile': os.path.join(CERTS_PATH, 'server.ipv6addr.key'), } DEFAULT_CA = os.path.join(CERTS_PATH, 'cacert.pem') DEFAULT_CA_BAD = os.path.join(CERTS_PATH, 'client_bad.pem') NO_SAN_CA = os.path.join(CERTS_PATH, 'cacert.no_san.pem') DE...
<vulnerable_code> __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' __version__ = '1.24.1' __all__ = ( 'HTTPConnectionPool',<commit_title>[PATCH] Release 1.24.2 (#1564)<commit_description>* Don't load system certificates by default when any other ``ca_certs``, ``ca_certs_dir`` or ``ssl_co...
<vulnerable_code> except idna.core.IDNAError: return None name = idna_encode(name) if name is None: return None<commit_title>[PATCH] Release 1.24.2 (#1564)<commit_description>* Don't load system certificates by default when any other ``ca_certs``, ``ca_certs_dir`` or ``ssl_context`` ...
<vulnerable_code>from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValueError, MaxRetryError, ProxySchemeUnknown from .packages.six.moves.urllib.parse import urljoin from .request import RequestMethods from .util.url import par...
<vulnerable_code> self.raise_on_status = raise_on_status self.history = history or tuple() self.respect_retry_after_header = respect_retry_after_header self.remove_headers_on_redirect = remove_headers_on_redirect def new(self, **kw): params = dict(<commit_title>[PATCH] Releas...
<vulnerable_code> if e.errno == errno.ENOENT: raise SSLError(e) raise elif getattr(context, 'load_default_certs', None) is not None: # try to load OS default certs; works well on Windows (require Python3.4+) context.load_default_certs() <commit_title>[PATCH] Re...
<vulnerable_code> pass from ..with_dummyserver.test_https import TestHTTPS, TestHTTPS_TLSv1 # noqa: F401 from ..with_dummyserver.test_socketlevel import ( # noqa: F401 TestSNI, TestSocketClosing, TestClientCerts )<commit_title>[PATCH] Release 1.24.2 (#1564)<commit_description>* Don't load system certific...
<vulnerable_code> def test_retry_default_remove_headers_on_redirect(self): retry = Retry() assert list(retry.remove_headers_on_redirect) == ['Authorization'] def test_retry_set_remove_headers_on_redirect(self): retry = Retry(remove_headers_on_redirect=['X-API-Secret']) assert l...
<vulnerable_code> assert context.set_ciphers.call_count == 1 assert context.set_ciphers.call_args == mock.call(expected_ciphers)<commit_title>[PATCH] Release 1.24.2 (#1564)<commit_description>* Don't load system certificates by default when any other ``ca_certs``, ``ca_certs_dir`` or ``ssl_context`` parameters ...
<vulnerable_code> DEFAULT_CLIENT_NO_INTERMEDIATE_CERTS, NO_SAN_CERTS, NO_SAN_CA, DEFAULT_CA_DIR, IPV6_ADDR_CERTS, IPV6_ADDR_CA, HAS_IPV6, IP_SAN_CERTS) from test import ( onlyPy279OrNewer,...
<vulnerable_code> self.assertNotIn('Authorization', data) def test_redirect_cross_host_no_remove_headers(self): http = PoolManager() self.addCleanup(http.clear) self.assertNotIn('X-API-Secret', data) self.assertEqual(data['Authorization'], 'bar') def test_raise_on_redir...
<vulnerable_code> p=GetCoderInfo(module,exception); if (p != (CoderInfo *) NULL) (void) CopyMagickString(module_name,p->name,MagickPathExtent); rights=ReadPolicyRights; if (IsRightsAuthorized(ModulePolicyDomain,rights,module_name) == MagickFalse) { errno=EPERM; { if (MagickModules[i].register...
<vulnerable_code> layers=AcquireStringInfo(profile.quantum); if (layers == (StringInfo *) NULL) { clone_info=DestroyImageInfo(clone_info); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); custom_stream=TIFFAcquireCustomStreamForWriting(&profile,exception);...
<vulnerable_code>"use strict"; function checkErr(fetch_result) { if (fetch_result instanceof Error) {<commit_title>[PATCH] feat: Converting to number type if parameter is number type<commit_description><fixed_code> 'use strict'; function checkErr(fetch_result) { if (fetch_result instanceof Error) {
<vulnerable_code> var idx = Object.keys(typeMap).indexOf(keyInfo.type); if (idx >= 0) { if (isNaN(val)) { err = new Error('The parameter value is not a number : ' + key); err.code = 400; //required = ['id', 'number:req_id:path'], optional = ['order', 'number:count:10'] function fetchParam...
<vulnerable_code> // folded header content // RFC2822 says to just remove the CRLF and not the whitespace following // it, so we follow the RFC and include the leading whitespace ... this.header[h][this.header[h].length - 1] += lines[i]; } else { m = RE_HDR.exec(lines[i]); if (m) ...
<vulnerable_code> side=side, out_type=dtype), array_ops.zeros([2, 0], dtype)) def testInt64(self): @def_function.function<commit_title>[PATCH] Fix empty inputs for Upper/LowerBound.<commit_description>For upper/lower-bound searches via `tf.searchsorted`, if the sorted input is emp...
<vulnerable_code> unsigned char hex[16]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; if (LocaleNCompare((char *) profile_type+1, "ng-chunk-",9) == 0) return; if (image_info->verbose) {<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/1561<commit_desc...
<vulnerable_code>#include "logger.h" #include <QDateTime> Logger* Logger::m_instance = 0; { QWriteLocker locker(&lock); Log::Msg temp = { msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, message }; m_messages.push_back(temp); if (m_messages.size() >= MAX_LOG_MESSAGES) { QWriteLocker loc...
<vulnerable_code> return (diff == 0); }<commit_title>[PATCH] Add Utils::String::toHtmlEscaped<commit_description><fixed_code> return (diff == 0); } QString Utils::String::toHtmlEscaped(const QString &str) { #ifdef QBT_USES_QT5 return str.toHtmlEscaped(); #else return Qt::escape(str); #endif }
<vulnerable_code> m_listModel->setData(m_listModel->index(row, PeerListDelegate::CONNECTION), peer.connectionType()); m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), peer.flags()); m_listModel->setData(m_listModel->index(row, PeerListDelegate::FLAGS), peer.flagsDescription(), Qt::ToolT...
<vulnerable_code> label_total_size_val->setText(Utils::Misc::friendlyUnit(m_torrent->totalSize())); // Comment comment_text->setText(Utils::Misc::parseHtmlLinks(m_torrent->comment())); // URL seeds loadUrlSeeds(); label_created_by_val->setText(m_torrent->creator()); ...
<vulnerable_code> import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.StringWriter; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.OutputKeys; import javax.xml...
<vulnerable_code> loff_t *ppos) { struct usb_yurex *dev; int retval = 0; int bytes_read = 0; char in_buffer[20]; unsigned long flags; mutex_lock(&dev->io_mutex); if (!dev->interface) { /* already disconnected */ retval = -ENODEV; goto exit; } spin_lock_irqsave(&dev->lock, flags); bytes_read = snpr...
<vulnerable_code> }); } else { Object.keys(obj).forEach(key => { src = target[key]; val = obj[key]; if (val === target) { return target; } module.exports = override;<commit_title>[PATCH] Security fix for Prototype Pollution<commit_description><fixed_code> }); } else {...
<vulnerable_code>#include <stdlib.h> #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bswapdsp.h" #include "bytestream.h" static av_cold int decode_init(AVCodecContext *avctx) { UtvideoContext * const c = avctx->priv_data; c->avctx = avctx; return AVERROR_INVALIDDATA; } ret...
<vulnerable_code> bool CBlock::CheckBlock() const { // These are checks that are independent of context // that can be verified before saving an orphan block. if (vtx.empty() || vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) return DoS(100...
<vulnerable_code> } filterTags(searchValue) { if (this.tags) { this.tags.forEach((tag) => (tag.Name = _.escape(tag.Name))); } let filteredTags = _.filter(this.tags, (tag) => !_.includes(this.model, tag.Id)); if (!searchValue) { return filteredTags;<commit_title>[PATCH] change model<comm...
<vulnerable_code>export function TagViewModel(data) { this.Id = data.ID; this.Name = data.Name; }<commit_title>[PATCH] change model<commit_description><fixed_code> import _ from 'lodash-es'; export function TagViewModel(data) { this.Id = data.ID; this.Name = _.escape(data.Name); }
<vulnerable_code>export function TeamViewModel(data) { this.Id = data.Id; this.Name = data.Name; this.Checked = false; }<commit_title>[PATCH] change model<commit_description><fixed_code> import _ from 'lodash-es'; export function TeamViewModel(data) { this.Id = data.Id; this.Name = _.escape(data.Name); thi...
<vulnerable_code> * <a href="https://tools.ietf.org/html/rfc7540">rfc7540</a>. {@code false} to not validate header names. * @param arraySizeHint A hint as to how large the hash data structure should be. * The next positive power of two will be used. An upper bound may be enforced. */ @SuppressWa...
<vulnerable_code> assert.ok( !elem.hasClass( "awesome" ), "SVG element (" + this + ") toggles the class off" ); } ); } );<commit_title>[PATCH] Attributes: Avoid infinite recursion on non-lowercase<commit_description><fixed_code> assert.ok( !elem.hasClass( "awesome" ), "SVG element (" + this + ") toggles the class o...