text
stringlengths
79
3.72M
<vulnerable_code> }; // date uses session, not local. That way the dates reset between each visit. // Is a bit confusing when you log in and don't get the most recent data. const lsStartDate = sessionStorage.getItem("startDate"); const lsEndDate = sessionStorage.getItem("endDate"); let defaultStartDate; if (...
<vulnerable_code> case STRING: { PyObject *kind, *str = parsestrplus(c, n); const char *raw, *s = STR(CHILD(n, 0)); int quote = Py_CHARMASK(*s); /* currently Python allows up to 2 string modifiers */ char *ch, s_kind[3] = {0, 0, 0}; ch = s_kind; PyErr_F...
<vulnerable_code>#include "Python.h" #include "Python-ast.h" #include "compile.h" #include "node.h" #include "grammar.h" #include "token.h" PyCompilerFlags localflags; perrdetail err; int iflags = PARSER_FLAGS(flags); node *n = Ta3Parser_ParseStringObject(s, filename, ...
<vulnerable_code> else: lines = [s] for line in lines: line = (" " * TABSIZE * depth) + line + "\n" self.file.write(line) class TypeDefVisitor(EmitVisitor): def visitField(self, field, name, sum=None, prod=None, depth=0): ctype = get_c_type(field.type) ...
<vulnerable_code> if (d->d_type == type) return d; } assert(0); /* NOTREACHED */ #endif } <commit_title>[PATCH] Fully incorporate the code from Python 3.7.2 (#78)<commit_description>This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to da...
<vulnerable_code> Py_INCREF(err_ret->filename); tok->filename = err_ret->filename; #endif return parsetok(tok, g, start, err_ret, flags); } } else started = 1; len = b - a; /* XXX this may compute NULL - NULL */ str = (char *) PyObject_MALLOC(len + 1); if ...
<vulnerable_code> } while (0) #endif /* Py_XSETREF */ #define is_potential_identifier_start(c) (\ (c >= 'a' && c <= 'z')\ || (c >= 'A' && c <= 'Z')\ || c == '_'\ || (c >= 128)) #if PY_MINOR_VERSION >= 4 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, cons...
<vulnerable_code>/* Copyright (c) 2008-2009, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice...
<vulnerable_code> /* Computation of FIRST stets */ #include "pgenheaders.h" #include "grammar.h" #include "token.h" extern int Py_DebugFlag; /* Forward */ static void calcfirstset(grammar *, dfa *); void addfirstsets(grammar *g) { int i; dfa *d; if (Py_DebugFlag) printf("Adding FIRST sets ...\n...
<vulnerable_code> /* List a node on a file */ #include "pgenheaders.h" #include "token.h" #include "node.h" /* Forward */ static void list1node(FILE *, node *); static void listnode(FILE *, node *); void PyNode_ListTree(node *n) { listnode(stdout, n); } static int level, atbol; static void listnode(FILE *fp, n...
<vulnerable_code> #include "pgenheaders.h" #include "metagrammar.h" #include "grammar.h" #include "pgen.h" static arc arcs_0_0[3] = { {2, 0}, {3, 0}, {4, 1}, }; static arc arcs_0_1[1] = { {0, 1}, }; static state states_0[2] = { {3, arcs_0_0}, {1, arcs_0_1}, }; static arc arcs_1_0[1] = { {5, ...
<vulnerable_code>#include "Python.h" /* snprintf() wrappers. If the platform has vsnprintf, we use it, else we emulate it in a half-hearted way. Even if the platform has it, we wrap it because platforms differ in what vsnprintf does in case the buffer is too small: C99 behavior is to return the number of c...
<vulnerable_code>#include "Python.h" #include <stdbool.h> /* Defined in tracemalloc.c */ extern void _PyMem_DumpTraceback(int fd, const void *ptr); /* Python's malloc wrappers (see pymem.h) */ #undef uint #define uint unsigned int /* assuming >= 16 bits */ /* Forward declaration */ static void* _PyMem_Deb...
<vulnerable_code>/* Parser generator */ /* For a description, see the comments at end of this file */ #include "Python.h" #include "pgenheaders.h" #include "token.h" #include "node.h" #include "grammar.h" #include "metagrammar.h" #include "pgen.h" extern int Py_DebugFlag; extern int Py_IgnoreEnvironmentFlag; /* need...
<vulnerable_code> /* Parser generator main program */ /* This expects a filename containing the grammar as argv[1] (UNIX) or asks the console for such a file name (THINK C). It writes its output on two files in the current directory: - "graminit.c" gets the grammar as a bunch of initialized data - "gramini...
<vulnerable_code> /* Print a bunch of C initializers that represent a grammar */ #define PGEN #include "pgenheaders.h" #include "grammar.h" /* Forward */ static void printarcs(int, dfa *, FILE *); static void printstates(grammar *, FILE *); static void printdfas(grammar *, FILE *); static void printlabels(grammar *,...
<vulnerable_code>#include "Python.h" /* Our own locale-independent ctype.h-like macros */ const unsigned int _Py_ctype_table[256] = { 0, /* 0x0 '\x00' */ 0, /* 0x1 '\x01' */ 0, /* 0x2 '\x02' */ 0, /* 0x3 '\x03' */ 0, /* 0x4 '\x04' */ 0, /* 0x5 '\x05' */ 0, /* 0x6 '\x06' */ 0, /* 0x7 '\...
<vulnerable_code>}; typedef struct { PyObject_HEAD PyObject *dict; static void ast_dealloc(AST_object *self) { Py_CLEAR(self->dict); Py_TYPE(self)->tp_free(self); } return 0; } static void ast_clear(AST_object *self) { Py_CLEAR(self->dict); } static int ast_type_init(PyObject *self, PyObject...
<vulnerable_code>#include "node.h" #include "ast.h" #include "token.h" #include <assert.h> #if PY_MINOR_VERSION < 4 #define PyErr_ProgramTextObject PyErr_ProgramText #define PyMem_RawMalloc PyMem_Malloc #define PyMem_RawRealloc PyMem_Realloc #define PyMem_RawFree PyMem_Free #endif static int validate_stmts(asdl_seq...
<vulnerable_code> {2, arcs_80_0}, {1, arcs_80_1}, }; static arc arcs_81_0[2] = { {21, 1}, {102, 2}, }; static arc arcs_81_1[1] = { {102, 2}, }; static arc arcs_81_2[1] = { {67, 3}, }; static arc arcs_81_3[1] = { {103, 4}, }; static arc arcs_81_4[1] = { {113, 5}, }; static arc arcs_81_5[2]...
<vulnerable_code> # Lowest and highest supported Python 3 minor version (inclusive) MIN_VER = 4 MAX_VER = 6 NEXT_VER = MAX_VER + 1 <commit_title>[PATCH] Fully incorporate the code from Python 3.7.2 (#78)<commit_description>This is a full port, following the recipe in update_process.md. I've also tried to keep the reci...
<vulnerable_code> 'ast3/Include/asdl.h', 'ast3/Include/ast.h', 'ast3/Include/bitset.h', 'ast3/Include/compile.h', 'ast3/Include/errcode.h', 'ast3/Include/graminit.h', 'ast3/Include/grammar.h',<commit_title>[PATCH] Fully incorporate the code from Python 3.7.2 (#78)<...
<vulnerable_code>import _ast3 from _ast3 import * LATEST_MINOR_VERSION = 6 def parse(source, filename='<unknown>', mode='exec', feature_version=LATEST_MINOR_VERSION): """ When feature_version=4, the parser will forbid the use of the async/await keywords and the '@' operator, but will not forbid the use of...
<vulnerable_code>#include <ruby.h> #include "dl.h" VALUE rb_cDLHandle; void cflag = RTLD_LAZY | RTLD_GLOBAL; break; case 1: clib = NIL_P(lib) ? NULL : StringValuePtr(lib); cflag = RTLD_LAZY | RTLD_GLOBAL; break; case 2: clib = NIL_P(lib) ? NULL : StringValuePtr(lib); cflag = NUM2INT(fl...
<vulnerable_code> }); }); describe('onlyGovernance updates', function () { it('setVotingDelay is protected', async function () { await expectRevert(this.mock.setVotingDelay('0'), 'Governor: onlyGovernance');<commit_title>[PATCH] Merge pull request from GHSA-5h3x-9wvq-w4m2<commit_de...
<vulnerable_code> return range_within(rold, rcur) && tnum_in(rold->var_off, rcur->var_off); } else { /* if we knew anything about the old value, we're not * equal, because we can't know anything about the * scalar value of the pointer in the new value. */ return rold->umin_value == 0 && ...
<vulnerable_code> /* Create file */ if ((c = strstr(fname, ".pdf"))) *c = '\0'; new_fname = malloc(strlen(fname) + strlen(dirname) + 16); snprintf(new_fname, strlen(fname) + strlen(dirname) + 16, "%s/%s-version-%d.pdf", dirname, fname, xref->version); } int main(int argc, char **arg...
<vulnerable_code> const char *n; pdf_t *pdf; pdf = calloc(1, sizeof(pdf_t)); if (name) { else n = name; pdf->name = malloc(strlen(n) + 1); strcpy(pdf->name, n); } else /* !name */ { pdf->name = malloc(strlen("Unknown") + 1); str...
<vulnerable_code> njs_native_frame_t *active, *native; *frame = *vm->active_frame; frame->previous_active_frame = NULL; native = &frame->native; active = &vm->active_frame->native; value_count = njs_function_frame_value_count(active);<commit_title>[PATCH] Fixed frame allocation from an awaite...
<vulnerable_code> LOG_ERROR ("Invalid r2007 system page: page_size: %" PRId64, page_size); return NULL; } assert ((uint64_t)size_comp < dat->size); assert ((uint64_t)size_uncomp < dat->size); assert ((uint64_t)repeat_count < DBG_MAX_COUNT); (long)section_page->offset, (long)max...
<vulnerable_code> (void) memcpy(stream,header,12); count=ReadBlob(image,length-12,stream+12); if (count != (ssize_t) (length-12)) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); webp_status=WebPGetFeatures(stream,length,features); if (webp_status == VP8_STATUS_OK) { status=...
<vulnerable_code> if (!asoc) return -EINVAL; /* An association cannot be branched off from an already peeled-off * socket, nor is this supported for tcp style sockets. */ */ release_sock(sk); current_timeo = schedule_timeout(current_timeo); if (sk != asoc->base.sk) goto do_error; lock_sock(sk); ...
<vulnerable_code> { DataBuf info; unsigned char unhex[103]={0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,1, 2,3,4,5,6,7,8,9,0,0, ...
<vulnerable_code> "table_metadata": "read", "table_extra_metadata": "read", "test_connection": "read", "validate_parameters": "read", "favorite_status": "read", "add_favorite": "read", "remove_favorite": "read",<commit_title>[PATCH] fix: db validate parameters permission<commit_description><f...
<vulnerable_code>package com.manydesigns.portofino.dispatcher.security.jwt; import com.manydesigns.portofino.dispatcher.security.RolesPermission; import io.jsonwebtoken.Jwt; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.io.Decoders; import org.apache.commons.configurati...
<vulnerable_code>import com.manydesigns.elements.reflection.JavaClassAccessor; import com.manydesigns.portofino.code.CodeBase; import com.manydesigns.portofino.security.SecurityLogic; import io.jsonwebtoken.Jwt; import io.jsonwebtoken.JwtException; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm;...
<vulnerable_code> import sys import os import platform import math import binascii """Return exception information formatted as string""" return str(e) else: # Python 2.6 requires strings instead of bytearrays in a couple places, # so we define this function so it does the conversion if needed....
<vulnerable_code>from . import tlshashlib as hashlib from ..errors import MaskTooLongError, MessageTooLongError, EncodingError, \ InvalidSignature, UnknownRSAType class RSAKey(object): :type e: int :param e: RSA public exponent. """ raise NotImplementedError() def __len__(self...
<vulnerable_code>from tlslite.utils.python_rsakey import Python_RSAKey from tlslite.utils.cryptomath import * from tlslite.errors import * try: import mock from mock import call self.assertEqual(RSAKey.addPKCS1Prefix(data, 'sha1'), bytearray( b'0!0\t\x06\x05+\x0e\x03\x02\x1a\x05\x00\x04\x14'...
<vulnerable_code> var redirectUrlParts = url.parse(redirectUrl); Object.assign(this._options, redirectUrlParts); // Drop the confidential headers when redirecting to another domain if (!(redirectUrlParts.host === currentHost || isSubdomainOf(redirectUrlParts.host, currentHost))) { removeMatchingHe...
<vulnerable_code> }); }); }); }); describe("when the followRedirects option is set to false", function () {<commit_title>[PATCH] Drop confidential headers across schemes.<commit_description><fixed_code> }); }); }); it("drops the header when redirected to a different sche...
<vulnerable_code> if (containerIDsSanitized !== '*') { containerIDsSanitized = ''; const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim(); for (let i = 0; i <= 2000; i++) { if (!(s[i] === undefined)) { s[i].__proto...
<vulnerable_code> } let urlSanitized = ''; const s = util.sanitizeShellString(url, true); const mathMin = util.mathMin; for (let i = 0; i <= mathMin(s.length, 2000); i++) { if (!(s[i] === undefined)) { s[i].__proto__.toLowerCase = util.stringToLower; const sl = s...
<vulnerable_code> process.nextTick(() => { let ifaceSanitized = ''; const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface); const mathMin = util.mathMin; for (let i = 0; i <= mathMin(s.length, 2000); i++) { if (!(s[i] === undefined)) { ifaceSanitized ...
<vulnerable_code> srvString.__proto__.trim = util.stringTrim; const s = util.sanitizeShellString(srv); const mathMin = util.mathMin; for (let i = 0; i <= mathMin(s.length, 2000); i++) { if (!(s[i] === undefined)) { srvString = srvString + s[i]; } pro...
<vulnerable_code>/* This file is part of libmspack. * (C) 2003-2011 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 D(("first pmgl chunk is after last pmgl chunk")) return MSPACK_ERR_DATAFORMA...
<vulnerable_code> print_int (is_full ? QA_ROW_LAST_IN_BATCH : QA_ROW, __ses); for (inx = 0; inx < slots; inx++) { caddr_t value = QST_GET (inst, sel->sel_out_slots[inx]); print_object (value, __ses, NULL, NULL); } b2 = __ses->dks_bytes_sent;<commit_title>[PATCH] Fixed handling of aliases...
<vulnerable_code> return PJLIB_UTIL_EDNSINNAMEPTR; } *name_len = *parsed_len = 0; p = start; while (*p) { return PJLIB_UTIL_EDNSINNAMEPTR; } p = start; while (*p) { if ((*p & 0xc0) == 0xc0) { /* Parse some well known records */ if (rr->type == PJ_DNS_TYPE_A)...
<vulnerable_code>"use strict" const parsePath = require("parse-path") , normalizeUrl = require("normalize-url") /** * parseUrl * Parses the input url. * @name parseUrl * @function * @param {String} url The input url. * @param {Boolean|Object} normalize Wheter to normalize the url or not. * ...
<vulnerable_code>const parseUrl = require("../lib") , tester = require("tester") , normalizeUrl = require("normalize-url") , qs = require("querystring") ; const INPUTS = [ , { protocols: [ "http" ] , protocol: "http" , port: null , resource: "ionicabizau....
<vulnerable_code> self.assertIn("exists", json) self.assertTrue(json["exists"]) def get_subscription(self, user_profile, stream_name): # type: (UserProfile, Text) -> Subscription stream = get_stream(stream_name, self.realm)<commit_title>[PATCH] streams: Fix autosubscribe security bug...
<vulnerable_code> result = {"exists": bool(stream)} if stream is not None: recipient = get_recipient(Recipient.STREAM, stream.id) if autosubscribe: bulk_add_subscriptions([stream], [user_profile]) result["subscribed"] = is_active_subscriber( user_profile=user_profi...
<vulnerable_code> return deferred.promise; } function isSymlink(entry) { return entry.type === 'SymbolicLink'; } function filterSymlinks(entry) {<commit_title>[PATCH] Fix .tar.gz extract vulnerability<commit_description><fixed_code> return deferred.promise; } function isSymlink(_, entry) { return entr...
<vulnerable_code> w = render->ibounds.x1 - render->ibounds.x0; min_band_mem = (size_t)bpp * w * min_band_height; reps = (int)(max_band_memory / min_band_mem); if (reps < 1) reps = 1; /* Adjust reps to even out the work between threads */<commit_title>[PATCH] Bug 704834: Fix division by zero for zero width pages...
<vulnerable_code> import javax.crypto.SecretKey; import java.io.IOException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; import java.util.List; i...
<vulnerable_code>import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.DatasourceConfiguration; import com.appsmith.external.models.Property; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.web.uti...
<vulnerable_code>package com.appsmith.util; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.web.reactive.function.client.WebClient; import reactor.netty.http.client.HttpClient; public class WebClientUtils { private WebClientUtils() { } public stati...
<vulnerable_code> import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import static com.appsmith.external.helpers.PluginUtils.getValueSafelyFromPropertyList; import static com.appsmith.external.helper...
<vulnerable_code>import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; import com.appsmith.external.helpers.DataTypeStringUtils; import com.appsmith.external.helpers.MustacheHelper; import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.ActionExecutionRe...
<vulnerable_code> u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) { struct cxusb_state *st = d->priv; int ret, wo; if (1 + wlen > MAX_XFER_SIZE) { warn("i2c wr: len=%d is too big!\n", wlen); return -EOPNOTSUPP; } wo = (rbuf == NULL || rlen == 0); /* write-only */ mutex_lock(&d->data_mutex); st->data[0...
<vulnerable_code> pid_t l_pid; } __attribute__ ((packed,aligned(4))); asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) { struct oabi_flock64 user; struct flock64 kernel; mm_segment_t fs = USER_DS; /* initialized to kill a warning */ unsigned long local_arg = arg; int ret...
<vulnerable_code>static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowPCXException(severity,tag) \ { \ scanline=(unsigned char *) RelinquishMagickMemory(scanline); \ pixel_info=RelinquishVirtualMemory(pixel_info); \ ThrowReaderException(severity,tag); \ } Im...
<vulnerable_code>#define STELLARIS_ENET(obj) \ OBJECT_CHECK(stellaris_enet_state, (obj), TYPE_STELLARIS_ENET) typedef struct { SysBusDevice parent_obj; uint32_t mtxd; uint32_t mrxd; uint32_t np; int tx_fifo_len; uint8_t tx_fifo[2048]; /* Real hardware has a 2k fifo, which works out to ...
<vulnerable_code>{ struct videobuf_mapping *map = vma->vm_private_data; dprintk(2,"vm_open %p [count=%d,vma=%08lx-%08lx]\n",map, map->count,vma->vm_start,vma->vm_end); map->count++; struct videobuf_queue *q = map->q; int i; dprintk(2,"vm_close %p [count=%d,vma=%08lx-%08lx]\n",map, map->count,vma->vm_start,...
<vulnerable_code> } private void ensureCorrectTheme(Intent data) { String oldListLayout = data.getStringExtra(SettingsActivity.SP_FEED_LIST_LAYOUT); String newListLayout = mPrefs.getString(SettingsActivity.SP_FEED_LIST_LAYOUT,"0"); if (ThemeChooser.themeRequiresRestartOfUI() || !newList...
<vulnerable_code> import de.luhmer.owncloudnewsreader.helper.ThemeChooser; import static de.luhmer.owncloudnewsreader.LoginDialogActivity.RESULT_LOGIN; /** * A {@link PreferenceActivity} that presents a set of application settings. On * handset devices, settings are presented as a single list. On tablets, public ...
<vulnerable_code> sixel_output_t *output; output = (sixel_output_t *) AcquireQuantumMemory(sizeof(sixel_output_t) + SIXEL_OUTPUT_PACKET_SIZE * 2, 1); output->has_8bit_control = 0; output->save_pixel = 0; output->save_count = 0; Define SIXEL pixels. */ output = sixel_output_create(image); s...
<vulnerable_code> cygpath, expand_path, is_cygwin_git, patch_env, remove_password_if_present, stream_copy, ) ## -- End Utilities -- @} if os.name == "nt": # CREATE_NEW_PROCESS_GROUP is needed to allow killing it afterwards. See: # https://docs.python.org/3/library/subprocess.html#subpr...
<vulnerable_code> """Standalone functions to accompany the index implementation and make it more versatile.""" import contextlib from io import BytesIO import os import os.path as osp ) import subprocess from git.cmd import PROC_CREATIONFLAGS, handle_process_output from git.compat import defenc, force_bytes, force_te...
<vulnerable_code> IO, Iterator, List, Optional, Pattern, Sequence, def py_where(program: str, path: Optional[PathLike] = None) -> List[str]: # From: http://stackoverflow.com/a/377028/548792 winprog_exts = _get_exe_extensions() return new_cmdline # } END utilities # { Classes<com...
<vulnerable_code>import ddt from git import Git, refresh, GitCommandError, GitCommandNotFound, Repo, cmd from git.util import cwd, finalize_process from test.lib import TestBase, fixture_path, with_rw_directory def _do_shell_combo(self, value_in_call, value_from_class): with mock.patch.object(Git, "USE_S...
<vulnerable_code> (void) CloneString(&annotate->text,textlist[i]); if ((metrics.width == 0) || (annotate->gravity != NorthWestGravity)) (void) GetTypeMetrics(image,annotate,&metrics,exception); height=(size_t) floor(metrics.ascent-metrics.descent+0.5); if (height == 0) height=draw_info->point...
<vulnerable_code> (void) GetNextToken(q,&q,extent,token); if (*token == ',') (void) GetNextToken(q,&q,extent,token); region.height=(size_t) floor(GetDrawValue(token,&next_token)+ 0.5); if (token == next_token) ...
<vulnerable_code> scale.y=geometry_info.sigma; if ((percent_flags & SigmaValue) == 0) scale.y=scale.x; *width=(size_t) floor(scale.x*stasis_width/100.0+0.5); *height=(size_t) floor(scale.y*stasis_height/100.0+0.5); stasis_width=(*width); stasis_height=(*height); } if...
<vulnerable_code> */ width=integral_image->columns; height=integral_image->rows; bounds.width=(size_t) floor(fabs((double) height*shear.x)+width+0.5); bounds.height=(size_t) floor(fabs((double) bounds.width*shear.y)+height+0.5); shear_width=(size_t) floor(fabs((double) bounds.height*shear.x)+ bounds.widt...
<vulnerable_code> (void) SetImageColorspace(clone_image,sRGBColorspace,exception); (void) SetImageVirtualPixelMethod(clone_image,EdgeVirtualPixelMethod, exception); border_info.width=(size_t) floor(2.0*sigma+0.5); border_info.height=(size_t) floor(2.0*sigma+0.5); border_info.x=0; border_info.y=0; (vo...
<vulnerable_code> return(DestroyImageList(image)); (void) SetImageProperty(image,"caption",caption,exception); draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); width=(size_t) floor(0.5*draw_info->pointsize*strlen(caption)+0.5); if (AcquireMagickResource(WidthResource,width) == MagickFalse) { ...
<vulnerable_code> return(DestroyImageList(image)); (void) SetImageProperty(image,"label",label,exception); draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); width=(size_t) floor(0.5*draw_info->pointsize*strlen(label)+0.5); if (AcquireMagickResource(WidthResource,width) == MagickFalse) { label=...
<vulnerable_code> image->resolution.x,image->resolution.y); if (image_info->ping != MagickFalse) (void) FormatLocaleString(density,MagickPathExtent,"2.0x2.0"); page.width=(size_t) floor(page.width*image->resolution.x/delta.x+0.5); page.height=(size_t) floor(page.height*image->resolution.y/delta.y+0.5); (...
<vulnerable_code> (void) ParseMetaGeometry(temp,&geometry.x,&geometry.y, &geometry.width,&geometry.height); scale.x=(double) (geometry.width*delta.x)/resolution.x; geometry.width=(size_t) floor(scale.x+0.5); scale.y=(double) (geometry.height*delta.y)/resolution.y; geometry.height=(size_t) floor...
<vulnerable_code> (void) ParseMetaGeometry(page_geometry,&geometry.x,&geometry.y, &geometry.width,&geometry.height); scale.x=PerceptibleReciprocal(resolution.x)*geometry.width*delta.x; geometry.width=(size_t) floor(scale.x+0.5); scale.y=PerceptibleReciprocal(resolution.y)*geometry.height*delta.y; ...
<vulnerable_code> svg_info->view_box=svg_info->bounds; svg_info->width=0; if (svg_info->bounds.width >= MagickEpsilon) svg_info->width=(size_t) floor(svg_info->bounds.width+0.5); svg_info->height=0; if (svg_info->bounds.height >= MagickEpsilon) ...
<vulnerable_code> /** * set up for use in conjunction with a block cipher to handle the * message. * * @param agree the key agreement used as the basis for the encryption * @param kdf the key derivation function used for byte generation int inLen) throws InvalidCipherTe...
<vulnerable_code>import org.bouncycastle.crypto.parsers.DHIESPublicKeyParser; import org.bouncycastle.jcajce.provider.asymmetric.util.DHUtil; import org.bouncycastle.jcajce.provider.asymmetric.util.IESUtil; import org.bouncycastle.jcajce.util.BCJcaJceHelper; import org.bouncycastle.jcajce.util.JcaJceHelper; import org....
<vulnerable_code>import org.bouncycastle.crypto.parsers.ECIESPublicKeyParser; import org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil; import org.bouncycastle.jcajce.provider.asymmetric.util.IESUtil; import org.bouncycastle.jcajce.util.BCJcaJceHelper; import org.bouncycastle.jcajce.util.JcaJceHelper; import org....
<vulnerable_code>import org.bouncycastle.crypto.engines.RSABlindedEngine; import org.bouncycastle.crypto.params.ParametersWithRandom; import org.bouncycastle.jcajce.provider.asymmetric.util.BaseCipherSpi; import org.bouncycastle.jcajce.provider.util.DigestFactory; import org.bouncycastle.jcajce.util.BCJcaJceHelper; imp...
<vulnerable_code><commit_title>[PATCH] modified IESEngine so that MAC check is the primary one added<commit_description><fixed_code> package org.bouncycastle.jcajce.provider.util; import javax.crypto.BadPaddingException; public class BadBlockException extends BadPaddingException { private final Throwable caus...
<vulnerable_code>import java.security.SecureRandom; import java.security.Security; import javax.crypto.Cipher; import javax.crypto.interfaces.DHPrivateKey; import javax.crypto.interfaces.DHPublicKey; out2 = c2.doFinal(out1, 0, out1.length); if (!areEqual(out2, message)) fail(testname + " te...
<vulnerable_code>import java.security.Security; import java.security.spec.ECGenParameterSpec; import javax.crypto.Cipher; import javax.crypto.SealedObject; if (!areEqual(out2, message)) fail(testname + " test failed with non-null parameters, DHAES mode false."); // TODO: DHAES mode is no...
<vulnerable_code> // [databind#1737]; 3rd party //s.add("org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor"); // deprecated by [databind#1855] s.add("org.springframework.beans.factory.config.PropertyPathFactoryBean"); // s.add("com.mchange.v2.c3p0.JndiRefForwardingDataSource"); // depre...
<vulnerable_code>import warnings from pathlib import Path from typing import TYPE_CHECKING, Optional from airflow.configuration import AirflowConfigException, conf from airflow.exceptions import RemovedInAirflow3Warning else: import httpx url = os.path.join("http://{ti.hostname}:{worke...
<vulnerable_code>from vantage6.server.model.rule import Rule, Operation, Scope from vantage6.server.model.base import DatabaseSessionManager from vantage6.server.model.organization import Organization from vantage6.common import logger_name module_name = logger_name(__name__) log = logging.getLogger(module_name) ...
<vulnerable_code> from vantage6.common import logger_name from vantage6.server import db from vantage6.server.permission import PermissionManager from vantage6.server.resource.common.pagination import Page """ return db.Organization.get(cls.obtain_organization_id()) # --------------------------------...
<vulnerable_code>from vantage6.server.resource import with_user_or_node, with_user from vantage6.server.resource import ServicesResources from vantage6.server.resource.common.pagination import Pagination from vantage6.server.permission import (Scope as S, Operation as P, Permissi...
<vulnerable_code> if 'country' in args: q = q.filter(db.Organization.country == args['country']) if 'collaboration_id' in args: if not self.r.has_minimal_scope(P.VIEW, S.COLLABORATION): return { 'msg': 'You lack the permission to get all organiz...
<vulnerable_code> from vantage6.server import db from vantage6.server.resource import ( with_user, ServicesResources ) from vantage6.common import logger_name from vantage6.server.permission import ( PermissionManager ) from vantage6.server.model.rule import Operation, Scope from vantage6.server.resource.co...
<vulnerable_code> RuleCollection ) from vantage6.server.resource import ( with_user, ServicesResources ) schema: type: integer description: Organization id - in: query name: firstname schema: q = q.join(db.UserPermission).joi...
<vulnerable_code> ), "warning", ) ui_fields_defined = any("const" not in f["schema"] for f in form_fields.values()) show_trigger_form_if_no_params = conf.getboolean("webserver", "show_trigger_form_if_no_params")<commit_title>[PATCH] Add more deprecation warnin...
<vulnerable_code> switch (BYTE_TYPE(enc, ptr)) { # define LEAD_CASE(n) \ case BT_LEAD##n: \ ptr += n; \ break; LEAD_CAS...
<vulnerable_code> for field_name, rendered_value in rendered_task_instance_fields.items(): setattr(self.task, field_name, rendered_value) return try: self.render_templates() except (TemplateAssertionError, UndefinedError) as e: raise Airflow...