code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
"""Identity related views.""" from reversion import revisions as reversion from django.contrib.auth import mixins as auth_mixins from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test ) from django.shortcuts import render from django.template.loader import render_to_str...
vuln
Vulnerable
Python
status_handler (void *opaque, int fd) { struct io_cb_data *data = (struct io_cb_data *) opaque; engine_gpgsm_t gpgsm = (engine_gpgsm_t) data->handler_value; gpgme_error_t err = 0; char *line; size_t linelen; do { err = assuan_read_line (gpgsm->assuan_ctx, &line, &linelen); if (err) { /*...
vuln
Safe
C/C++
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
vuln
Vulnerable
Python
#include "source/common/http/conn_manager_impl.h" #include <cstdint> #include <functional> #include <list> #include <memory> #include <string> #include <vector> #include "envoy/buffer/buffer.h" #include "envoy/common/time.h" #include "envoy/event/dispatcher.h" #include "envoy/event/scaled_range_timer_manager.h" #incl...
vuln
Safe
C/C++
static int irda_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; struct irda_sock *self = irda_sk(sk); struct irda_device_list list = { 0 }; struct irda_device_info *discoveries; struct irda_ias_set * ias_opt; /* IAS get/query para...
vuln
Safe
Unknown
private void chest(int slot) throws NoConnectionException, NotAuthorizedException { if(!beh.isReward(slot)) return; if(Options.is("exploits") && ConfigsV2.getBoolean(cid, currentLayer, ConfigsV2.useMultiChestExploit)) { goMultiChestClaim = false; for(int i=0; i<50; i++) { Thread t = new Thread(new Runn...
vuln
Safe
Java
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE(context, node->inputs->size == kInputNum); TF_LITE_ENSURE(context, node->outputs->size == kOutputNum); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputData, &input)); const TfLiteTensor* pr...
vuln
Safe
C/C++
void dtls1_stop_timer(SSL *s) { /* Reset everything */ memset(&(s->d1->timeout), 0, sizeof(struct dtls1_timeout_st)); memset(&(s->d1->next_timeout), 0, sizeof(struct timeval)); s->d1->timeout_duration = 1; BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeo...
vuln
Vulnerable
Unknown
private void prepareLabel(String vertexName, Color vertexColor) { // The label is just used as a renderer and never parented, so no need to be // on the swing thread Font font = options.getFont(); label.setFont(font); String escapedText = HTMLUtilities.toLiteralHTML(vertexName, 80); label.setText(escapedTe...
vuln
Safe
Java
TPMI_ALG_HASH_Unmarshal(TPMI_ALG_HASH *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; TPMI_ALG_HASH orig_target = *target; // libtpms added if (rc == TPM_RC_SUCCESS) { rc = TPM_ALG_ID_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*targ...
vuln
Safe
Unknown
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008-2015 University of Dundee. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or...
vuln
Vulnerable
Python
int parse_sym_line(buf, which_set) char *buf; int which_set; { int val, i; struct symparse *symp; char *bufp, *commentp, *altp; /* convert each instance of whitespace (tabs, consecutive spaces) into a single space; leading and trailing spaces are stripped */ mungspaces(buf); /* remove t...
vuln
Vulnerable
C/C++
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; AVFrame *pict = data; /* no suppleme...
vuln
Safe
Unknown
bool GLES2DecoderImpl::SimulateAttrib0(GLuint max_vertex_accessed) { if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) return false; const VertexAttribManager::VertexAttribInfo* info = vertex_attrib_manager_.GetVertexAttribInfo(0); bool attrib_0_used = current_program_->GetAttribIn...
vuln
Vulnerable
C/C++
int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) { VP8Context *s = avctx->priv_data; VP8ThreadData *td = &s->thread_data[jobnr]; VP8ThreadData *next_td = NULL, *prev_td = NULL; VP8Frame *curframe = s->curframe; int m...
vuln
Vulnerable
C/C++
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
vuln
Safe
C/C++
static struct dentry *__lookup_hash(struct qstr *name, struct dentry *base, struct nameidata *nd) { struct dentry *dentry; struct inode *inode; int err; inode = base->d_inode; /* * See if the low-level filesystem might want * to use its own hash.. */ if (base->d_op && base->d_op->d_hash) { err = base-...
vuln
Vulnerable
Unknown
void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, int *maskColors, GBool inlineImg) { double *ctm; SplashCoord mat[6]; SplashOutImageData imgData; SplashColorMode srcMode; SplashImageSource src; GfxGray gray; GfxRGB rg...
vuln
Safe
Unknown
def get_results(self, task_id: int) -> list[dict]: """ Return the results of the task with the given id. Parameters ---------- task_id : int The id of the task. Returns ------- list[dict] The results of the task. """ ...
vuln
Safe
Python
static int reencrypt_keyslot_update(struct crypt_device *cd, const struct luks2_reencrypt *rh) { int r; json_object *jobj_keyslot, *jobj_area, *jobj_area_type; struct luks2_hdr *hdr; if (!(hdr = crypt_get_hdr(cd, CRYPT_LUKS2))) return -EINVAL; jobj_keyslot = LUKS2_get_keyslot_jobj(hdr, rh->reenc_keyslot); if...
vuln
Safe
Unknown
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input)); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, kOutputTensor, &output)); const TfLi...
vuln
Safe
C/C++
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
vuln
Safe
C/C++
/** * Based on Kendo UI Core expression code <https://github.com/telerik/kendo-ui-core#license-information> */ 'use strict' function Cache(maxSize) { this._maxSize = maxSize this.clear() } Cache.prototype.clear = function () { this._size = 0 this._values = Object.create(null) } Cache.prototype.get = function...
vuln
Safe
JavaScript
@Override public float getSpeed(float w) { if (w > 0.8f) { return mAdapter.getCount() / 0.001f; } else { return 10.0f * w; } }
vuln
Vulnerable
Java
package com.salesmanager.shop.admin.controller.configurations; import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; imp...
vuln
Safe
Java
def action_save_user(request: HttpRequest, default_forward_url: str = "/admin/users"): """ This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse :param request: the HttpRequest :param default_forward_url: The URL to forward to if nothing was specified ...
vuln
Safe
Python
def __init__( self, path: Union[str, Path], env: Environment, bound_host: str, session_id: str, refactor_mode: bool = False,
vuln
Safe
Python
BITMAP_UPDATE* update_read_bitmap_update(rdpUpdate* update, wStream* s) { UINT32 i; BITMAP_UPDATE* bitmapUpdate = calloc(1, sizeof(BITMAP_UPDATE)); if (!bitmapUpdate) goto fail; if (Stream_GetRemainingLength(s) < 2) goto fail; Stream_Read_UINT16(s, bitmapUpdate->number); /* numberRectangles (2 bytes) */ WL...
vuln
Vulnerable
C/C++
def visit_create_index(self, create): preparer = self.preparer index = create.element self._verify_index_table(index) text = "CREATE " if index.unique: text += "UNIQUE " text += "INDEX " if self.dialect._supports_create_index_concurrently: ...
vuln
Vulnerable
Python
void *qemu_blockalign(BlockDriverState *bs, size_t size) { return qemu_memalign(bdrv_opt_mem_align(bs), size); }
vuln
Safe
C/C++
@Override public void onCreateOptionsMenu(@NonNull final Menu menu, @NonNull final MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); final ActionBar supportActionBar = activity.getSupportActionBar(); if (supportActionBar != null) { ...
vuln
Safe
Java
@gui.route("/job/<int:job_id>/browse", defaults={"path": ""}) @gui.route("/job/<int:job_id>/browse/<path:path>") @login_required def job_browse(job_id: int, path): """ Browse directory of the job. :param job_id: int :param path: str """ try: # Query job information job_info = qu...
vuln
Vulnerable
Python
int sldns_str2wire_str_buf(const char* str, uint8_t* rd, size_t* len) { uint8_t ch = 0; size_t sl = 0; const char* s = str; /* skip length byte */ if(*len < 1) return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL; /* read characters */ while(sldns_parse_char(&ch, &s)) { if(sl >= 255) return RET_ERR(LDNS_WIREPARSE_...
vuln
Safe
Unknown
@SuppressWarnings("checkstyle:emptyblock") private static List<Region> internalParse( final InputStream input, final boolean endpointVerification) throws IOException { Document document; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance()...
vuln
Safe
Java
public void close() { synchronized (audioChannels) { Voicechat.LOGGER.info("Clearing audio channels"); audioChannels.forEach((uuid, audioChannel) -> audioChannel.closeAndKill()); audioChannels.clear(); } if (soundManager != null) { soundManager.cl...
vuln
Safe
Java
@bot.message_handler(func = lambda message: get_current_state(message.chat.id) == config.States.S_GET_TASK.value) def get_task(message): settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\bases\\settings.db") conn = settings.cursor() conn.execute("select * from users where chat_id = ...
vuln
Safe
Python
def check_images_exist( images: T.Set[str], auth_method: AuthorizationType, vault_endpoint: T.Optional[str] = None, vault_secret: T.Optional[str] = None, vault_endpoint_verify: str | bool | None = None ): logger.info("Checking if images used in DAGs exist in the registry") ...
vuln
Safe
Python
void editTopic(final Channel c) { if(c != null) { AlertDialog.Builder builder = new AlertDialog.Builder(this); View view = getDialogTextPrompt(); TextView prompt = view.findViewById(R.id.prompt); final IRCEditText input = view.findViewById(R.id.textInput); ...
vuln
Vulnerable
Java
protected function _mkfile($path, $name) { $path = $this->_joinPath($path, $this->_basename($name)); return $this->connect->put($path, '') ? $path : false; /* if ($this->tmp) { $path = $this->_joinPath($path, $name); $local = $this->getTempFile(); $res = t...
vuln
Safe
PHP
public void setBulletSpawn(Point3D bulletPosition, Point3D bulletVelocity, RotationMatrix bulletOrientation, JSONMuzzle muzzle) { //Set velocity. if (definition.gun.muzzleVelocity != 0) { bulletVelocity.set(0, 0, definition.gun.muzzleVelocity / 20D / 10D); //Randomize the spread ...
vuln
Safe
Java
@SubscribeEvent public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (!Utils.inDungeons) return; if (ToggleCommand.threeManToggled && message.startsWith("[NPC]")) { if (DankersSkyblockMod.data...
vuln
Safe
Java
# -*- coding: utf-8 -*- """ A simple and thin Python library for the Spotify Web API """ __all__ = ["Spotify", "SpotifyException"] import json import logging import warnings import requests import six import urllib3 from spotipy.exceptions import SpotifyException logger = logging.getLogger(__name__) class Spoti...
vuln
Vulnerable
Python
update_drift_file(double freq_ppm, double skew) { char *temp_drift_file; FILE *out; int r1, r2; /* Create a temporary file with a '.tmp' extension. */ temp_drift_file = (char*) Malloc(strlen(drift_file)+8); if(!temp_drift_file) { return; } strcpy(temp_drift_file,drift_file); strcat(temp_drift_...
vuln
Vulnerable
Unknown
static void mch_realize(PCIDevice *d, Error **errp) { int i; MCHPCIState *mch = MCH_PCI_DEVICE(d); pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory, mch->pci_address_space); cpu_smm_register(&mch_set_smm, mch); memory_region_init_alias(&mch->smram_region, O...
vuln
Vulnerable
C/C++
private void addLayer(Component button, TunnelLayersTableModel tableModel) { JPopupMenu popupMenu = new JPopupMenu(); LayerManager.getInstance().getLayers().stream() .filter(l -> (l.getExporterType() != null) && IncidentalLayerExporter.class.isAssignableFrom(l.getExporterType())) ...
vuln
Safe
Java
int ovl_setattr(struct dentry *dentry, struct iattr *attr) { int err; struct dentry *upperdentry; err = ovl_want_write(dentry); if (err) goto out; upperdentry = ovl_dentry_upper(dentry); if (upperdentry) { mutex_lock(&upperdentry->d_inode->i_mutex); err = notify_change(upperdentry, attr, NULL); mu...
vuln
Vulnerable
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Construcs a new sidebar for the given editor. */ function Sidebar(editorUi, container) { this.editorUi = editorUi; this.container = container; this.palettes = new Object(); this.taglist = new Object(); this.lastCreated = 0; this.showTooltips = true; this.gra...
vuln
Vulnerable
JavaScript
receive( struct recvbuf *rbufp ) { register struct peer *peer; /* peer structure pointer */ register struct pkt *pkt; /* receive packet pointer */ u_char hisversion; /* packet version */ u_char hisleap; /* packet leap indicator */ u_char hismode; /* packet mode */ u_char hisstratum; /* packet stratum */ u_...
vuln
Safe
C/C++
static bool parse_reconnect(struct pool *pool, json_t *val) { char *sockaddr_url, *stratum_port, *tmp; char *url, *port, address[256]; memset(address, 0, 255); url = (char *)json_string_value(json_array_get(val, 0)); if (!url) url = pool->sockaddr_url; else { char *dot_pool, *dot_reconnect; dot_pool = strc...
vuln
Safe
C/C++
static int vnc_refresh_server_surface(VncDisplay *vd) { int width = pixman_image_get_width(vd->guest.fb); int height = pixman_image_get_height(vd->guest.fb); int y; uint8_t *guest_row0 = NULL, *server_row0; int guest_stride = 0, server_stride; int cmp_bytes; VncState *vs; int has_dirty =...
vuln
Vulnerable
Unknown
def is_docker_image_allowed( self, docker_image_name: str, task_info: dict ) -> bool: """ Checks the docker image name. Against a list of regular expressions as defined in the configuration file. If no expressions are defined, all docker images are accepted. Paramet...
vuln
Vulnerable
Python
'use strict'; var htmlEscape = require('./htmlEscape'); var is = require('is'); var keys = require('object-keys'); // generates a string for common HTML tag attributes var attrs = function attrs(a) { if (typeof a.id === 'boolean') { a.id = a.id ? 'id_' + a.name : null; } if (is.array(a.classes) &&...
vuln
Safe
JavaScript
webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len) { int result = -1; ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; /* int fin; */ /* not used atm */ /* rfbLog(" <== %s[%d]: %d cl: %p, wsctx: %p-%p (%d)\n", __func__, gettid(), len, cl, wsctx, (char *)wsctx + sizeof(ws_ctx_t), sizeof(ws_ctx_t)); */ ...
vuln
Safe
C/C++
static void vp8_decode_flush_impl(AVCodecContext *avctx, int prefer_delayed_free, int can_direct_free, int free_mem) { VP8Context *s = avctx->priv_data; int i; if (!avctx->is_copy) { for (i = 0; i < 5; i++) if (s->frames[i].data[0]) vp8_r...
vuln
Safe
C/C++
def get_cluster_name() if ISRHEL6 stdout, stderror, retval = run_cmd( PCSAuth.getSuperuserAuth(), COROSYNC_CMAPCTL, "cluster" ) if retval == 0 stdout.each { |line| match = /^cluster\.name=(.*)$/.match(line) return match[1] if match } end begin cluster_conf =...
vuln
Safe
Ruby
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.review.ProductReviewService; import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse; import com.salesmana...
vuln
Vulnerable
Java
def login(self) -> Response: """Login endpoint for the API returns a JWT and optionally a refresh token --- post: description: >- Authenticate and get a JWT access and refresh token requestBody: required: true content: applica...
vuln
Safe
Python
static int handle_pte_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *pte, pmd_t *pmd, unsigned int flags) { pte_t entry; spinlock_t *ptl; /* * some architectures can have larger ptes than wordsize, * e.g.ppc44x-defconfig has CONFIG_PTE_64BIT=y and CONFIG_32BI...
vuln
Safe
Unknown
void HeaderMapImpl::insertByKey(HeaderString&& key, HeaderString&& value) { EntryCb cb = ConstSingleton<StaticLookupTable>::get().find(key.getStringView()); if (cb) { key.clear(); StaticLookupResponse ref_lookup_response = cb(*this); if (*ref_lookup_response.entry_ == nullptr) { maybeCreateInline(...
vuln
Safe
C/C++
/* $Id$ */ /* * The crypt_blowfish homepage is: * * http://www.openwall.com/crypt/ * * This code comes from John the Ripper password cracker, with reentrant * and crypt(3) interfaces added, but optimizations specific to password * cracking removed. * * Written by Solar Designer <solar at openwall.com> in 1998...
vuln
Safe
C/C++
void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { char buf[1024]; unsigned long bios_offset; int bios_s...
vuln
Safe
C/C++
private void setOptions() { if (getContext() == null) return; if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED)) return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); swSign.setChecked(prefs.getBoolea...
vuln
Safe
Java
static void lag_pred_line(LagarithContext *l, uint8_t *buf, int width, int stride, int line) { int L, TL; if (!line) { L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1, width - 1, buf[0]); } else { L ...
vuln
Safe
C/C++
daemon_AuthUserPwd(char *username, char *password, char *errbuf) { #ifdef _WIN32 /* * Warning: the user which launches the process must have the * SE_TCB_NAME right. * This corresponds to have the "Act as part of the Operating System" * turned on (administrative tools, local security settings, local * polici...
vuln
Safe
C/C++
decode_bytes_with_escapes(struct compiling *c, const node *n, const char *s, size_t len) { return PyBytes_DecodeEscape(s, len, NULL, 0, NULL); }
vuln
Vulnerable
C/C++
void av_force_cpu_flags(int arg){ if ( (arg & ( AV_CPU_FLAG_3DNOW | AV_CPU_FLAG_3DNOWEXT | AV_CPU_FLAG_MMXEXT | AV_CPU_FLAG_SSE | AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW | AV_CPU_F...
vuln
Safe
C/C++
qio_channel_socket_accept(QIOChannelSocket *ioc, Error **errp) { QIOChannelSocket *cioc; cioc = qio_channel_socket_new(); cioc->remoteAddrLen = sizeof(ioc->remoteAddr); cioc->localAddrLen = sizeof(ioc->localAddr); retry: trace_qio_channel_socket_accept(ioc); cioc->fd =...
vuln
Vulnerable
C/C++
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.manufacturer.ManufacturerService; import com.salesmanager.core.business.services.reference.language.LanguageService; import com.salesmanager.core.business.utils.CoreConfiguration; import com.salesman...
vuln
Safe
Java
static void lan9118_writel(void *opaque, target_phys_addr_t offset, uint32_t val) { lan9118_state *s = (lan9118_state *)opaque; offset &= 0xff; if (offset >= 0x20 && offset < 0x40) { tx_fifo_push(s, val); return; } switch (offset) { c...
vuln
Vulnerable
C/C++
gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { TIFF* tif = img->tif; tileSeparateRoutine put = img->put.separate; unsigned char *buf = NULL; unsigned char *p0 = NULL, *p1 = NULL, *p2 = NULL, *pa = NULL; uint32 row, y, nrow, rowstoread; tmsize_t pos; tmsize_t scanline; uint32 rowsperst...
vuln
Vulnerable
C/C++
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 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 required by applicable law or a...
vuln
Safe
Python
static void parse_rtcp_bye(pjmedia_rtcp_session *sess, const void *pkt, pj_size_t size) { pj_str_t reason = {"-", 1}; /* Check and get BYE reason */ if (size > 8) { reason.slen = PJ_MIN(sizeof(sess->stat.peer_sdes_buf_), *((pj_uint8_t*)pkt+8)); pj_memcpy(sess->sta...
vuln
Vulnerable
Unknown
public static Map<String, Object> parseIsoPeriod(String isoPeriodString) { Period period = Period.ZERO; Duration duration = Duration.ZERO; // isoPeriod should follow the ISO 8601 period notation without startdate // P ^= Period // Y = Years // M = Month // W = Weeks // D = Days ...
vuln
Vulnerable
Java
@Override public void playAttackAnimation(String name, boolean isOffHand) { try { EmoteData data = AnimationRegistry.emotes.get(name); container.setAnim(new EmoteDataPlayer(data, 0)); this.bodyYaw = this.headYaw; } catch (Exception e) { e.printStackTra...
vuln
Safe
Java
static pico_mdns_rtree pico_mdns_handle_single_question( struct pico_dns_question *question, pico_dns_packet *packet ) { struct pico_mdns_cookie *cookie = NULL; PICO_MDNS_RTREE_DECLARE(antree); char *qname_original = NULL; uint16_t qtype = 0, qclass = 0; /* Check p...
vuln
Vulnerable
C/C++
@UnsupportedAppUsage void startCallActivity() { sendCloseSystemWindows(); Intent intent = new Intent(Intent.ACTION_CALL_BUTTON); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { mContext.startActivity(intent); } catch (ActivityNotFoundException e) { ...
vuln
Vulnerable
Java
static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr, uint64_t asc, uint64_t entry, int level, target_ulong *raddr, int *flags, int rw, bool exc) { CPUState *cs = CPU(s390_env_get_cpu(env)); uint64_...
vuln
Vulnerable
C/C++
package oidc import ( "context" "errors" "fmt" "net/http" "strings" gooidc "github.com/coreos/go-oidc" log "github.com/sirupsen/logrus" "golang.org/x/oauth2" "github.com/argoproj/argo-cd/v2/util/security" "github.com/argoproj/argo-cd/v2/util/settings" ) var ErrTokenExpired = errors.New("token is expired")...
vuln
Safe
Go
int main(int argc, char** argv) { bool create = false; bool extract = false; bool list = false; bool verbose = false; bool gzip = false; const char* archive_file = nullptr; Vector<const char*> paths; Core::ArgsParser args_parser; args_parser.add_option(create, "Create archive", "cre...
vuln
Safe
C/C++
def getresponse(self): mapper = routes.Mapper() api = context.UnauthenticatedContextMiddleware(rserver.API(mapper)) webob_res = self.req.get_response(api) return utils.FakeHTTPResponse(status=webob_res.status_int, headers=webob_res.headers, ...
vuln
Vulnerable
Python
"""Admin API v2 viewsets.""" from django.utils.translation import ugettext as _ from django.contrib.contenttypes.models import ContentType from django_filters import rest_framework as dj_filters from drf_spectacular.utils import extend_schema, extend_schema_view from rest_framework import ( filters, mixins, pars...
vuln
Safe
Python
/* * Cantata * * Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (a...
vuln
Vulnerable
C/C++
Name WasmBinaryBuilder::getFunctionIndexName(Index i) { if (i >= wasm.functions.size()) { throwError("invalid function index"); } return wasm.functions[i]->name; }
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptionValueService; import com.salesmanager.core.business.services.content.ContentService; import com.salesmanager.core.business.services.reference.language.LanguageService; import c...
vuln
Vulnerable
Java
static ssize_t write_mem(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { phys_addr_t p = *ppos; ssize_t written, sz; unsigned long copied; void *ptr; if (p != *ppos) return -EFBIG; if (!valid_phys_addr_range(p, count)) return -EFAULT; written = 0; #ifdef __ARCH_HAS_NO_PAGE_ZE...
vuln
Vulnerable
Unknown
cdf_read_short_sector_chain(const cdf_header_t *h, const cdf_sat_t *ssat, const cdf_stream_t *sst, cdf_secid_t sid, size_t len, cdf_stream_t *scn) { size_t ss = CDF_SHORT_SEC_SIZE(h), i, j; scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h)); scn->sst_dirlen = len; if (sst->sst_tab == NULL || scn->s...
vuln
Safe
C/C++
#include "source/extensions/transport_sockets/tls/cert_validator/spiffe/spiffe_validator.h" #include "envoy/extensions/transport_sockets/tls/v3/common.pb.h" #include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.pb.h" #include "envoy/network/transport_socket.h" #include "envoy/registry/registr...
vuln
Safe
C/C++
exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen) { unsigned int i, j, k; ExifShort v_short, v_short2, v_short3, v_short4; ExifByte v_byte; ExifRational v_rat; ExifSRational v_srat; char b[64]; const char *c; ExifByteOrder o; double d; ExifEntry *entry; static const struct { char label[5]...
vuln
Safe
C/C++
public void handleEvent(final PusherEvent event) { String channelName = event.getChannelName(); if (channelName != null) { final InternalChannel channel = channelNameToChannelMap.get(channelName); if (channel != null) { channel.handleEvent(event); } ...
vuln
Safe
Java
void RemoteDevicePropertiesWidget::checkSaveable() { RemoteFsDevice::Details det=details(); modified=det!=orig; saveable=!det.isEmpty(); if (saveable && Type_SambaAvahi==type->itemData(type->currentIndex()).toInt()) { saveable=!smbAvahiName->text().trimmed().isEmpty(); } emit updated(); ...
vuln
Vulnerable
Unknown
// SPDX-License-Identifier: GPL-2.0+ /* * inode.c -- user mode filesystem api for usb gadget controllers * * Copyright (C) 2003-2004 David Brownell * Copyright (C) 2003 Agilent Technologies */ /* #define VERBOSE_DEBUG */ #include <linux/init.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/fs_...
vuln
Vulnerable
C/C++
public void setCdOrder(String[] cdOrder) { this.cdOrder = cdOrder != null ? cdOrder.clone() : null; }
vuln
Safe
Java
package com.salesmanager.shop.admin.model.permission; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPrope...
vuln
Vulnerable
Java
ShouldCancelAndIgnore(NavigationHandle* handle) { return handle->GetFrameTreeNodeId() == frame_tree_node_id_; }
vuln
Vulnerable
C/C++
d(null,null,0,0,0,0,{xml:X,w:ea.width,h:ea.height})}F=!0}}catch(Z){}F||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(Z){}return null}function g(E){E.dataTransfer.dropEffect=null!=B?"move":"copy";E.stopPropagation();E.preventDefault()}function k(E){E.stopPropagation();E.preventDe...
vuln
Safe
JavaScript
AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream& stream, AP4_UI32 type, AP4_UI32 size_32, AP4_UI64 size_64, AP4_Atom*& atom) { bool ...
vuln
Vulnerable
Unknown
const bootbox = require('bootbox'); require('../services/Requisitions'); require('../services/Synchronize'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; const quickAddNodeView = require('../../views/quick-add-node.html'); const c...
vuln
Safe
Java
static void cd_read_sector_cb(void *opaque, int ret) { IDEState *s = opaque; #ifdef DEBUG_IDE_ATAPI printf("cd_read_sector_cb: lba=%d ret=%d\n", s->lba, ret); #endif if (ret < 0) { block_acct_failed(blk_get_stats(s->blk), &s->acct); ide_atapi_io_error(s, ret); return; } block...
vuln
Safe
C/C++
PHP_FUNCTION(mkdir) { char *dir; int dir_len; zval *zcontext = NULL; long mode = 0777; zend_bool recursive = 0; php_stream_context *context; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) { RETURN_FALSE; } context = php_stream_context...
vuln
Vulnerable
Unknown
void GaiaOAuthClient::Core::OnAuthTokenFetchComplete( const net::URLRequestStatus& status, int response_code, const std::string& response) { request_.reset(); if (!status.is_success()) { delegate_->OnNetworkError(response_code); return; } if (response_code == net::HTTP_BAD_REQUEST) { L...
vuln
Vulnerable
C/C++