text stringlengths 79 3.72M |
|---|
<vulnerable_code>from unittest import mock
from asyncio import tasks
from test.test_asyncio import utils as test_utils
MOCK_ANY = mock.ANY
class CEagerTaskFactoryLoopTests(EagerTaskFactoryLoopTests, test_utils.TestCase):
Task = getattr(tasks, '_CTask', None)
class AsyncTaskCounter:
def __init__(self, loop, ... |
<vulnerable_code> return NULL;
}
prev_task = _PyDict_GetItem_KnownHash(state->current_tasks, loop, hash);
if (prev_task == NULL) {
if (PyErr_Occurred()) {
return NULL;
if (task == Py_None) {
if (_PyDict_DelItem_KnownHash(state->current_tasks, loop, hash) == -1) {
... |
<vulnerable_code> "SEMGREP_APP_TOKEN": "dummy",
"SEMGREP_REPO_URL": REMOTE_REPO_URL,
},
{ # Same as above, but with a repo URL that has a dot in the name.
# This used to cause the URL parser to crash.
"SEMGREP_APP_TOKEN": "dummy",
"SEMGREP_REPO... |
<vulnerable_code><commit_title>[PATCH] tests: add tests for git url parsing<commit_description><fixed_code>
from semgrep.meta import get_url_from_sstp_url
def test_git_url_parser():
tests = [
# This used to cause the URL parser to crash.
(
"https://test@dev.azure.com/test/TestName/_git... |
<vulnerable_code>
// Perform the actual connection to the XMPP service
connectInternal();
return this;
}
<commit_title>[PATCH] Move TLS Required check at the end of connect()<commit_description>It was a *very* bad idea to perform the SecurityMode.Required check in
the connection's reader thr... |
<vulnerable_code>import org.jivesoftware.smack.SmackException.AlreadyLoggedInException;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.SmackException.ConnectionException;
import org.jivesoftware.smack.Sm... |
<vulnerable_code> if last_name is not None and bname < last_name:
raise ValueError("Fields not lexically sorted")
value, exts_opts = _get_sshstr(exts_opts)
result[bname] = bytes(value)
last_name = bname
return result
fcrit = _FragList()
for name, value in s... |
<vulnerable_code> # secp256r1 public key, ed25519 signing key
cert = load_ssh_public_identity(
b"ecdsa-sha2-nistp256-cert-v01@openssh.com AAAAKGVjZHNhLXNoYTItbm"
b"lzdHAyNTYtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgtdU+dl9vD4xPi8afxERYo"
b"s0c0d9/3m7XGY6fGeSkqn0AAAAIbmlzdHAyNTY... |
<vulnerable_code> * print selected parts of score list.
* argc >= 2, with argv[0] untrustworthy (directory names, et al.),
* and argv[1] starting with "-s".
*/
void
prscore(argc, argv)<commit_title>[PATCH] command line triggered buffer overruns<commit_description>Prevent extremely long command line arguments from ov... |
<vulnerable_code>choose_windows(s)
const char *s;
{
register int i;
for (i = 0; winchoices[i].procs; i++) {
if ('+' == winchoices[i].procs->name[0])
windowprocs.win_wait_synch = def_wait_synch;
if (!winchoices[0].procs) {
raw_printf("No window types?");
nh_terminate(EXIT_FA... |
<vulnerable_code> return 0;
}
static void
process_options(argc, argv)
int argc;
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
} else {
raw_printf("Unknown option: %s", *argv);
}
break;
case 'X':
dis... |
<vulnerable_code> }
/**
* Return JAXP document builder instance.
*/
protected DocumentBuilder getDocumentBuilder(
) throws ServiceException {
DocumentBuilder documentBuilder = null;
DocumentBuilderFactory documentBuilderFactory = null;
try {
documentBuilderF... |
<vulnerable_code>static int archive_read_format_iso9660_read_data_skip(struct archive_read *);
static int archive_read_format_iso9660_read_header(struct archive_read *,
struct archive_entry *);
static const char *build_pathname(struct archive_string *, struct file_info *);
static int build_pathname_utf16be(unsign... |
<vulnerable_code> S_[sizeof (S_) - 1] = 0;
len = strlen (S_);
/* chop */
if (S_[len - 1] == '\n')
{
len--;
S_[len] = '\0';<commit_title>[PATCH] Fix the stack buffer overflow issue<commit_description>strlen() could returns 0. Without a conditional check for len,
accessing S_ pointer with le... |
<vulnerable_code>import re
from datetime import datetime
from flask import Flask, make_response, redirect, render_template, request
import bbcrypto
content = request.form["content"]
boardID = request.form["boardID"]
# urls is a regex that finds all URLs and their pages. e.g youtube.com/page/page2 is one ... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.io.IOException;
import java.io.OutputStream;
import org.infinispan.rest.embedded.netty4.i18n.Messages;
import io.netty.buffer.B... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import java.io.IOException;
import java.io.OutputStream;
import javax.ws.rs... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.net.ssl.SSLContex... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.io.IOException;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.ContainerResponseFilter;
impo... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.security.Principal;
import javax.ws.rs.core.SecurityContext;
import org.jboss.resteasy.plugins.server.embedded.SecurityDomain;
... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.c... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.io.IOException;
import javax.ws.rs.core.SecurityContext;
import org.infinispan.rest.embedded.netty4.security.Authenticator;
imp... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import static io.netty.handler.codec.http.HttpResponseStatus.CONTINUE;
import static io.netty.handler.codec.http.HttpResponseStatus.REQUEST_E... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import static io.netty.handler.codec.http.HttpHeaders.is100ContinueExpected;
import java.util.List;
import org.infinispan.rest.embedded.net... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.util.List;
import java.util.Map;
import javax.ws.rs.ext.RuntimeDelegate;
import org.jboss.resteasy.spi.ResteasyProviderFactory;... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.security.AccessController;
import java.security.PrivilegedAction;
import org.infinispan.manager.EmbeddedCacheManager;
import org... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4;
import java.util.Arrays;
import javax.net.ssl.SSLContext;
import io.netty.handler.ssl.ClientAuth;
import io.netty.handler.ssl.IdentityCiphe... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4.i18n;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
/**
* @auth... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4.i18n;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
/**
* @author <a href="ron.sigal@jbo... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4.security;
import java.io.IOException;
import javax.ws.rs.core.SecurityContext;
import org.jboss.resteasy.spi.HttpRequest;
import org.jboss.r... |
<vulnerable_code><commit_title>[PATCH] Temporary fork of the RESTEasy Netty integration to allow for<commit_description><fixed_code>
package org.infinispan.rest.embedded.netty4.security;
import java.io.IOException;
import java.security.Principal;
import java.util.Base64;
import java.util.List;
import javax.ws.rs.core... |
<vulnerable_code>
if (subsecTag) {
ExifData::iterator subsec_pos = exifData_->findKey(ExifKey(subsecTag));
if ( subsec_pos != exifData_->end()
&& subsec_pos->typeId() == asciiString) {
std::string ss = subsec_pos->toString();
if (!ss.empt... |
<vulnerable_code> if (ed2 != edEnd) size += ed2->size();
if (size != 0) {
DataBuf buf(size);
if (ed1 != edEnd) ed1->copy(buf.pData_, pHead->byteOrder());
if (ed2 != edEnd) ed2->copy(buf.pData_ + ed1->size(), pHead->byteOrder());
pHead->add(pCrwMapping->crwT... |
<vulnerable_code> ExifKey exifKey(key);
iterator pos = findKey(exifKey);
if (pos == end()) {
add(Exifdatum(exifKey));
pos = findKey(exifKey);
}
return *pos;
}<commit_title>[PATCH] Check that findKey didn't return end().<commit_description><fixed_code>
... |
<vulnerable_code> IptcKey iptcKey(key);
iterator pos = findKey(iptcKey);
if (pos == end()) {
add(Iptcdatum(iptcKey));
pos = findKey(iptcKey);
}
return *pos;
}<commit_title>[PATCH] Check that findKey didn't return end().<commit_description><fixed_code>
... |
<vulnerable_code> XmpKey xmpKey(key);
iterator pos = findKey(xmpKey);
if (pos == end()) {
add(Xmpdatum(xmpKey));
pos = findKey(xmpKey);
}
return *pos;
}<commit_title>[PATCH] Check that findKey didn't return end().<commit_description><fixed_code>
... |
<vulnerable_code>import org.apache.commons.compress.compressors.CompressorStreamFactory;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import com.github.junrar.Archive;
import com.github.junrar.exception.RarException;
public class Explode
extends Action_ImplBase
{
@Override
... |
<vulnerable_code>var htmlparser = require("htmlparser2")
function html2ooxml(html, style = '') {
if (!html.match(/^<.+>/))
html = `<p>${html}</p>`
var doc = new docx.Document();<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fix... |
<vulnerable_code>// For each finding, add cvssColor, cvssObj and criteria colors parameters
function cvssHandle(data) {
// Header title colors
var lowColor = "008000"; //green
var mediumColor = "f9a009"; //yellow
var highColor = "fe0000"; //red
var criticalColor = "212121"; //black
var cellLowC... |
<vulnerable_code> currentHost: null,
// Datatable headers for displaying host
dtHostHeaders: [
{name: 'port', label: 'Port', field: 'port', align: 'left', sortable: true},
{name: 'protocol', label: 'Protocol', field: 'protocol', align: 'left', sortable:... |
<vulnerable_code> }
else if (this.selectedTab === 'details' && !this.detailsTabVisited){
Utils.syncEditors(this.$refs)
this.findingOrig.remediation = this.finding.poc
this.detailsTabVisited = true
}
},<commit_title>[PATCH 01/14] ... |
<vulnerable_code> var cRunProperties = {}
var cParagraphProperties = {}
var list_state = []
var parser = new htmlparser.Parser(
{
onopentag(tag, attribs) {
cParagraph = new docx.Paragraph(cParagraphProperties)
}
else if (tag === "pre") {
... |
<vulnerable_code>var jwtSecret = "ASy4FVjsXNLQl09LbieroWsjO5UXjvX5";
exports.jwtSecret = jwtSecret;
class ACL {
constructor(roles) {
if(typeof roles !== 'object') {
this.roles = roles
}
isAdmin(role, permission) {
return (this.roles[role].admin &&
(this.roles[role].adm... |
<vulnerable_code> query.exec()
.then((row) => {
if (!row)
throw({fn: 'NotFound', message: 'Audit not found'})
resolve(row)
})
return query.exec()
.then((row) => {
if (!row)
throw({fn: 'NotFound', m... |
<vulnerable_code>var jwt = require('jsonwebtoken');
var auth = require('../lib/auth.js');
var auditSchema = require('./audit.js').schema;
var UserSchema = new Schema({
username: {type: String, unique: true, required: true},
password: {type: String, required: true},
firstname: {type: Strin... |
<vulnerable_code> app.get("/api/audits", acl.hasPermission('audits:read'), function(req, res) {
var filters = {};
if (req.query.findingTitle) filters['findings.title'] = new RegExp(req.query.findingTitle, 'i')
Audit.getAudits(acl.isAdmin(req.decodedToken.role, 'audits:read'), req.decodedT... |
<vulnerable_code>
var _ = require('lodash')
/* ===== LANGUAGES ===== */
// Get languages list<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
var _ = require('lodash')
/* ===== ROLES ===== */
// Get Roles list
... |
<vulnerable_code> var utils = require('../lib/utils')
// Check token validity
app.get("/api/users/checktoken", acl.hasPermission('users:read'), function(req, res) {
Response.Ok(res, 'Valid token');
});
});
// Get user self
app.get("/api/users/me", acl.hasPermission('users:read'), f... |
<vulnerable_code> });
// Delete all vulnerabilities
app.delete("/api/vulnerabilities", acl.hasPermission('vulnerabilities:delete'), function(req, res) {
Vulnerability.deleteAll()
.then(msg => Response.Ok(res, msg))
.catch(err => Response.Internal(res, err))
});
// Create or ... |
<vulnerable_code>
import CollabService from '@/services/collaborator'
import UserService from '@/services/user'
export default {
data: () => {
role: ''
},
// Username to identify collab to update
idUpdate: ''
}
},
mounted: function() {
th... |
<vulnerable_code>
import DataService from '@/services/data'
import Utils from '@/services/utils'
export default {
data: () => {
return {
languages: [],
newLanguage: {locale: "", language: ""},
editLanguages: [],
.catch((err) => {
conso... |
<vulnerable_code> this.downloadVulnerabilities();
})
.catch((err) => {
console.log(err)
})
},
<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
... |
<vulnerable_code> })
.catch((err) => {
console.log(err)
})
},
this.setCurrentDetails();
this.vulnerabilityId = row._id;
this.getVulnUpdates(this.vulnerabilityId);
},
editChangeCategory: function... |
<vulnerable_code> {path: 'clients', component: () => import('pages/datas/clients')},
{path: 'templates', component: () => import('pages/datas/templates')},
{path: 'dump', component: () => import('pages/datas/dump')},
{path: 'custom', component: () => import('pages/datas/custom'), beforeEnter(t... |
<vulnerable_code>import Vue from 'vue'
export default {
getLanguages: function() {
return Vue.prototype.$axios.get(`data/languages`)
},<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
import Vue from 'vue'
export def... |
<vulnerable_code> return (this.user !== null);
},
isAdmin() {
return (this.user && this.user.role && this.user.role === "admin");
},
getProfile: function() {<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_c... |
<vulnerable_code> }
}
var customRoles = require('./roles.json')
var roles = {...customRoles, ...builtInRoles}
class ACL {<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
}
}
try {
var customRoles = require('./roles.json'... |
<vulnerable_code> if (number <= 99) { number = ("00" + number).slice(-3); }
return `${number}`;
}
exports.lPad = lPad;<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
if (number <= 99) { number = ("00" + number).slice(-3); ... |
<vulnerable_code> var acl = require('../lib/auth').acl;
var reportGenerator = require('../lib/report-generator');
var _ = require('lodash');
/* ### AUDITS LIST ### */
// Get audits list of user (all for admin) with regex filter on findings
app.get("/api/audits", acl.hasPermission('audits:read')... |
<vulnerable_code> findingTitle: '',
// List of vulnerabilities from knowledge base
vulnerabilities: [],
// Headers for vulnerabilities datatable
dtVulnHeaders: [
{name: 'title', label: 'Title', field: row => row.detail.title, align: 'left', sort... |
<vulnerable_code>import DataService from '@/services/data'
import TemplateService from '@/services/template'
import CompanyService from '@/services/company'
export default {
data: () => {
return {
// Audits list
audits: [],
// Templates list
templates: [],
... |
<vulnerable_code>
import ClientService from '@/services/client'
import CompanyService from '@/services/company'
export default {
data: () => {
return {
// clients list
clients: [],
// Companies list
companies: [],
// Datatable headers
... |
<vulnerable_code>import CollabService from '@/services/collaborator'
import UserService from '@/services/user'
import DataService from '@/services/data'
export default {
data: () => {
UserService: UserService,
// Collaborators list
collabs: [],
// Datatable headers
... |
<vulnerable_code>import Vue from 'vue'
import CompanyService from '@/services/company'
export default {
data: () => {
return {
// Companies list
companies: [],
// Datatable headers
dtHeaders: [
{name: 'name', label: 'Name', field: 'name', ali... |
<vulnerable_code>
import TemplateService from '@/services/template'
import UserService from '@/services/user'
export default {
data: () => {
UserService: UserService,
// Templates list
templates: [],
// Datatable headers
dtHeaders: [
{name... |
<vulnerable_code> UserService: UserService,
// Vulnerabilities list
vulnerabilities: [],
// Datatable headers
dtHeaders: [
{name: 'title', label: 'Title', field: 'title', align: 'left', sortable: true},
// Datatable pagination
... |
<vulnerable_code>export default {
htmlEncode(html) {
if(typeof(html) !== "string") return "";
resolve(result)
}
})
}
}<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
var _ = require('lodash')
export defa... |
<vulnerable_code> }
}
// Convert identifier prefix to a user defined prefix: {identifier | changeID: 'PRJ-'}
expressions.filters.changeID = function (input, prefix) {
return input.replace("IDX-", prefix);
}
exports.expressions = expressions
<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_desc... |
<vulnerable_code> }
}
// Replace newlines in office XML format: {@input | NewLines}
expressions.filters.NewLines = function(input) {
var pre = '<w:p><w:r><w:t>';<commit_title>[PATCH 01/14] Update HTML to OOXML converter<commit_description>Remove empty paragraph when there is no text<fixed_code>
}
}
// Conv... |
<vulnerable_code> mrb_field_write_barrier(mrb, (struct RBasic*)p, (struct RBasic*)p->c);
clone = mrb_obj_value(p);
init_copy(mrb, clone, self);
p->flags = mrb_obj_ptr(self)->flags;
return clone;
}<commit_title>[PATCH] Allow `Object#clone` to copy frozen status only; fix #4036<commit_description>Copying all fl... |
<vulnerable_code> /* we may have an enterprise name here */
char strbuf[len + 1];
char *buf = strbuf;
bool domain_handled = false;
/* copy buf to manipulate it */
memcpy(buf, str, len);
}
if (sep) {
/* leading domain, copy if domain name is no... |
<vulnerable_code>{
char obj_txt[128];
int len = OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
BIO_write(bio, obj_txt, len);
BIO_write(bio, "\n", 1);
return 1;
}<commit_title>[PATCH] Fix OOB read in TS_OBJ_print_bio().<commit_description>TS_OBJ_print_bio() misuses OBJ_txt2obj: it should print the ... |
<vulnerable_code>
@staticmethod
def _get_explanation_html(explanation: str) -> str:
return ('<span><div class="detailed-solution"><p>Explanation</p><p>{explanation}</p></div></span>')\
.format(explanation=explanation)
@ddt.data(
(1, "This is an explanation.", True, "Explanation\... |
<vulnerable_code>
class Field:
def __init__(self, data):
self.datatype = data.get("DataType", "")
self.name = data.get("Name")
self.dname = data.get("DisplayName", "")
self.optional = bool(data.get("IsOptional", False))<commit_title>[PATCH 01/11] xmlimport change datatype field defau... |
<vulnerable_code> use UaClient object, available as self.uaclient
which offers the raw OPC-UA services interface.
"""
_username = None
_password = None
def __init__(self, url: str, timeout: float = 4):
"""
:param url: url of the server.
if you are unsure of url, writ... |
<vulnerable_code>"""
import asyncio
import logging
from typing import Dict, List, Optional, Union
from asyncua import ua
from ..ua.ua_binary import struct_from_binary, uatcp_to_binary, struct_to_binary, nodeid_from_binary, header_from_binary
OPEN = 'open'
CLOSED = 'closed'
def __init__(self, timeout: floa... |
<vulnerable_code># coding: utf-8
import pytest
from asyncua import Client
from asyncua.ua.uaerrors import BadMaxConnectionsReached
from .conftest import port_num
pytestmark = pytest.mark.asyncio
await c.disconnect()
# second disconnect should be noop
await c.disconnect()<commit_title>[PATCH 01/11] xmlim... |
<vulnerable_code> use UaClient object, available as self.uaclient
which offers the raw OPC-UA services interface.
"""
def __init__(self, url: str, timeout: float = 4, watchdog_intervall: float = 10):
"""
:param url: url of the server.
if you are unsure of url, write at least h... |
<vulnerable_code> if self._monitor_server_task is not None:
if self._monitor_server_task.done():
await self._monitor_server_task
async def _monitor_server_loop(self):
"""<commit_title>[PATCH 01/11] xmlimport change datatype field default<commit_description>The default Dat... |
<vulnerable_code> """
Close session
"""
if self._watch_task:
self._watch_task.cancel()
try:
await self._watch_task
except Exception:
_logger.exception("Error while closing watch_task")
if self._renew_channel_task:... |
<vulnerable_code> async with Client(f'opc.tcp://127.0.0.1:{port}', timeout=0.5, watchdog_intervall=1) as cl:
await srv.stop()
await asyncio.sleep(2)
with pytest.raises(ConnectionError):
await cl.get_namespace_array()<commit_title>[PATCH 01/11] xmlimport change datatype field defau... |
<vulnerable_code> self.secure_channel_timeout = 3600000 # 1 hour
self.session_timeout = 3600000 # 1 hour
self._policy_ids = []
self.uaclient: UaClient = UaClient(timeout, self.check_connection)
self.user_certificate = None
self.user_private_key = None
self._serve... |
<vulnerable_code> OPEN = 'open'
CLOSED = 'closed'
def __init__(self, timeout: float = 1, security_policy: ua.SecurityPolicy = ua.SecurityPolicy(), before_request_hook: Callable[[], Awaitable[None]] = None):
"""
:param timeout: Timeout in seconds
:param security_policy: Security polic... |
<vulnerable_code> return response
async def check_connection(self):
# Check if a background task has finished and if a exception is thrown rethrow it with result
if self._renew_channel_task is not None:
if self._renew_channel_task.done():
await self._renew_channel... |
<vulnerable_code> use UaClient object, available as self.uaclient
which offers the raw OPC-UA services interface.
"""
def __init__(self, url: str, timeout: float = 4, watchdog_intervall: float = 1.0):
"""
:param url: url of the server.<commit_title>[PATCH 01/11] xmlimport change datatype ... |
<vulnerable_code> for nodedata in nodes_parsed: # self.parser:
try:
node = await self._add_node_data(nodedata, no_namespace_migration=True)
except Exception as e:
_logger.warning("failure adding node %s %s", nodedata, e)
if self.strict_mode... |
<vulnerable_code> assert await clt.get_objects_node().get_children()
async def test_secure_channel_key_expiration(srv_crypto_one_cert, mocker):
timeout = 1
_, cert = srv_crypto_one_cert<commit_title>[PATCH 01/11] xmlimport change datatype field default<commit_description>The default DataType of a s... |
<vulnerable_code> delay: 0,
appendTo: () => document.body,
trigger: "click",
allowHTML: true,
interactive: true,
hideOnClick: true,
/* The light-border TippyJS theme is a bit of a misnomer; it
delegate("body", {
...default_popover_props,
target: "#streams_inline_icon",
... |
<vulnerable_code>import $ from "jquery";
import render_recent_topic_row from "../templates/recent_topic_row.hbs";
import render_recent_topics_filters from "../templates/recent_topics_filters.hbs";
),
);
}
const other_sender_names = displayed_other_names.join("<br/>");
return {
... |
<vulnerable_code> text: rendered_time.text,
});
$(this).html(rendered_timestamp);
$(this).attr("data-tippy-content", rendered_time.tooltip_content);
} else {
// This shouldn't happen. If it does, we're very interested in debugging it.
bl... |
<vulnerable_code> appendTo: "parent",
// html content is not supported by default
// enable it by passing data-tippy-allowHtml="true"
// in the tag or a parameter.
});
".rendered_markdown .copy_codeblock",
"#compose_top_right [data-tippy-content]",
],
allowHTML: ... |
<vulnerable_code> embedded: $("#compose").attr("data-embedded") === "",
file_upload_enabled: page_params.max_file_upload_size_mib > 0,
giphy_enabled: giphy.is_giphy_enabled(),
scroll_to_bottom_key: common.has_mac_keyboard()
? "Fn + <span class='tooltip_righ... |
<vulnerable_code> return winston.warn('[socket.io] Empty payload');
}
const eventName = payload.data[0];
const params = typeof payload.data[1] === 'function' ? {} : payload.data[1];
const callback = typeof payload.data[payload.data.length - 1] === 'function' ? payload.data[payload.data.length - 1] : function () {... |
<vulnerable_code> StringView valueAsStringPrintable =
StringPrimitive::createStringView(runtime, valueAsString);
SmallU16String<32> tmp;
return runtime->raiseTypeError(
TwineChar16("Cannot create property '") + propName + "' on " +
baseTypeAsString.getUTF16Ref(tmp) + " '" +
valueAsStringPr... |
<vulnerable_code>
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
!defined(HAVE_LIBRESSL)
crls = X509_STORE_CTX_get1_crls(store_ctx, subject);
#elif OPENSSL_VERSION_NUMBER >= 0x10000000L && \
!defined(HAVE_LIBRESSL)
crls = X509_STORE_get1_crls(store_ctx, subject);
#else
/* Your OpenSSL is before 1.0.0. ... |
<vulnerable_code>#include <libmalcontent/malcontent.h>
#endif
#ifdef ENABLE_SECCOMP
#include <seccomp.h>
#endif<commit_title>[PATCH] common: Add a list of recently-added Linux syscalls<commit_description>Historically, syscalls could take arbitrarily-different values on
different architectures, but new syscalls are add... |
<vulnerable_code> if (service != null) {
if (service.getDeploymentConfiguration().isProductionMode()) {
LicenseChecker.checkLicenseFromStaticBlock(
"vaadin-spreadhseet-flow", version);
}
}
}<commit_title>[PATCH 1/5] chore: fix typo (#312... |
<vulnerable_code>import com.vaadin.flow.component.ClientCallable;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.DetachEvent;
import com.vaadin.flow.component.HasHelper;
import com.vaadin.flow.component.HasLabel;
import com.vaadin.flow.component.HasSize;
HasDataView<T,... |
<vulnerable_code> placeholder == null ? "" : placeholder);
}
/**
* <p>
* Description copied from corresponding location in WebComponent:
* </p>
* <p>
* Set to true to display the clear icon which clears the input.
* <p>
* This property is not synchronized autom... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.