text stringlengths 79 3.72M |
|---|
<vulnerable_code> opj_stream_destroy(jp2_stream);
for (i=0; i < (ssize_t) jp2_image->numcomps; i++)
{
if ((jp2_image->comps[i].dx == 0) || (jp2_image->comps[i].dy == 0))
{
opj_destroy_codec(jp2_codec);
opj_image_destroy(jp2_image);<commit_title>[PATCH] ...<commit_description><fixed_code>
... |
<vulnerable_code> int ret = 0;
bool unlisted = false;
if (po->fanout)
return -EINVAL;
lock_sock(sk);
spin_lock(&po->bind_lock);
rcu_read_lock();
if (name) {
dev = dev_get_by_name_rcu(sock_net(sk), name);
if (!dev) {<commit_title>[PATCH] packet: in packet_do_bind, test fanout with bind_lock held<commit_de... |
<vulnerable_code> aws_conn_id=self.aws_conn_id,
cluster_identifier=self.cluster_identifier,
attempts=self._attempts,
operation_type="pause_cluster",
),
method_name="execute_complete",
)
... |
<vulnerable_code> else:
if self.attempts < 1:
yield TriggerEvent({"status": "error", "message": f"{self.task_id} failed"})
else:
yield TriggerEvent(f"{self.operation_type} is not supported")
except Exc... |
<vulnerable_code> "message": "An error occurred (SomeServiceException) when calling the "
"redshift operation: Details/context around the exception or error",
}<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: bugraozturk <bugra.ozturk@mollie.com>... |
<vulnerable_code> )
task = [i async for i in trigger.run()]
assert TriggerEvent({"status": "error", "message": "Test exception"}) in task<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: bugraozturk <bugra.ozturk@mollie.com><fixed_code>
)
... |
<vulnerable_code> }
for k8s_object in k8s_objects:
assert k8s_object["metadata"]["labels"] == {**common_labels, **chart_labels, **local_labels}<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: bugraozturk <bugra.ozturk@mollie.com><fixed_code>
... |
<vulnerable_code>
class WebEncoder(json.JSONEncoder):
"""This encodes values into a web understandable format. There is no deserializer"""
def default(self, o: Any) -> Any:
if isinstance(o, datetime):
data = serialize(o)
if isinstance(data, dict) and DATA in data:
... |
<vulnerable_code> }
def get_dag_run_conf(dag_run_conf: Any) -> tuple[str | None, bool]:
conf: str | None = None
conf_is_json: bool = False
if isinstance(dag_run_conf, str):
conf = dag_run_conf
elif isinstance(dag_run_conf, (dict, list)) and any(dag_run_conf):
conf = json.dumps(dag_... |
<vulnerable_code> query = query.filter(DagRun.state == run_state)
dag_runs = wwwutils.sorted_dag_runs(query, ordering=dag.timetable.run_ordering, limit=num_runs)
encoded_runs = [wwwutils.encode_dag_run(dr) for dr in dag_runs]
data = {
"groups": dag_to_... |
<vulnerable_code>
from bs4 import BeautifulSoup
from airflow.www import utils
from airflow.www.utils import wrapped_markdown
rendered = self.attr_renderer["doc_md"](None)
assert rendered is None
class TestWrappedMarkdown:
def test_wrapped_markdown_with_docstring_curly_braces(self):<commit_title>... |
<vulnerable_code> if False streams file from SFTP to S3.
"""
template_fields: Sequence[str] = ("s3_key", "sftp_path")
def __init__(
self,<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: bugraozturk <bugra.ozturk@mollie.com><fixed_code>
if F... |
<vulnerable_code> )
The following Operator would move all the Avro files from ``sales/sales-2019``
and ``sales/sales-2020` folder in ``data`` bucket to the same folder in the
``data_backup`` bucket, deleting the original files in the process. ::
move_files = GCSToGCSOperator(<commit_title... |
<vulnerable_code>from __future__ import annotations
import time
from typing import TYPE_CHECKING, Any
from airflow import AirflowException
:param dbt_cloud_conn_id: The connection identifier for connecting to dbt Cloud.
:param run_id: The job run identifier.
:param account_id: The dbt Cloud account identi... |
<vulnerable_code>
class TestDbtCloudJobRunSensor:
def setup_class(self):
self.sensor = DbtCloudJobRunSensor(
task_id="job_run_sensor",
with pytest.raises(DbtCloudJobRunException, match=error_message):
self.sensor.poke({})
class TestDbtCloudJobRunSensorAsync:
TA... |
<vulnerable_code> )
# [END howto_operator_dbt_cloud_run_job_sensor]
# [START howto_operator_dbt_cloud_run_job_async_sensor]
job_run_async_sensor = DbtCloudJobRunAsyncSensor(
task_id="job_run_async_sensor", run_id=trigger_job_run2.output, timeout=20<commit_title>[PATCH 06/18] Small quotation fix ... |
<vulnerable_code> if db_reset:
env_variables["DB_RESET"] = "true"
env_variables["TEST_TYPE"] = exec_shell_params.test_type
env_variables["SKIP_PROVIDER_TESTS"] = str(exec_shell_params.skip_provider_tests).lower()
if "[" in exec_shell_params.test_type and not exec_shell_params.test_type.startswith... |
<vulnerable_code> "options": [
"--test-type",
"--test-timeout",
"--db-reset",
"--backend",
"--python",
"--image-tag",
"--mount-sources",
"--upgrade-boto",
],
},
... |
<vulnerable_code> backend: str = ALLOWED_BACKENDS[0]
base_branch: str = "main"
ci: bool = False
db_reset: bool = False
dev_mode: bool = False
extra_args: tuple = ()
platform: str = DOCKER_DEFAULT_PLATFORM
postgres_version: str = ALLOWED_POSTGRES_VERSIONS[0]
python: str = ALLOWED_PYTHO... |
<vulnerable_code> set_value_to_default_if_not_set(env, "CI_TARGET_BRANCH", AIRFLOW_BRANCH)
set_value_to_default_if_not_set(env, "CI_TARGET_REPO", APACHE_AIRFLOW_GITHUB_REPOSITORY)
set_value_to_default_if_not_set(env, "COMMIT_SHA", commit_sha())
set_value_to_default_if_not_set(env, "DB_RESET", "false")
... |
<vulnerable_code>import json
import re
import subprocess
import sys
from pathlib import Path
from rich.console import Console
if __name__ == "__main__":
arm = False
if len(sys.argv) > 1 and sys.argv[1].lower() == "arm":
arm = True
remove_packages_missing_on_arm()
result = subprocess.run([... |
<vulnerable_code>
def run_tests_in_parallel(
exec_shell_params: ShellParams,
test_types_list: list[str],
extra_pytest_args: tuple,
db_reset: bool,
full_tests_needed: bool,
memory_available = psutil.virtual_memory()
if memory_available.available < LOW_MEMORY_CONDITION and exec_shell_params.ba... |
<vulnerable_code> "options": [
"--run-in-parallel",
"--parallelism",
"--test-types",
"--skip-cleanup",
"--debug-resources",
"--include-success-outputs",<commit_title>[PATCH 06/18] Small quotation fix (#30448)<comm... |
<vulnerable_code>
@cached_property
def run_amazon_tests(self) -> bool:
return "amazon" in self.test_types or "Providers" in self.test_types.split(" ")
@cached_property
def run_kubernetes_tests(self) -> bool:
return sorted_candidate_test_types
@cached_property
def test_types(sel... |
<vulnerable_code> client_options = None
if location != "global":
client_options = ClientOptions(api_endpoint=f"{location}-cloudbuild.googleapis.com:443")
client = CloudBuildAsyncClient(client_options=client_options)
request = GetBuildRequest(
project_id=project_id... |
<vulnerable_code> )
@pytest.mark.asyncio
@async_mock.patch.object(CloudBuildAsyncClient, "__init__", lambda self, client_options: None)
@async_mock.patch(CLOUD_BUILD_PATH.format("CloudBuildAsyncClient.get_build"))
async def test_async_cloud_build_service_client_creation_should_execute_successful... |
<vulnerable_code>
import asyncio
import logging
import pytest
from google.cloud.devtools.cloudbuild_v1 import CloudBuildAsyncClient
from google.cloud.devtools.cloudbuild_v1.types import Build, BuildStep
from airflow.providers.google.cloud.hooks.cloud_build import CloudBuildAsyncHook
from airflow.providers.google.clou... |
<vulnerable_code> )
from inputimeout import TimeoutOccurred, inputimeout
user_status = inputimeout(
prompt="Are you REALLY sure you want to continue? (answer with y otherwise we exit in 20s)\n",
timeout=20,
)
if user_status.uppe... |
<vulnerable_code> run_compile_www_assets,
)
from airflow_breeze.utils.shared_options import get_forced_answer
option_debug_release_management = click.option(
"--debug",
perform_environment_checks()
cleanup_python_generated_files()
packages_list = list(packages)
if package_list_file:
pack... |
<vulnerable_code> set_value_to_default_if_not_set(env, "SKIP_ENVIRONMENT_INITIALIZATION", "false")
set_value_to_default_if_not_set(env, "SKIP_PROVIDER_TESTS", "false")
set_value_to_default_if_not_set(env, "SKIP_SSH_SETUP", "false")
set_value_to_default_if_not_set(env, "TEST_TYPE", "")
set_value_to_de... |
<vulnerable_code>
AIRFLOW_SOURCES_ROOT = find_airflow_sources_root_to_operate_on().resolve()
BUILD_CACHE_DIR = AIRFLOW_SOURCES_ROOT / ".build"
WWW_CACHE_DIR = BUILD_CACHE_DIR / "www"
WWW_ASSET_COMPILE_LOCK = WWW_CACHE_DIR / ".asset_compile.lock"<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_descriptio... |
<vulnerable_code>from airflow_breeze.utils.exclude_from_matrix import excluded_combos
from airflow_breeze.utils.github_actions import get_ga_output
from airflow_breeze.utils.kubernetes_utils import get_kubernetes_python_combos
from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
if sys.version_info >= (3, ... |
<vulnerable_code><commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: bugraozturk <bugra.ozturk@mollie.com><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 addi... |
<vulnerable_code>
def get_available_providers_packages():
"""Get list of all available providers packages to build."""
return [provider["package-name"] for provider in ALL_PROVIDER_YAMLS]
def get_available_packages():<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: b... |
<vulnerable_code>
def get_available_packages():
"""Get list of all available packages to build."""
provider_package_names = [provider["package-name"] for provider in ALL_PROVIDER_YAMLS]
return [
"apache-airflow",
"docker-stack",<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_... |
<vulnerable_code> get_ci_image_for_pre_commits,
run_command,
)
files_to_test = filter_out_providers_on_non_main_branch(sys.argv[1:])
if files_to_test == ["--namespace-packages"]:
"-e",
"SKIP_ENVIRONMENT_INITIALIZATION=true",
"-e",
"BACKEND=sqli... |
<vulnerable_code>
CROSS_PROVIDERS_DEPS = "cross-providers-deps"
DEPS = "deps"
ALL_DEPENDENCIES: dict[str, dict[str, list[str]]] = defaultdict(lambda: defaultdict(list))
provider_name = str(provider_file.parent.relative_to(AIRFLOW_PROVIDERS_DIR)).replace(
os.sep, "."
... |
<vulnerable_code>from rich.console import Console
AIRFLOW_SOURCES_ROOT = Path(__file__).parents[2].resolve()
console = Console(width=400, color_system="standard")
<commit_title>[PATCH 06/18] Small quotation fix (#30448)<commit_description>Co-authored-by: bugraozturk <bugra.ozturk@mollie.com><fixed_code>
from rich.co... |
<vulnerable_code>
console = Console(width=400, color_system="standard")
def _filepath_to_module(filepath: pathlib.Path) -> str:
p = filepath.resolve().relative_to(ROOT_DIR).as_posix()
jsonschema.validate(provider, schema=schema)
except jsonschema.ValidationError:
raise Exception(f"... |
<vulnerable_code> "ipdb",
"jira",
"jsondiff",
"mongomock",
"moto[cloudformation, glue]>=4.0",
"paramiko",
def get_provider_dependencies(provider_name: str) -> list[str]:
return PROVIDER_DEPENDENCIES[provider_name][DEPS]
for alias, extra in EXTRAS_DEPRECATED_ALIASES.items():
de... |
<vulnerable_code>
import os
from glob import glob
import pytest
from airflow.models import DagBag
from tests.test_utils.asserts import assert_queries_count
ROOT_FOLDER = os.path.realpath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir)
)
NO_DB_QUERY_EXCEPTION = ["/airflow/example... |
<vulnerable_code>
# pylint: disable=bad-continuation
@XBlock.wants('settings')
@XBlock.needs('i18n')
class DragAndDropBlock(
ScorableXBlockMixin,
answer = self._get_correct_state()
explanation = self.data.get('explanation', '').strip()
if hasattr(self.runtime, 'replace_urls'):
... |
<vulnerable_code> npy_intp *dims);
static int
count_negative_dimensions(const int rank, const npy_intp *dims)
{
int i = 0, r = 0;
while (i < rank) {
if (dims[i] < 0)
++r;
++i;
}
return r;
}
#ifdef DEBUG_COPY_ND_ARRAY
((intent & F2PY_INTENT_CA... |
<vulnerable_code> SetPixelIndex(image,(((unsigned char) pixel) &
(0x01 << (7-bit))) != 0 ? 0 : 255,q);
SetPixelViaPixelInfo(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
q+=GetPixelChannels(image);
... |
<vulnerable_code> XCFDocInfo* inDocInfo,XCFLayerInfo *outLayer,const ssize_t layer,
ExceptionInfo *exception)
{
MagickOffsetType
offset;
exception);
if (outLayer->image == (Image *) NULL)
return(MagickFalse);
/* clear the image based on the layer opacity */
outLayer->image->background_color.alph... |
<vulnerable_code>
class RecoverPasswordInputSchema(Schema):
""" Schema for validating input for recovering a password. """
# TODO make sure the max lengths match username and email
email = fields.Email(validate=Length(max=256))
username = fields.String(validate=Length(max=128))
class ResetPasswordInput... |
<vulnerable_code>from http import HTTPStatus
from flask.globals import request
from flask import g
from flask_restful import reqparse, Api
from sqlalchemy import or_
from vantage6.server import db
)
from vantage6.server.model.rule import Operation, Scope
from vantage6.server.resource.common._schema import RoleSchema, ... |
<vulnerable_code> with_user,
ServicesResources
)
from vantage6.server.resource.common.pagination import Pagination
from vantage6.server.resource.common._schema import UserSchema
# Resources / API's
# ------------------------------------------------------------------------------
user_schema = UserSchema()
clas... |
<vulnerable_code> if (q == (PixelPacket *) NULL)
break;
indexes=GetAuthenticIndexQueue(image);
for (x=0; x < ((ssize_t) image->columns-1); x+=4)
{
index=ConstrainColormapIndex(image,(*p >> 6) & 0x3);
SetPixelIndex(indexes+x,index);
index=Const... |
<vulnerable_code> assert c.test_ecrecover_uints2() == local_account.address
print("Passed ecrecover test")<commit_title>[PATCH] Merge pull request from GHSA-f5x6-7qgp-jhf3<commit_description><fixed_code>
assert c.test_ecrecover_uints2() == local_account.address
print("Passed ecrecover test")
def test... |
<vulnerable_code>
@process_inputs
def build_IR(self, expr, args, kwargs, context):
placeholder_node = IRnode.from_list(
context.new_internal_variable(BytesT(128)), typ=BytesT(128), location=MEMORY
)
return IRnode.from_list(
[
"seq",
... |
<vulnerable_code>
from rest_framework_csv.renderers import CSVRenderer
from django.db.models.aggregates import Count
from django.http import HttpResponse
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import get_user_model
from django.apps import apps
from django.db.models import Q... |
<vulnerable_code><commit_title>[PATCH] Add Sendgrid modeling<commit_description><fixed_code>
# https://www.twilio.com/blog/how-to-send-emails-in-python-with-sendgrid
from flask import request, Flask
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail, Email, To, Content, MimeType
app = Flask... |
<vulnerable_code># This tests that the developer doesn't pass content via the Content class initializer.
# source:https://github.com/sendgrid/sendgrid-python
import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))
from_email = Email("te... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner,
ZERO_ADDRESS,
assert_event_emitted,
get_contract_class,<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from signers import MockSigner
fro... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import MockSigner, assert_revert, get_contract_class, cached_contract, TRUE
signer = MockSigner(123456789987654321)<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from star... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import MockSigner, get_contract_class, cached_contract
signer = MockSigner(123456789987654321)<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from starkware.starknet.testin... |
<vulnerable_code><commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from starkware.starknet.testing.starknet import Starknet
from starkware.starkware_utils.error_handling import StarkException
from starkware.starknet.definitions.error_codes import StarknetErrorCode
from utils... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
TRUE, FALSE, assert_revert, assert_event_emitted,
get_contract_class, cached_contract, MockSigner
)
signer = MockSigner(12345678987654321)
@pytest.fixture<commit_title>[PATCH] Eth account support (#361... |
<vulnerable_code><commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
from nile.signer import Signer, from_call_to_call_array, get_transaction_hash
from utils import to_uint
import eth_keys
class MockSigner():
"""
Utility for sending signed transactions to an Account on Starknet.
... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, to_uint, add_uint, sub_uint, str_to_felt, MAX_UINT256,
ZERO_ADDRESS, INVALID_UINT256, TRUE, get_contract_class, cached_contract,
assert_revert, assert_event_emitted, contract_path
)
sig... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, TRUE, FALSE, to_uint, str_to_felt, assert_revert,
get_contract_class, cached_contract
)
signer = MockSigner(123456789987654321)
# testing vars<commit_title>[PATCH] Eth account support (#361... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, to_uint, sub_uint, str_to_felt, assert_revert,
get_contract_class, cached_contract
)
signer = MockSigner(123456789987654321)
USER = 999<commit_title>[PATCH] Eth account support (#361)<commi... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, str_to_felt, ZERO_ADDRESS, TRUE, FALSE, assert_revert, INVALID_UINT256,
assert_event_emitted, get_contract_class, cached_contract, to_uint, sub_uint, add_uint
)
<commit_title>[PATCH] Eth accou... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, str_to_felt, TRUE, FALSE, get_contract_class, cached_contract,
assert_revert, to_uint
)
<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from sta... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, str_to_felt, ZERO_ADDRESS, INVALID_UINT256, assert_revert,
assert_event_emitted, get_contract_class, cached_contract, to_uint
)
<commit_title>[PATCH] Eth account support (#361)<commit_descript... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner, str_to_felt, MAX_UINT256, get_contract_class, cached_contract,
TRUE, assert_revert, to_uint, sub_uint, add_uint
)
<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_cod... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner,
assert_revert,
get_contract_class,
cached_contract,<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from starkware.starknet.testing.starkn... |
<vulnerable_code>import pytest
from starkware.starknet.testing.starknet import Starknet
from utils import (
MockSigner,
assert_revert,
assert_revert_entry_point,
assert_event_emitted,<commit_title>[PATCH] Eth account support (#361)<commit_description><fixed_code>
import pytest
from starkware.starknet.te... |
<vulnerable_code>from starkware.starkware_utils.error_handling import StarkException
from starkware.starknet.testing.starknet import StarknetContract
from starkware.starknet.business_logic.execution.objects import Event
from nile.signer import Signer
MAX_UINT256 = (2**128 - 1, 2**128 - 1)
deploy_execution_inf... |
<vulnerable_code> /* listeners have SOCK_RCU_FREE, not the children */
sock_reset_flag(newsk, SOCK_RCU_FREE);
newsk->sk_mark = inet_rsk(req)->ir_mark;
atomic64_set(&newsk->sk_cookie,
atomic64_read(&inet_rsk(req)->ir_cookie));<commit_title>[PATCH] dccp/tcp: do not inherit mc_list from parent<commit_descr... |
<vulnerable_code> retval = ENOMEM;
goto cleanup;
}
strlcpy(comp1_str,comp1->data,comp1->length+1);
if ((krb5_princ_type(kdc_context, request->server) == KRB5_NT_SRV_HST ||
krb5_princ_type(kdc_context, request->server) == KRB5_NT_SRV_INST ||
re... |
<vulnerable_code>void read_func(void *data) {
TaskData *td = (TaskData *) data;
td->es->handle_readable_event(td->event);
EpollContext *hc = (EpollContext *) td->event.data.ptr;
if (hc != NULL) {
hc->_ctx_status = CONTEXT_READ_OVER;
}
delete td;
}
if (ret == READ_CLOSE) {
r... |
<vulnerable_code> LOG_INFO("TOO BIG REQUEST WE WILL REFUSE IT! MAX_REQ_SIZE:%d", MAX_REQ_SIZE);
return -1;
}
LOG_DEBUG("read from client: size:%d, content:%s", read_size, read_buffer);
ssize_t nparsed = http_parser_execute(&_parser, &_settings, read_buffer, read_size);
if (nparsed != read... |
<vulnerable_code><commit_title>[PATCH] fix log overflow & epoll_context use after free bug<commit_description><fixed_code>
#!/usr/bin/env python3
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 8080))
sock.send(b"GET"*5000+b" /hello"*5000+b" HTTP/1.1\r\nHost:localhost... |
<vulnerable_code> Parse *pParse = pWalker->pParse;
int i;
if( pParse->nErr ) return WRC_Abort;
if( ALWAYS(p->pEList) ){
ExprList *pList = p->pEList;
for(i=0; i<pList->nExpr; i++){
** descend into sub-select statements.
*/
static int renameColumnSelectCb(Walker *pWalker, Select *p){
renameWalkWith(pWalk... |
<vulnerable_code> ** allocated rather than point to the input string - which means that
** they will persist after the current sqlite3_exec() call returns.
*/
if( IN_RENAME_OBJECT ){
p->pSelect = pSelect;
pSelect = 0;<commit_title>[PATCH] Avoid infinite recursion in the ALTER TABLE code when a view<commi... |
<vulnerable_code> return 0;
}
int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
rpmpsm psm, char ** failedFile)
{
if (rc)
goto exit;
if (rpmteType(te) == TR_ADDED)
fi = rpmfiNewArchiveReader(payload, files, RPMFI_ITER_READ_ARCHIVE);
else
fi = rpmfilesIter(files, RPMFI_ITER... |
<vulnerable_code>#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#ifdef ENABLE_DMALLOC
dmalloc_shutdown();
#endif
return 0;
}
<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite likel... |
<vulnerable_code>{
int optct, rcode;
pcap_t *dlt_pcap;
#ifdef ENABLE_FRAGROUTE
char ebuf[FRAGROUTE_ERRBUF_LEN];
#endif
tcprewrite_init();
/* call autoopts to process arguments */
#endif
/* avoid making STDIN non-blocking */
int nb = 0;
ioctl(0, FIONBIO, &nb)
return 0;
}<commit_tit... |
<vulnerable_code>#include <ctype.h>
#include <unistd.h>
#ifdef DEBUG
extern int debug;
#endif
return result;
}<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite likely sets `O_NDELAY` which is
proper for most posix systems as this is the new... |
<vulnerable_code> tcpdump_close(options.tcpdump);
#endif
return 0;
}
<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite likely sets `O_NDELAY` which is
proper for most posix systems as this is the newer flag and they
likely treat both si... |
<vulnerable_code> } else if (backwards && caplentoobig) {
printf("BAD_TS|TOOBIG");
}
}
}
exit(0);
}
/**<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite likely sets `O_NDELAY` which i... |
<vulnerable_code> printf("----------------------------------------------------------\n\n");
free(sched);
return 0;
}
/*end of main() function*/<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite likely sets `O_NDELAY` which is
proper... |
<vulnerable_code>#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <errno.h>
{
int optct, rcode;
pcap_t *dlt_pcap;
int nb = 0;
#ifdef ENABLE_FRAGROUTE
char ebuf[FRAGROUTE_ERRBUF_LEN];
#endif
tcprewrite_init();
/* call autoopts t... |
<vulnerable_code>}
/**
* Returns ipv6 header length wth all ipv6 options on success
* -1 on error
*/
static int
return TCPEDIT_OK;
}
static void ipv4_l34_csum_replace(uint8_t *data, uint8_t protocol,
uint32_t old, uint32_t new)
{<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when usin... |
<vulnerable_code> }
}
/* do we need to fix checksums? -- must always do this last! */
if ((tcpedit->fixcsum || needtorecalc)) {
if (ip_hdr != NULL) {<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite likely sets `O_ND... |
<vulnerable_code>
/**
* Checks to see if the given integer exists in the LIST.
*/
tcpr_dir_t
check_list(tcpr_list_t * list, COUNTER value)
do {
if ((current->min != 0) && (current->max != 0)) {
if ((value >= current->min) && (value <= current->max))
return TCPR_DIR_C2S;
... |
<vulnerable_code> /* look for include or exclude LIST match */
if (options->xX.list != NULL) {
if (options->xX.mode < xXExclude) {
if (!check_list(options->xX.list, packetnum)) {
add_cache(&(options->cachedata), DONT_SEND, 0);
continue;
... |
<vulnerable_code> return TCPEDIT_ERROR;
}
ctx->decoded_extra = safe_malloc(sizeof(en10mb_extra_t));
plugin->config = safe_malloc(sizeof(en10mb_config_t));
config = (en10mb_config_t *)plugin->config;
/* init vlan user values to -1 to indicate not set */
if (ctx->decoded_extra != ... |
<vulnerable_code> }
/* allocate memory for our deocde extra data */
if (sizeof(hdlc_extra_t) > 0)
ctx->decoded_extra = safe_malloc(sizeof(hdlc_extra_t));
/* allocate memory for our config data */
if (sizeof(hdlc_config_t) > 0)
plugin->config = safe_malloc(sizeof(hdlc_config_t));... |
<vulnerable_code> return TCPEDIT_ERROR;
}
/* allocate memory for our deocde extra data */
if (sizeof(ieee80211_extra_t) > 0)
ctx->decoded_extra = safe_malloc(sizeof(ieee80211_extra_t));
/* allocate memory for our config data */
if (sizeof(ieee80211_config_t) > 0)
plugin-... |
<vulnerable_code> }
/* allocate memory for our config data */
if (sizeof(jnpr_ether_config_t) > 0)
plugin->config = safe_malloc(sizeof(jnpr_ether_config_t));
return TCPEDIT_OK; /* success */
}
if (ctx->decoded_extra != NULL) {
safe_free(ctx->decoded_extra);
ctx->decoded_... |
<vulnerable_code> return TCPEDIT_ERROR;
}
/* allocate memory for our deocde extra data */
if (sizeof(linuxsll_extra_t) > 0)
ctx->decoded_extra = safe_malloc(sizeof(linuxsll_extra_t));
/* allocate memory for our config data */
if (sizeof(linuxsll_config_t) > 0)
plugin->config... |
<vulnerable_code> if (ctx->decoded_extra != NULL) {
safe_free(ctx->decoded_extra);
ctx->decoded_extra = NULL;
}
if (plugin->config != NULL) {
safe_free(plugin->config);
plugin->config = NULL;
}
return TCPEDIT_OK; /* success */<commit_title>[PATCH 01/36] Avoid... |
<vulnerable_code> return TCPEDIT_ERROR;
}
/* allocate memory for our deocde extra data */
if (sizeof(radiotap_extra_t) > 0)
ctx->decoded_extra = safe_malloc(sizeof(radiotap_extra_t));
/* allocate memory for our config data */
if (sizeof(radiotap_config_t) > 0)
plugin->config... |
<vulnerable_code> return TCPEDIT_ERROR;
}
/* allocate memory for our deocde extra data */
if (sizeof(user_extra_t) > 0)
ctx->decoded_extra = safe_malloc(sizeof(user_extra_t));
/* allocate memory for our config data */
if (sizeof(user_config_t) > 0)
plugin->config = safe_... |
<vulnerable_code>
/* just need to copy the ptr */
ctx->decoded_extra = subctx->decoded_extra;
/*
* the first decoder should of alraedy specified it's l2len, so we need to<commit_title>[PATCH 01/36] Avoid non-blocking behaviour when using STDIN<commit_description>While on BSD systems, tcprewrite l... |
<vulnerable_code>int
tcpdump_print(tcpdump_t *tcpdump, struct pcap_pkthdr *pkthdr, const u_char *data)
{
struct pollfd poller[1];
int result;
char decode[TCPDUMP_DECODE_LEN];
assert(tcpdump);
assert(pkthdr);
assert(data);
poller[0].fd = tcpdump->infd;
poller[0].events = POLLOUT;
po... |
<vulnerable_code> }
}
#if 0
/*
* this API is broken right now. This needs to be handled via a pipe or
* something else so we can pass the output up to the calling programm
*/
#ifdef ENABLE_VERBOSE
if (ctx->options->verbose) {
/* in cache mode, we may not have opened the file */
if ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.