text stringlengths 79 3.72M |
|---|
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", mount_state_to_string(m->state));
unit_serialize_item(u, f, "resul... |
<vulnerable_code>#include "macro.h"
#include "mkdir.h"
#include "path.h"
#include "special.h"
#include "stat-util.h"
#include "string-table.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", path_state_to_string(p->state));
unit_serialize_item(u, f, "result", path_result_to_s... |
<vulnerable_code>#include "load-dropin.h"
#include "log.h"
#include "scope.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", scope_state_to_string(s->state));
unit_serialize_item(u, f, "was-abandoned", y... |
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "service.h"
#include "signal-util.h"
#include "special.h"
}
static int service_serialize_exec_command(Unit *u, FILE *f, ExecCommand *command) {
Service *s = SERVICE(u);
ServiceExecCommand id;
unsi... |
<vulnerable_code>#include "alloc-util.h"
#include "dbus-slice.h"
#include "log.h"
#include "slice.h"
#include "special.h"
#include "string-util.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", slice_state_to_string(s->state));
return 0;
}
<commit_title>[PATCH] core: rework ... |
<vulnerable_code>#include "path-util.h"
#include "process-util.h"
#include "selinux-util.h"
#include "signal-util.h"
#include "smack-util.h"
#include "socket.h"
#include "socket-protocol-list.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
assert(f);
assert(fds);
unit... |
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", swap_state_to_string(s->state));
unit_serialize_item(u, f, "result... |
<vulnerable_code>
#include "dbus-target.h"
#include "log.h"
#include "special.h"
#include "string-util.h"
#include "unit-name.h"
#include "unit.h"
#include "target.h"
static const UnitActiveState state_translation_table[_TARGET_STATE_MAX] = {
[TARGET_DEAD] = UNIT_INACTIVE,
assert(f);
assert(fds... |
<vulnerable_code>#include "fs-util.h"
#include "parse-util.h"
#include "random-util.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", timer_state_to_string(t->state));
unit_serialize_item(u, f, "result",... |
<vulnerable_code>#include "sd-id128.h"
#include "sd-messages.h"
#include "alloc-util.h"
#include "all-units.h"
#include "bus-common-errors.h"
#include "bus-util.h"
#include "cgroup-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "set.h"
#include "signal-util.h"
#include "spars... |
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "string-table.h"
#include "strv.h"
#include "terminal-util.h"
}
if (realtime)
timestamp_deserialize(realtime, &s->timestamp.realtime);
if (monotonic)
timestamp_dese... |
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "rm-rf.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
}
if (realtime)
(void) timestamp_deserialize(realtime, &u->timestamp.realtime);
if (monotonic)
(void) timesta... |
<vulnerable_code>#include "mkdir.h"
#include "parse-util.h"
#include "process-util.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
}
if (realtime)
timestamp_deserialize(realtime, &m->timestamp.realtime);
if (monotonic)
timestamp_deserial... |
<vulnerable_code><commit_title>[PATCH] core: rework serialization<commit_description><fixed_code>
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "alloc-util.h"
#include "def.h"
#include "env-util.h"
#include "escape.h"
#include "parse-util.h"
#include "serialize.h"
#include "strv.h"
int serialize_item(FILE *f, con... |
<vulnerable_code>
#include <string.h>
#include "env-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
}
static void test_deserialize_environment(void) {
_cleanup_strv_free_ char **env = strv_new("A=1", NULL);
assert_se(deserialize_environmen... |
<vulnerable_code>/* SPDX-License-Identifier: LGPL-2.1+ */
#include "random-util.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
test_format_timestamp_utc_one(USEC_INFINITY, NULL);
}
static void test_dual_timestamp_deserialize(void) {
int r;
dual_timestamp t;
log_i... |
<vulnerable_code> /* Payload marker 0xFF, currently only checking for 0xF* because rest is reserved */
if ((current_option[0] & 0xF0)==0xF0)
{
coap_pkt->payload = ++current_option;
coap_pkt->payload_len = data_end - coap_pkt->payload;
<commit_title>[PATCH] coap: Detect payload marker without actu... |
<vulnerable_code>package io.hawt.web.plugin.karaf.terminal;
import io.hawt.system.Helpers;
import org.apache.felix.service.command.CommandProcessor;
import org.apache.felix.service.command.CommandSession;
import org.apache.felix.service.threadio.ThreadIO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
impor... |
<vulnerable_code>
gogo = { };
gogo.Terminal_ctor = function(div, width, height, authHeader) {
var query0 = "w=" + width + "&h=" + height;
var query1 = query0 + "&k=";
force = 0;
}
r.open("POST", "hawtio-karaf-terminal/term", true);
r.setRequestHeader('Authorizatio... |
<vulnerable_code> restrict: 'A',
link: function(scope, element, attrs) {
var width = 120;
var height = 39;
var authHeader = Core.getBasicAuthHeader(userDetails.username, userDetails.password);
gogo.Terminal(element.get(0), width, height, authHeader);
... |
<vulnerable_code>package io.hawt.web;
import java.io.IOException;
import java.io.PrintWriter;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.Principal;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List... |
<vulnerable_code><commit_title>[PATCH] Add a LoginTokenServlet that plugins can use to fetch a<commit_description><fixed_code>
package io.hawt.web;
import org.apache.commons.codec.binary.Base64;
import javax.security.auth.Subject;
import javax.servlet.http.HttpSession;
import java.io.PrintWriter;
import java.security... |
<vulnerable_code> */
public class IndexHtmlRequestHandler extends JavaScriptBootstrapHandler {
@Override
public boolean synchronizedHandleRequest(VaadinSession session,
VaadinRequest request, VaadinResponse response) throws IOException {
if (csrfToken != null) {
initialJ... |
<vulnerable_code> return 'card' in request.session and request.session['card']['valid_pin'] is True
def get_card(request, cc_number):
q = "select * from cards where cc_number = '%s'" % cc_number.replace('-', '')
row = request.db.execute(q).fetchone()
if row is not None:
return dict(
... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code><commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user w... |
<vulnerable_code> dataSet.addTable(new DefaultTable("jobAgentMetadata"));
dataSet.addTable(new DefaultTable("DataSharingSettings"));
dataSet.addTable(new DefaultTable("UsageDataReporting"));
databaseTester.setDataSet(dataSet);
}<commit_title>[PATCH] Access Token APIs (#5797)<commit_... |
<vulnerable_code> public class ArtifactStores {
public static final String SPA_BASE = "/admin/artifact_stores";
}
}<commit_title>[PATCH] Access Token APIs (#5797)<commit_description>* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth t... |
<vulnerable_code>)
from airflow_breeze.utils.confirm import Answer, user_confirm
from airflow_breeze.utils.console import get_console
from airflow_breeze.utils.path_utils import BUILD_CACHE_DIR
from airflow_breeze.utils.run_utils import run_command
from airflow_breeze.utils.shared_options import get_dry_run
... |
<vulnerable_code> DOCKER_COMPOSE_COMMAND,
get_env_variables_for_docker_commands,
perform_environment_checks,
)
from airflow_breeze.utils.parallel import (
GenericRegexpProgressMatcher,
env_variables["TEST_TIMEOUT"] = str(test_timeout)
if db_reset:
env_variables["DB_RESET"] = "true"
... |
<vulnerable_code> def file(self) -> TextIO:
return open(self.file_name, "a+t")
@lru_cache(maxsize=None)
def get_console(output: Output | None = None) -> Console:<commit_title>[PATCH 1/3] Prepare docs for April 2023 wave of Providers (#30378)<commit_description>* Prepare docs for April 2023 wave of Provider... |
<vulnerable_code>import sys
from copy import deepcopy
from random import randint
from subprocess import CalledProcessError, CompletedProcess
from airflow_breeze.params.build_ci_params import BuildCiParams
from airflow_breeze.params.build_prod_params import BuildProdParams
"/opt/airflow/scripts/in_container/run... |
<vulnerable_code>def get_output_files(titles: list[str]) -> list[Output]:
outputs = [Output(title=titles[i], file_name=get_temp_file_name()) for i in range(len(titles))]
for out in outputs:
get_console().print(f"[info]Capturing output of {out.title}:[/] {out.file_name}")
return outputs
... |
<vulnerable_code> ),
],
)
def test_cli_connection_add(self, cmd, expected_output, expected_conn):
with redirect_stdout(io.StringIO()) as stdout:
connection_command.connections_add(self.parser.parse_args(cmd))<commit_title>[PATCH 1/3] Prepare docs for April 2023 wave of Pro... |
<vulnerable_code> * @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder() {
this(ZlibWrapper.ZLIB);
}
/**
* @throws DecompressionException if failed to initialize zlib
*/
public JZlibDecoder(ZlibWrapper wrapper) {
ObjectUtil.checkNotNull... |
<vulnerable_code> * Creates a new instance with the default wrapper ({@link ZlibWrapper#ZLIB}).
*/
public JdkZlibDecoder() {
this(ZlibWrapper.ZLIB, null, false);
}
/**
* supports the preset dictionary.
*/
public JdkZlibDecoder(byte[] dictionary) {
this(ZlibWrapper.ZLI... |
<vulnerable_code>package io.netty.handler.codec.compression;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.ByteToMessageDecoder;
/**
*/
public abstract class ZlibDecoder extends ByteToMessageDecoder {
/**
* Returns {@code true} if and only if the end of the compressed stream
* has been... |
<vulnerable_code> }
@Override
protected ZlibDecoder createDecoder(ZlibWrapper wrapper) {
return new JZlibDecoder(wrapper);
}
}<commit_title>[PATCH] Allow a limit to be set on the decompressed buffer size for<commit_description><fixed_code>
}
@Override
protected ZlibDecoder createDec... |
<vulnerable_code> }
@Override
protected ZlibDecoder createDecoder(ZlibWrapper wrapper) {
return new JdkZlibDecoder(wrapper);
}
@Test(expected = DecompressionException.class)<commit_title>[PATCH] Allow a limit to be set on the decompressed buffer size for<commit_description><fixed_code>
... |
<vulnerable_code> */
package io.netty.handler.codec.compression;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
rand.nextBytes(BYTES_LARGE);
}
protected abstract ZlibEncoder createEncoder(Zli... |
<vulnerable_code>
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
if (info & ZEND_MM_IS_SRUN) {
int old_bin_num, bin_num;
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
old_size = bin_data_size[old_bin_num];
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
#if ZEND_D... |
<vulnerable_code> if (!isPotentialBeanType(type.getRawClass())) {
return null;
}
// Use generic bean introspection to build deserializer
return buildBeanDeserializer(ctxt, type, beanDesc);
}
// We default to 'false', i.e. not ignorable
return (status == nul... |
<vulnerable_code><commit_title>[PATCH] Fix #1599 for 2.7(.10)<commit_description><fixed_code>
package com.fasterxml.jackson.databind.interop;
import com.fasterxml.jackson.databind.*;
/**
* Test case(s) to guard against handling of types that are illegal to handle
* due to security constraints.
*/
public class Ille... |
<vulnerable_code> * indistinguishable from correctly formatted RSA blocks
*/
ret = args->lastErr;
args->lastErr = 0; /* reset */
/* build PreMasterSecret */
ssl->arrays->pre... |
<vulnerable_code> else if (k < maxLen)
b = in[k - WOLFSSL_TLS_HMAC_INNER_SZ];
b = ctMaskSel(atEoc, b, 0x80);
b &= (unsigned char)~(word32)pastEoc;
b &= ((unsigned char)~(word32)isOutBlock) | isEocBlock;
if (j >= blockSz - 8) {
... |
<vulnerable_code> return res;
}
/* creates "a" then copies b into it */
int mp_init_copy (mp_int * a, mp_int * b)<commit_title>[PATCH] Make RsaUnPad constant time when Block Type 2 message<commit_description><fixed_code>
return res;
}
int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c)
{
int i, le... |
<vulnerable_code> return 0 - (a == b);
}
/* Constant time - select b when mask is set and a otherwise. */
STATIC WC_INLINE byte ctMaskSel(byte m, byte a, byte b)
{
return (a & ((byte)~(word32)m)) | (b & m);
}
/* Constant time - bit set when a <= b. */<commit_title>[PATCH] Make RsaUnPad constant time when Block... |
<vulnerable_code> ret += pkcsBlock[idx++] ^ 0x01; /* separator value is 0x01 */
ret += pkcsBlock[0] ^ 0x00; /* Y, the first value, should be 0 */
if (ret != 0) {
WOLFSSL_MSG("RsaUnPad_OAEP: Padding Error");
return BAD_PADDING_E;
}
/* adjust pointer to correct location in array a... |
<vulnerable_code> * The array must be large enough for encoded number - use mp_unsigned_bin_size
* to calculate the number of bytes required.
*
* a SP integer.
* returns MP_OKAY always.
*/
int sp_to_unsigned_bin(sp_int* a, byte* out)
return MP_OKAY;
}
/* Ensure the data in the big number is zeroed.
*
* a ... |
<vulnerable_code> return FP_OKAY;
}
int fp_unsigned_bin_size(fp_int *a)
{
int size = fp_count_bits (a);
return fp_to_unsigned_bin(a,b);
}
/* reads a unsigned char array, assumes the msb is stored first [big endian] */
int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c)
{<commit_title>[PATCH]... |
<vulnerable_code> *
* @brief GPMF Parser library
*
* @version 1.2.1
*
* (C) Copyright 2017 GoPro Inc (http://gopro.com/).
*
{
if (ms)
{
int32_t nestsize = (int32_t)ms->nest_size[ms->nest_level];
if (nestsize == 0 && ms->nest_level == 0)
nestsize = ms->buffer_size_longs;
<commit_title>[PATCH] fixed ... |
<vulnerable_code> }
size_t mp4 = OpenMP4Source(argv[1], MOV_GPMF_TRAK_TYPE, MOV_GPMF_TRAK_SUBTYPE);
// size_t mp4 = OpenMP4SourceUDTA(argv[1]); //Search for GPMF payload with MP4's udta
metadatalength = GetDuration(mp4);
for (index = 0; index < payloads; index++)
{
uint32_t payloadsize = GetPayloadSize(mp4... |
<vulnerable_code>*
* @brief Way Too Crude MP4|MOV reader
*
* @version 1.2.1
*
* (C) Copyright 2017 GoPro Inc (http://gopro.com/).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ... |
<vulnerable_code> },
convertToValidHTMLString: function (HTMLString) {
var tempDiv = document.createElement('div');
tempDiv.innerHTML = Zenoss.util.sanitizeHtml(HTMLString);
return tempDiv.innerHTML;
}
});<commit_title>[PATCH] add backward compatibility<co... |
<vulnerable_code> server->dnstls_data.session_data.size = 0;
}
if (server->manager->dns_over_tls_mode == DNS_OVER_TLS_YES)
gnutls_session_set_verify_cert(gs, NULL, 0);
gnutls_handshake_set_timeout(gs, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
<commit_title>[PATCH] resol... |
<vulnerable_code>
#include "namespace.h"
#include "log.h"
#include "attach.h"
#include "caps.h"
#include "config.h"
lxc_log_define(lxc_attach, lxc);
int lsm_set_label_at(int procfd, int on_exec, char* lsm_label) {
int labelfd = -1;
int ret = 0;
const char* name;
char* command = NULL;
name = lsm_name();
if (st... |
<vulnerable_code>#!/usr/bin/env python3
# (C) Copyright 2014, Google Inc.
# (C) Copyright 2018, James R Barlow
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/L... |
<vulnerable_code>#!/usr/bin/env python3
# (C) Copyright 2014, Google Inc.
# (C) Copyright 2018, James R Barlow
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/... |
<vulnerable_code># (C) Copyright 2014, Google Inc.
# (C) Copyright 2018, James R Barlow
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless req... |
<vulnerable_code> },
},
});
}<commit_title>[PATCH 01/11] Fix path cleanup in multiple places (#3871)<commit_description><fixed_code>
},
},
});
}
function toggleDuedateForm() {
$('#add_deadline_form').fadeToggle(150);
}
function deleteDueDate(url) {
$.post(url, {
... |
<vulnerable_code> [BPF_EXIT >> 4] = "exit",
};
static void print_bpf_insn(struct bpf_insn *insn)
{
u8 class = BPF_CLASS(insn->code);
insn->code,
bpf_ldst_string[BPF_SIZE(insn->code) >> 3],
insn->src_reg, insn->imm);
} else if (BPF_MODE(insn->code) == BPF_IMM) {
verbose("(%02x) r%d = 0x%x\n",
ins... |
<vulnerable_code>
# Check bidi
RandAL = [stringprep.in_table_d1(x) for x in label]
for c in RandAL:
if c:
# There is a RandAL char in the string. Must perform further
# tests:
# 1) The characters in section 5.8 MUST be prohibited.
# This is table C.8, ... |
<vulnerable_code> self.assertEqual("pyth\xf6n.org".encode("idna"), b"xn--pythn-mua.org")
self.assertEqual("pyth\xf6n.org.".encode("idna"), b"xn--pythn-mua.org.")
def test_stream(self):
r = codecs.getreader("idna")(io.BytesIO(b"abc"))
r.read(3)<commit_title>[PATCH] [3.11] gh-98433: Fi... |
<vulnerable_code><commit_title>[PATCH] fix TLS Certificate CommonName NULL Byte Vulnerability<commit_description>CVE-2020-7043 TLS Certificate CommonName NULL Byte Vulnerability is fixed
with this commit
with #8 hostname validation for the certificate was introduced
but unfortunately strncasecmp() was used to compare ... |
<vulnerable_code>#include "tunnel.h"
#include "http.h"
#include "log.h"
#include <unistd.h>
#include <fcntl.h>
0, 0, NULL) == 1)
cert_valid = 1;
#else
char common_name[FIELD_SIZE + 1];
// Use explicit Common Name check if native validation not available.
// Note: this will ignore Subject Alte... |
<vulnerable_code>
if (button == 'ok') {
let tree = options.tree;
Ext.Ajax.request({
url: Routing.generate('pimcore_ecommerceframework_pricing_rename'),
method: 'PUT',
params: {
id: options.id,
name:... |
<vulnerable_code> return 0;
}
if (is_ice && !rtp_session->ice.cand_responsive) {
return 0;
}
<commit_title>[PATCH] [Core] Reject DTLS packets coming from a source different<commit_description><fixed_code>
return 0;
}
if (is_ice && !(rtp_session->ice.type & ICE_LITE) && !rtp_session->ice.cand_responsive) {
... |
<vulnerable_code>extern const char pcap_version[];
#endif
/**
* Depending on what version of libpcap/WinPcap there are different ways to get
* the version of the libpcap/WinPcap library. This presents a unified way to
switch (datalink) {
case DLT_RAW:
if ((pktdata[0] >> 4) == 4)
retu... |
<vulnerable_code> DACL_SECURITY_INFORMATION,
&sid, NULL, NULL, NULL, &descriptor);
if (err != ERROR_SUCCESS)
error(_("failed to get owner for '%s' (%ld)"), path, err);
else if (sid && IsValidSid(sid)) {
/* Now, verify that the SID matches the current user's */
static PSID current_user_sid;
BOO... |
<vulnerable_code>
struct _ZGFX_TOKEN
{
int prefixLength;
int prefixCode;
int valueBits;
int tokenType;
UINT32 valueBase;
};
typedef struct _ZGFX_TOKEN ZGFX_TOKEN;
static const ZGFX_TOKEN ZGFX_TOKEN_TABLE[] =
{
// len code vbits type vbase
{ 0 }
};
#define zgfx_GetBits(_zgfx, _nbits) \
while (_zgfx->cBitsCurr... |
<vulnerable_code>
r = parse_uid("65535", &uid);
assert_se(r == -ENXIO);
r = parse_uid("asdsdas", &uid);
assert_se(r == -EINVAL);
}
static void test_uid_ptr(void) {<commit_title>[PATCH] basic/user-util: always use base 10 for user/group numbers<commit_description>We would parse numbers ... |
<vulnerable_code> unsigned int r,g,b,a;
size_t pixnum;
size_t xi,yi; // position in image coordinates
size_t xs /*,ys*/; // position in screen coordinates
iw_byte *ptr;
img = rctx->img;
xi = pixnum%rctx->image_width;
yi = pixnum/rctx->image_width;
xs = rctx->image_left + xi;
// ys = rctx->image_top + yi;
//... |
<vulnerable_code>import random
import uuid
import warnings
from functools import cached_property
from typing import TYPE_CHECKING, Any, Callable, Container, Iterable, Sequence
import jwt
from flask import flash, g, session
)
from airflow.auth.managers.fab.models.anonymous_user import AnonymousUser
from airflow.auth.ma... |
<vulnerable_code># under the License.
from __future__ import annotations
import warnings
from functools import cached_property
from typing import TYPE_CHECKING, Any, Callable, Collection, Sequence
from flask import g
from sqlalchemy import select
from airflow.auth.managers.fab.security_manager.constants import EXIST... |
<vulnerable_code> """
dag = get_dag(args.subdir, args.dag_id)
if dag.get_is_paused():
print("[INFO] Please be reminded this DAG is PAUSED now.", file=sys.stderr)
with create_session() as session:
last_parsed_dag: DagModel = session.scalars(
select(DagModel).where(DagModel.da... |
<vulnerable_code> :meta private:
"""
query: dict[Any, Any] = {
"query": {
"bool": {
"filter": [{"range": {self.offset_field: {"gt": int(offset)}}}],
"must": [{"match_phrase": {"log_id": log_id}}],
}
}
... |
<vulnerable_code> "track_scores",
"version",
)
def count(self, index=None, doc_type=None, body=None, params=None, headers=None):
searchable_indexes = self._normalize_index_to_list(index, body)
searchable_doc_types = self._normalize_doc_type_to_list(doc_type)
i = 0
... |
<vulnerable_code>class MissingIndexException(NotFoundError):
"""Exception representing a missing index."""
def __init__(self, msg, body):
self.msg = msg
self.body = body
def __str__(self):
return f"IndexMissingException[[{self.msg}] missing] with body {self.body}"
class SearchFai... |
<vulnerable_code>pytestmark = pytest.mark.db_test
class Test_BranchPythonDecoratedOperator:
@pytest.mark.parametrize("branch_task_name", ["task_1", "task_2"])
def test_branch_one(self, dag_maker, branch_task_name):
@task<commit_title>[PATCH 04/11] Update es read query to not use body (#34792)<commit_d... |
<vulnerable_code> DagAccessEntity.DEPENDENCIES: (RESOURCE_DAG_DEPENDENCIES,),
DagAccessEntity.IMPORT_ERRORS: (RESOURCE_IMPORT_ERROR,),
DagAccessEntity.RUN: (RESOURCE_DAG_RUN,),
# RESOURCE_TASK_INSTANCE has been originally misused. RESOURCE_TASK_INSTANCE referred to task definition
# AND task instance... |
<vulnerable_code> PLUGINS = "PLUGINS"
PROVIDERS = "PROVIDERS"
TRIGGERS = "TRIGGERS"
SLA = "SLA"
WEBSITE = "WEBSITE"
DEPENDENCIES = "DEPENDENCIES"
IMPORT_ERRORS = "IMPORT_ERRORS"
RUN = "RUN"
TASK = "TASK"
TASK_INSTANCE = "TASK_INSTANCE"
TASK_RESCHEDULE = "TASK_RESCHEDULE"<com... |
<vulnerable_code># under the License.
from __future__ import annotations
import logging
import warnings
from functools import wraps
from typing import TYPE_CHECKING, Callable, Sequence, TypeVar, cast
from flask import flash, redirect, render_template, request
from airflow.auth.managers.models.resource_details import... |
<vulnerable_code># under the License.
from __future__ import annotations
from functools import cached_property
from typing import TYPE_CHECKING, Callable
from flask import g
from airflow.auth.managers.fab.security_manager.constants import EXISTING_ROLES as FAB_EXISTING_ROLES
from airflow.auth.managers.models.resourc... |
<vulnerable_code>import warnings
from bisect import insort_left
from collections import defaultdict
from functools import cached_property, wraps
from json import JSONDecodeError
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Collection, Iterator, Mapping, MutableMapping, Sequence
from urllib.... |
<vulnerable_code> RESOURCE_JOB,
RESOURCE_PLUGIN,
RESOURCE_PROVIDER,
RESOURCE_SLA_MISS,
RESOURCE_TASK_INSTANCE,
RESOURCE_TRIGGER,
RESOURCE_VARIABLE,
[(ACTION_CAN_READ, RESOURCE_TRIGGER)],
True,
),
# With permission (SLA)
(
... |
<vulnerable_code>
from __future__ import annotations
from unittest.mock import patch
import pytest
from airflow.security import permissions
from airflow.settings import json
from tests.test_utils.api_connexion_utils import create_user_scope
from tests.www.test_security import SomeBaseView, SomeModelView
pytestmark ... |
<vulnerable_code>
import os
import re
from typing import Callable
from unittest import mock
import pytest
)
from airflow.plugins_manager import AirflowPlugin, EntryPointSource
from airflow.utils.task_group import TaskGroup
from airflow.www import views
from airflow.www.views import (
get_key_paths,
get_safe_ur... |
<vulnerable_code># under the License.
from __future__ import annotations
import flask
import markupsafe
import pytest
from airflow.models import DagBag, DagRun, TaskInstance
username="all_dr_permissions_except_dag_edit",
role_name="all_dr_permissions_except_dag_edit",
permissions=[
... |
<vulnerable_code>from airflow.utils import timezone
from airflow.utils.state import State
from airflow.utils.types import DagRunType
from airflow.www.views import action_has_dag_edit_access
from tests.test_utils.db import clear_db_runs, clear_db_variables
from tests.test_utils.www import _check_last_log, _check_last_lo... |
<vulnerable_code> )
check_content_in_response("default_pool cannot be deleted", resp)
assert session.query(Pool).filter(Pool.id == pool.id).count() == 1<commit_title>[PATCH 04/11] Update es read query to not use body (#34792)<commit_description><fixed_code>
)
check_content_in_response("default_pool c... |
<vulnerable_code>
assert session.query(TaskInstance).filter(TaskInstance.task_id == task_id).count() == 1
resp = client_ti_without_dag_edit.post(f"/taskinstance/delete/{composite_key}", follow_redirects=True)
check_content_in_response(f"Access denied for dag_id {task_instance_to_delete.dag_id}", resp)
a... |
<vulnerable_code> app,
username="user_variable_reader",
role_name="role_variable_reader",
permissions=[(permissions.ACTION_CAN_READ, permissions.RESOURCE_VARIABLE)],
)
check_content_in_response("Sign In", resp)
def test_import_variables_form_shown(app, admin_client):
resp ... |
<vulnerable_code>from flask_login import LoginManager
from itsdangerous import want_bytes
from markupsafe import Markup
from sqlalchemy import and_, func, inspect, or_, select
from sqlalchemy.exc import MultipleResultsFound
from sqlalchemy.orm import Session, joinedload
from werkzeug.security import check_password_hash... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.