text
stringlengths
79
3.72M
<vulnerable_code> else: return False def subprocess_sp(logger, cmd, shell=True): if logger is not None: logger.info("running: %s" % cmd) try: sp = sub_process.Popen(cmd, shell=shell, stdout=sub_process.PIPE, stderr=sub_process.PIPE, close_fds=True) except OSError: if logge...
<vulnerable_code> interested in maximum security should take that route. """ template = self.get_command_template() template_file = open(template, "r") meta = utils.blender(self.api, False, self.system) meta["power_mode"] = desired_state if self.force_pass is not...
<vulnerable_code> ["virt_auto_boot","<<inherit>>",0,"Virt Auto Boot",True,"Auto boot this VM?",0,"bool"], ["ctime",0,0,"",False,"",0,"float"], ["mtime",0,0,"",False,"",0,"float"], ["power_type","SETTINGS:power_management_default_type",0,"Type",True,"Power management script to use",utils.get_power_types(),"str"],...
<vulnerable_code> Return all possible power types """ power_types = [] power_template = re.compile(r'power_(.*).template') for x in glob.glob("/etc/cobbler/power/power_*.template"): power_types.append(power_template.search(x).group(1)) power_types.sort() return power_types Return ...
<vulnerable_code>import traceback import unittest.mock from contextlib import contextmanager from typing import Any, Callable, Dict, Generator, List, Set, Type, TypeVar from parameterized import parameterized from pydantic import BaseModel as PydanticBaseModel, conbytes, confloat, conint, constr from pydantic.typing i...
<vulnerable_code><commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from 2 to 3 (#16375)<commit_description>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com><fixed_code> # Copyright 2023 Maxwell G <maxwell@gtmx.me> # # Licensed under the Apache License, Version 2.0 (the "Licen...
<vulnerable_code># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from typing import Any, Dict, Type, TypeVar import jsonschema from pydantic import BaseModel, ValidationError, parse_obj_as ...
<vulnerable_code> import argparse import logging from typing import Any, Dict, List, Optional, Union import attr from pydantic import BaseModel, Extra, StrictBool, StrictInt, StrictStr from synapse.config._base import ( Config,<commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from 2 to 3 (#16375)<commit...
<vulnerable_code># See the License for the specific language governing permissions and # limitations under the License. import collections.abc from typing import List, Type, Union, cast import jsonschema from pydantic import Field, StrictBool, StrictStr from synapse.api.constants import ( MAX_ALIAS_LENGTH,<commit...
<vulnerable_code> overload, ) from pydantic import BaseModel, MissingError, PydanticValueError, ValidationError from pydantic.error_wrappers import ErrorWrapper from typing_extensions import Literal from twisted.web.server import Request<commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from 2 to 3 (#1637...
<vulnerable_code>from typing import TYPE_CHECKING, List, Optional, Tuple from urllib.parse import urlparse from pydantic import StrictBool, StrictStr, constr from typing_extensions import Literal from twisted.web.server import Request<commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from 2 to 3 (#16375)<com...
<vulnerable_code>from http import HTTPStatus from typing import TYPE_CHECKING, List, Optional, Tuple from pydantic import Extra, StrictStr from synapse.api import errors from synapse.api.errors import NotFoundError, SynapseError, UnrecognizedRequestError<commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from...
<vulnerable_code>import logging from typing import TYPE_CHECKING, List, Optional, Tuple from pydantic import StrictStr from typing_extensions import Literal from twisted.web.server import Request<commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from 2 to 3 (#16375)<commit_description>Co-authored-by: dependa...
<vulnerable_code># limitations under the License. from typing import TYPE_CHECKING, Dict, Optional from pydantic import Extra, StrictInt, StrictStr, constr, validator from synapse.rest.models import RequestBodyModel from synapse.util.threepids import validate_email<commit_title>[PATCH 02/14] Bump docker/setup-buildx-...
<vulnerable_code>import re from typing import TYPE_CHECKING, Dict, Mapping, Optional, Set, Tuple from pydantic import Extra, StrictInt, StrictStr from signedjson.sign import sign_json from twisted.web.server import Request<commit_title>[PATCH 02/14] Bump docker/setup-buildx-action from 2 to 3 (#16375)<commit_descript...
<vulnerable_code># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from pydantic import BaseModel, Extra class RequestBodyModel(BaseModel):<commit_title>[PATCH 02/14] Bump docker/setup-build...
<vulnerable_code>) import attr from pydantic import BaseModel from synapse.metrics.background_process_metrics import run_as_background_process from synapse.storage.engines import PostgresEngine from synapse.storage.types import Connection, Cursor from . import engines if TYPE_CHECKING: from synapse.server impor...
<vulnerable_code># See the License for the specific language governing permissions and # limitations under the License. import unittest as stdlib_unittest from pydantic import BaseModel, ValidationError from typing_extensions import Literal from synapse.rest.client.models import EmailRequestTokenBody class Threepid...
<vulnerable_code> @property def description( self, ) -> Optional[ Sequence[ Tuple[ str, Optional[Any], Optional[int], Optional[int], Optional[int], Optional[int], Option...
<vulnerable_code> @property def description( self, ) -> Optional[ Sequence[ # Note that this is an approximate typing based on sqlite3 and other # drivers, and may not be entirely accurate. # FWIW, the DBAPI 2 spec is: https://peps.python.org/pep-0249/#desc...
<vulnerable_code> groups: List[int], state_filter: Optional[StateFilter] = None, ) -> Mapping[int, StateMap[str]]: state_filter = state_filter or StateFilter.all() results: Dict[int, MutableStateMap[str]] = {group: {} for group in groups} if where_clause: ...
<vulnerable_code> states, ) for destination, host_states in hosts_to_states.items(): await self._federation.send_presence_to_destinations( host_states, [destination] ) async def send_full_presence_to_users(self, user_ids: StrCollection) -> None: ...
<vulnerable_code> from twisted.web.http import Request from synapse.api.constants import MAX_GROUP_CATEGORYID_LENGTH, MAX_GROUP_ROLEID_LENGTH, MAX_GROUPID_LENGTH from synapse.api.errors import Codes, SynapseError from synapse.handlers.groups_local import GroupsLocalHandler from synapse.http.servlet import (<commit_tit...
<vulnerable_code>import eionet.cr.web.util.ApplicationCache; import eionet.cr.web.util.columns.SearchResultColumn; import eionet.cr.web.util.columns.SubjectPredicateColumn; /** * } public void setSearchTag(String searchTag) { this.searchTag = searchTag; } public List<String> getSelectedTags(...
<vulnerable_code> * the resourceUri to set */ public void setUri(final String resourceUri) { this.uri = resourceUri; } /**<commit_title>[PATCH] - Security upgrades for xss prevention<commit_description><fixed_code> * the resourceUri to set */ public void...
<vulnerable_code> } strcat(full_path, "/"); strncat(full_path, name, sizeof(full_path) - strlen(full_path)); if (xinode->is_loc_resource) {<commit_title>[PATCH 03/52] Strip the installed X11rdp binary, not the original<commit_description><fixed_code> } strcat(full_path, "/"); strncat(f...
<vulnerable_code> #include "sesman.h" #define _XOPEN_SOURCE #include <stdio.h> #include <sys/types.h> #include <crypt.h> #include <shadow.h> extern struct config_sesman *g_cfg; /* in sesman.c */ static int DEFAULT_CC auth_crypt_pwd(char *pwd, char *pln, char *crp); static int DEFAULT_CC auth_account_disabled(struct ...
<vulnerable_code> */ static int DEFAULT_CC auth_crypt_pwd(char* pwd, char* pln, char* crp) { return 0; }<commit_title>[PATCH 03/52] Strip the installed X11rdp binary, not the original<commit_description><fixed_code> */ static int DEFAULT_CC auth_crypt_pwd(const char *pwd, const char *pln, char *crp) { return...
<vulnerable_code> struct user_info { char *name; char *pass; }; /******************************************************************************/ static int k5_kinit(struct k_opts *opts, struct k5_data *k5, struct user_info *u_info) { char *doing; int notix = 1; krb5_keytab keytab = 0; krb5_cred...
<vulnerable_code>/******************************************************************************/ /* returns error */ int DEFAULT_CC auth_start_session(void) { return 0; } /******************************************************************************/ int DEFAULT_CC auth_end(void) { return 0; } /************...
<vulnerable_code> if (fd == -1) { log_message(LOG_LEVEL_WARNING, "can't write vnc password hash file - %s", filename); return 1; } g_file_write(fd, encryptedPasswd, 8);<commit_title>[PATCH 03/52] Strip the installed X11rdp binary, not the original<c...
<vulnerable_code> { /* if no auth_file_path is set, then we go for $HOME/.vnc/sesman_username_passwd */ if (g_mkdir(".vnc") < 0) { log_message(LOG_LEVEL_ERROR, "env...
<vulnerable_code> memcpy(cp, log_path, strlen(log_path)); memcpy(cp + strlen(log_path), "/xrdp", strlen("/xrdp") + 1); if (g_directory_exist(cp) || g_mkdir(cp)) { log_path = cp; } else { free(cp); } ...
<vulnerable_code> log_path = g_getenv("XDG_DATA_HOME"); if (log_path != 0) { cp = malloc(strlen(log_path) + strlen("/xrdp") + 1); if (cp != 0) { log_path = g_getenv("HOME"); if (log_path != 0) { cp = malloc(strlen(log_path) ...
<vulnerable_code> /* if autorun is configured in xrdp.ini, we enforce that module to be loaded */ g_strncpy(section_name, autorun_name, 255); } else if (self->session->client_info->domain[0] != '_') { /* domain names that starts with '_'...
<vulnerable_code> const unsigned char *p; php_unserialize_data_t var_hash; zval *options = NULL, *classes = NULL; HashTable *class_hash = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &options) == FAILURE) { } } if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, cl...
<vulnerable_code> inp, array_ops.placeholder( dtypes.int32, shape=[3])) if __name__ == "__main__": test.main()<commit_title>[PATCH] Fix tf.tile crash when n is large<commit_description>This PR tries to fix the issue raised in 46911 where tf.tile will crash when n is large. This PR add additio...
<vulnerable_code> spos = a->start.pos; epos = a->end.pos; } if (a->start.line != a->end.line || spos > epos) epos = spos; pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col, rows > 1, form->type == FORM_INPUT_PASSWORD);<commit_title>[PATCH] Prevent segfault for formUpdateB...
<vulnerable_code><commit_title>[PATCH] Disable message interpolation in ConstraintViolations by<commit_description><fixed_code> /* * Hibernate Validator, declare and validate application constraints * * License: Apache License, Version 2.0 * See the license.txt file in the root directory or <http://www.apache.org/l...
<vulnerable_code>import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The annotated element has methods annotated by Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; }<commit_title>[PATCH] Disable message...
<vulnerable_code> private final AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration.StdConfiguration(AnnotationInclusion.INCLUDE_AND_INHERIT_IF_INHERITED); private final TypeResolver typeResolver = new TypeResolver(); private final MemberResolver memberResolver = new MemberResolver(...
<vulnerable_code>package io.dropwizard.validation.selfvalidating; import javax.annotation.Nullable; import javax.validation.ConstraintValidatorContext; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * This class is a simple wrapper around the ConstraintValidatorContext of hibernate validation. ...
<vulnerable_code>package io.dropwizard.validation; import io.dropwizard.validation.selfvalidating.SelfValidating; import io.dropwizard.validation.selfvalidating.SelfValidation; import io.dropwizard.validation.selfvalidating.ViolationCollector; import javax.annotation.concurrent.NotThreadSafe; import javax.validation....
<vulnerable_code>import logging from logging.handlers import RotatingFileHandler import random import re pm.setup() app = Flask(__name__) app.config.update(WTF_CSRF_ENABLED=False) handler = RotatingFileHandler('poems.log', maxBytes=10000, backupCount=1) handler.setLevel(logging.INFO)<commit_title>[PATCH] haha actual...
<vulnerable_code># https://data-flair.training/blogs/django-send-email/ # Using flask for RFS and django.core.mail as email library from flask import request, Flask from django.core.mail import send_mail, mail_admins, mail_managers @app.route("/send") def send(): """ https://github.com/django/django/blob/ca987290...
<vulnerable_code># https://pythonhosted.org/Flask-Mail/ # https://github.com/mattupstate/flask-mail/blob/1709c70d839a7cc7b1f7eeb97333b71cd420fe32/flask_mail.py#L239 from flask import request, Flask from flask_mail import Mail, Message # The message can contain a body and/or HTML: msg.body = "plain-text body" m...
<vulnerable_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 subject = "Sending with SendGrid is Fun" content = Content("text/html", request.args...
<vulnerable_code># This tests that the developer doesn't pass tainted user data into the mail.send.post() method in the SendGrid library. # source :https://github.com/sendgrid/sendgrid-python import sendgrid import os sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) data = { "asm": { "g...
<vulnerable_code># This test checks that the developer doesn't pass a MIMEText instance to a MIMEMultipart initializer via the subparts parameter. # source꞉ https꞉//www.programcreek.com/python/example/53141/email.MIMEMultipart.MIMEMultipart from flask import Flask, request import json import smtplib, ssl @app.route(...
<vulnerable_code># This test checks that the developer doesn't pass a MIMEText instance to a MIMEMultipart message. # source꞉ https꞉//realpython.com/python-send-email/ from flask import Flask, request import json import smtplib, ssl @app.route("/") def email_person(): sender_email = "my@gmail.com" receiver_ema...
<vulnerable_code> ''' if not isinstance(tgpath, six.string_types): tgpath = '/'.join(list(tgpath)) if tgpath.startswith('/'): webpath = (config.get('server.webpath') or '').rstrip('/') if tg_util.request_available():<commit_title>[PATCH] Disable covert redirects and CSRF token leaking...
<vulnerable_code> // To normalize a byte sequence potentialValue, remove // any leading and trailing HTTP whitespace bytes from // potentialValue. return potentialValue.replace( /^[\r\n\t ]+|[\r\n\t ]+$/g, '' ) } function fill (headers, object) {<commit_title>[PATCH] Merge pull request from GHSA-r6...
<vulnerable_code> t.end() }) tap.test('Headers.prototype.getSetCookie', (t) => { t.test('Mutating the returned list does not affect the set-cookie list', (t) => { const h = new Headers([ }) t.end() })<commit_title>[PATCH] Merge pull request from GHSA-r6ch-mqf9-qc9w<commit_description>Refs: https://hackeron...
<vulnerable_code> TEST_ASSERT_NULL(ipv6_addr_from_str(&result, ":ff::1")); } static void test_ipv6_addr_from_str__three_colons(void) { ipv6_addr_t result; new_TestFixture(test_ipv6_addr_to_str__success4), new_TestFixture(test_ipv6_addr_to_str__success5), new_TestFixture(test_ipv6_addr_fr...
<vulnerable_code> }); }); describe('existing session, but not passing a callback argument', function() { var passport = new Passport(); passport.serializeUser(function(user, done) {<commit_title>[PATCH] Add tests.<commit_description><fixed_code> }); }); describe('encount...
<vulnerable_code> GCfunc *fn; if (*what == '>') { TValue *func = L->top - 1; api_check(L, tvisfunc(func)); fn = funcV(func); L->top--; what++;<commit_title>[PATCH] Fix vulnerability in debug.getinfo<commit_description><fixed_code> GCfunc *fn; if (*what == '>') { TValue *func = L->top - 1;...
<vulnerable_code> pre_dispatch: {'all', integer, or expression, as in '3*n_jobs'} The number of batches (of tasks) to be pre-dispatched. Default is '2*n_jobs'. When batch_size="auto" this is reasonable default and the workers should never starve. batch_size: int or 'au...
<vulnerable_code> const affectedPaths = ['GET /api/user/{userslug}/edit/email']; if (affectedPaths.includes(`${method.toUpperCase()} ${path}`)) { await request({ uri: `${nconf.get('url')}/register/abort`, method: 'POST', jar, simple: false,<commit_title>[PATCH] fix: pass csrf_...
<vulnerable_code> describe('account pages', () => { let jar; before(async () => { ({ jar } = await helpers.loginUser('foo', 'barbar')); }); it('should redirect to account page with logged in user', (done) => { assert.strictEqual(res.body, '/register/complete'); await requestAsync({ uri: `${nconf...
<vulnerable_code> describe('profile methods', () => { let uid; let jar; before(async () => { const newUid = await User.create({ username: 'updateprofile', email: 'update@me.com', password: '123456' }); await User.setUserField(uid, 'email', 'update@me.com'); await User.email.confirmByUid(uid); ({ jar...
<vulnerable_code> 1. Checks URL and timestamp against the database cache and returns the result if it has not expired and was successful (a 2xx return code). 2. Checks if the URL matches an oEmbed (https://oembed.com/) pattern. If it does, update the URL to download. 3. Downloads...
<vulnerable_code> if (bitmap->left > metrics->width) metrics->width=bitmap->left; } } FT_Done_Glyph(glyph.image); } metrics->bounds.x1/=64.0; metrics->bounds.y1/=64.0;<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/781<commit_descrip...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import com.liferay.dynamic.data.mapping.expression.DDMExpressionFunction; <commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.im...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import com.liferay.dynamic.data.mapping.expression.DDMExpressionFunction; import com.liferay.portal.kernel.util.StringBundler;<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ packag...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import com.liferay.dynamic.data.mapping.expression.DDMExpressionFunction; import com.liferay.portal.kernel.util.StringUtil;<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package c...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import com.liferay.dynamic.data.mapping.expression.DDMExpressionFunction; import com.liferay.portal.kernel.util.Validator;<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package co...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import org.junit.Assert; import org.junit.Test; /** * @author Leonardo Barros */<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package com.liferay.dynamic.data.mapping.form.eva...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import org.junit.Assert; import org.junit.Test; /** * @author Leonardo Barros */<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package com.liferay.dynamic.data.mapping.form.eva...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import org.junit.Assert; import org.junit.Test; /** * @author Leonardo Barros */<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package com.liferay.dynamic.data.mapping.form.eva...
<vulnerable_code> * details. */ package com.liferay.dynamic.data.mapping.form.evaluator.functions; import org.junit.Assert; import org.junit.Test; /** * @author Leonardo Barros */<commit_title>[PATCH] LPS-71167 Move<commit_description><fixed_code> * details. */ package com.liferay.dynamic.data.mapping.form.eva...
<vulnerable_code> u32 prop_type = 0; char *data=NULL, *data2=NULL; ISOM_DECREASE_SIZE_NO_ERR(ptr, 18) s32 tag_size = gf_bs_read_u32(bs); u32 name_size = gf_bs_read_u32(bs); tag_size -= 8; if (name_size >= (u32)0xFFFFFFFF) { GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Invalid name_size %lu in x...
<vulnerable_code> status.setDaemon(True) status.start() # run the conversations test_classes = self.log.get_classes() # prepend the conversations with few warm-up ones exp_len = WARM_UP + sum(1 for _ in self.log.iterate_log()) self.log.read_log() queries =...
<vulnerable_code> # Handle action form = SshForm() if action == "add": self._add_key(action, form) elif action == 'delete': self._delete_key(action, DeleteSshForm()) # Get SSH keys if file exists.<commit_title>[PATCH] Mitigate CSRF in profile's SSH Keys #...
<vulnerable_code> self.assertInBody("Invalid SSH key.") self.assertEqual(0, len(list(user.authorizedkeys))) def test_delete(self): # Delete existing keys user = self.app.store.get_user('admin')<commit_title>[PATCH] Mitigate CSRF in profile's SSH Keys #212<commit_description><fixed_co...
<vulnerable_code> mbedtls_x509_sequence *cur = NULL; mbedtls_pk_type_t pk_type; if( profile == NULL ) return( MBEDTLS_ERR_X509_BAD_INPUT_DATA ); *flags = 0; if( cn != NULL ) { name = &crt->subject; ret = x509_crt_verify_top( crt, parent, ca_crl, profile, ...
<vulnerable_code><commit_title>[PATCH] XWIKI-20610: Notification RSS feed is parsed as XWiki syntax<commit_description>* Write the feed directly to the response. * Use the source parameter of the code macro. * Add page test.<fixed_code> /* * See the NOTICE file distributed with this work for additional * information ...
<vulnerable_code> if (!unicode_type && (szLine[i] & 0x80)) { /*non UTF8 (likely some win-CP)*/ if ((szLine[i+1] & 0xc0) != 0x80) { szLineConv[j] = 0xc0 | ( (szLine[i] >> 6) & 0x3 ); j++; szLine[i] &= 0xbf; } /*UTF8 2 bytes char*/ else if ( (szLine[i] & 0xe0) == 0xc0) { szLineCo...
<vulnerable_code> return ret; } static void install_update_cb(void) { struct coap_packet response_packet; char buffer[3], sha256_image_dowloaded[TC_SHA256_BLOCK_SIZE + 1]; u8_t *data = k_malloc(MAX_DOWNLOAD_DATA); int i, buffer_len = 0; int rcvd = -1; if (data == NULL) { } if (ctx.downloaded_size == ctx.bloc...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4153, /**/<commit_title>[PATCH] patch 8.2.4154: ml_get error when exchanging windows in<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4154,...
<vulnerable_code> (void)win_comp_pos(); // recompute window positions win_enter(wp, TRUE); redraw_all_later(NOT_VALID); } win_alloc_lines(win_T *wp) { wp->w_lines_valid = 0; wp->w_lines = ALLOC_CLEAR_MULT(wline_T, Rows ); if (wp->w_lines == NULL) return FAIL; return OK;<commit_title>[PATC...
<vulnerable_code> *off = 0; *len = 0; /* error reqeusts do not have data area */ if (hdr->Status && hdr->Status != STATUS_MORE_PROCESSING_REQUIRED && (((struct smb2_err_rsp *)hdr)->StructureSize) == SMB2_ERROR_STRUCTURE_SIZE2_LE) return ret; /* * Following commands have data areas so we have to get the l...
<vulnerable_code> "JOB_STATE_DRAINED while it is a batch job" ) if not self._wait_until_finished and current_state == self._expected_terminal_state: return True if current_state in DataflowJobStatus.AWAITING_STATES:<commit_title>[PATCH 3/8] Fix the logic ...
<vulnerable_code> @pytest.mark.parametrize( "job_state, wait_until_finished, expected_result", [ # RUNNING (DataflowJobStatus.JOB_STATE_RUNNING, None, False), (DataflowJobStatus.JOB_STATE_RUNNING, True, False),<commit_title>[PATCH 3/8] Fix the logic of checking dat...
<vulnerable_code>) ARG_INTERNAL_API_HOSTNAME = Arg( ("-H", "--hostname"), default="0.0.0.0", help="Set the hostname on which to run the web server", ) ARG_INTERNAL_API_ACCESS_LOGFILE = Arg(<commit_title>[PATCH 3/8] Fix the logic of checking dataflow job state (#34785)<commit_description>Co-authored-by: Elad...
<vulnerable_code> log.info(f"Starting the Internal API server on port {args.port} and host {args.hostname}.") app = create_app(testing=conf.getboolean("core", "unit_test_mode")) app.run( debug=True, use_reloader=not app.config["TESTING"], port=args.port, ...
<vulnerable_code>from collections import deque import jinja2 def _balance_parens(after_decorator): loader=template_loader, undefined=jinja2.StrictUndefined ) else: template_env = jinja2.Environment(loader=template_loader, undefined=jinja2.StrictUndefined) template = template_env.g...
<vulnerable_code>from __future__ import annotations import datetime import ftplib from typing import Any, Callable from airflow.hooks.base import BaseHook if self.conn is None: params = self.get_connection(self.ftp_conn_id) pasv = params.extra_dejson.get("passive", True) se...
<vulnerable_code> import os import socket from ftplib import FTP_PORT from functools import cached_property from pathlib import Path from typing import Any, Sequence<commit_title>[PATCH 3/8] Fix the logic of checking dataflow job state (#34785)<commit_description>Co-authored-by: Elad Kalif <45845474+eladkal@users.norep...
<vulnerable_code># under the License. from __future__ import annotations import ftplib import re from typing import TYPE_CHECKING, Sequence <commit_title>[PATCH 3/8] Fix the logic of checking dataflow job state (#34785)<commit_description>Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com><fixed_cod...
<vulnerable_code>from pathlib import Path import jinja2 from airflow.utils.decorators import remove_task_decorator as _remove_task_decorator from airflow.utils.process_utils import execute_in_subprocess loader=template_loader, undefined=jinja2.StrictUndefined ) else: template_env = jin...
<vulnerable_code> PRE_COMMIT_LIST = [ "all", "blacken-docs", "check-aiobotocore-optional", "check-airflow-k8s-not-used",<commit_title>[PATCH 3/8] Fix the logic of checking dataflow job state (#34785)<commit_description>Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com><fixed_code> P...
<vulnerable_code>from typing import TYPE_CHECKING, Any, Callable, Collection, Container, Iterable, Sequence import jwt from flask import flash, g, session from flask_appbuilder import const from flask_appbuilder.const import ( ) from flask_appbuilder.models.sqla import Base from flask_appbuilder.models.sqla.interface ...
<vulnerable_code> This deletes any permission that is no longer part of any registered view or menu. Only invoke AFTER YOU HAVE REGISTERED ALL VIEWS. """ self.sm.security_cleanup(self.baseviews, self.menu) def security_converge(self, dry=False) -> dict:<commit_title>[PATCH 3/...
<vulnerable_code>from __future__ import annotations import logging from typing import TYPE_CHECKING import re2 from flask import g, session, url_for from flask_appbuilder.security.registerviews import ( RegisterUserDBView, RegisterUserOAuthView, RegisterUserOIDView, ) from flask_appbuilder.security.views ...
<vulnerable_code>from typing import TYPE_CHECKING, Callable from flask import g from sqlalchemy import select from airflow.auth.managers.fab.security_manager.constants import EXISTING_ROLES as FAB_EXISTING_ROLES from airflow.utils.log.logging_mixin import LoggingMixin from airflow.utils.session import NEW_SESSION, pr...
<vulnerable_code> :param data: The data to pass. POST-data in POST/PUT and params in the URL for a GET request. (templated) :param headers: The HTTP headers to be added to the GET request :param pagination_function: A callable that generates the parameters used to call the API again. Typicall...
<vulnerable_code> pagination_function is provided, and as long as this function returns a dictionary that override previous' call parameters. """ has_returned: bool = False def pagination_function(response: Response) -> dict | None: """Paginated function which returns...
<vulnerable_code> configuration, you should make sure that you trust the users who can edit connections in the UI to not use it maliciously. 4. Patch the ``JdbcHook.default_driver_path`` and/or ``JdbcHook.default_driver_class`` values in the "local_settings.py" file. See :do...
<vulnerable_code> if cpe_regex not in vc: continue re_from_start = re.compile("^.*{}:".format(cpe_regex)) cpe_version = re_from_start.sub("", vc) # TODO: handle versions such as "1.1.3:p2"<commit_title>[PATCH] Fix Regular Expression in...
<vulnerable_code> createLongLongConfig("cluster-node-timeout", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, server.cluster_node_timeout, 15000, INTEGER_CONFIG, NULL, NULL), createLongLongConfig("slowlog-log-slower-than", NULL, MODIFIABLE_CONFIG, -1, LLONG_MAX, server.slowlog_log_slower_than, 10000, INTEGER_CONFIG, NUL...