code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
gboolean _pango_emoji_iter_next (PangoEmojiIter *iter) { PangoEmojiType current_emoji_type = PANGO_EMOJI_TYPE_INVALID; if (iter->end == iter->text_end) return FALSE; iter->start = iter->end; for (; iter->end < iter->text_end; iter->end = g_utf8_next_char (iter->end)) { gunichar ch = g_utf8_get_...
vuln
Safe
C/C++
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, _ from odoo.exceptions import UserError class SaleOrder(models.Model): _inherit = 'sale.order' carrier_id = fields.Many2one('delivery.carrier', string="Delivery Method", d...
vuln
Vulnerable
Python
static Image *ReadCAPTIONImage(const ImageInfo *image_info, ExceptionInfo *exception) { char *caption, geometry[MagickPathExtent], *property, *text; const char *gravity, *option; DrawInfo *draw_info; Image *image; MagickBooleanType split, status; register ssize...
vuln
Vulnerable
C/C++
static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_count, AudioData *in , int in_count){ AudioData *postin, *midbuf, *preout; int ret; AudioData preout_tmp, midbuf_tmp; if(s->full_convert){ av_assert0(!s->resample)...
vuln
Vulnerable
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Vulnerable
JavaScript
uint64_t helper_cvttq_svic(CPUAlphaState *env, uint64_t a) { return inline_cvttq(env, a, float_round_to_zero, 1); }
vuln
Vulnerable
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Safe
JavaScript
@Nonnull @Override public NonNullList<ItemStack> getRemainingItems(@Nonnull CraftingInventory inv) { NonNullList<ItemStack> remaining = NonNullList.withSize(inv.getSizeInventory(), ItemStack.EMPTY); final MatchLocation offset = findMatch(inv); Preconditions.checkNotNull(offset); for(int x = 0; x < inv.getWi...
vuln
Vulnerable
Java
int virtio_load(VirtIODevice *vdev, QEMUFile *f) { int i, ret; uint32_t num; uint32_t features; uint32_t supported_features; BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); if (k->load_config) { ret = k->load_config(qbus->parent, f...
vuln
Vulnerable
Unknown
def load_hparams_from_yaml(config_yaml: str, use_omegaconf: bool = True) -> Dict[str, Any]: """Load hparams from a file. Args: config_yaml: Path to config yaml file use_omegaconf: If omegaconf is available and ``use_omegaconf=True``, the hparams will be converted to ...
vuln
Vulnerable
Python
static int vpc_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { BDRVVPCState *s = bs->opaque; int64_t offset; int64_t sectors, sectors_per_block; int ret; VHDFooter *footer = (VHDFooter *) s->footer_buf; if (cpu_to_be32(footer->type) == VHD_FIXED) { ...
vuln
Vulnerable
C/C++
@NonNull Rect getParentContainerBounds(@NonNull TaskFragmentContainer container) { final Configuration parentConfig = mFragmentParentConfigs.get( container.getTaskFragmentToken()); if (parentConfig != null) { return parentConfig.windowConfiguration.getBounds(); } ...
vuln
Vulnerable
Java
// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (c) 2013, Google Inc. * * (C) Copyright 2008 Semihalf * * (C) Copyright 2000-2006 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ #ifdef USE_HOSTCC #include "mkimage.h" #include <time.h> #include <linux/libfdt.h> #include <u-boot/crc.h> #else #inclu...
vuln
Vulnerable
C/C++
def index(request, is_mobile=False): hue_collections = DashboardController(request.user).get_search_collections() collection_id = request.GET.get('collection') if not hue_collections or not collection_id: return admin_collections(request, True, is_mobile) try: collection_doc = Document2.objects.get(id...
vuln
Safe
Python
private boolean nodeEquals(int firstNodeIndex, Octree.Node secondNode) { boolean firstIsBranch = treeData[firstNodeIndex] > 0; boolean secondIsBranch = (secondNode.type == BRANCH_NODE); return ((firstIsBranch && secondIsBranch) || -treeData[firstNodeIndex] == secondNode.type); // compare types (don't forget...
vuln
Vulnerable
Java
private long sendToConsumers(long energy) { //if (!mDevice.isActive()) return 0; if ((mTimer & 0x3) != 0) return 0; //if (!WirelessType.ENABLE_WIRELESS.isActivated(mDevice.getNetwork())) return 0; return chargeAllItems(energy, false); }
vuln
Safe
Java
protected void downloadFileFromRemote(URL remoteURL, File localFile) throws IOException{ // System.out.println("downloading " + remoteURL + " to: " + localFile); LOGGER.info("Downloading file {} to local file {}", remoteURL, localFile); long timeS = System.currentTimeMillis(); File tempFile = Files.creat...
vuln
Safe
Java
private void execute(Result result) { executor.execute(() -> { try { executor.submit(getTask(result)).get(getTimeout(), TimeUnit.MILLISECONDS); } catch (Throwable e) { ; onParseError(); } }); }
vuln
Vulnerable
Java
JsVar *jswrap_json_stringify(JsVar *v, JsVar *replacer, JsVar *space) { NOT_USED(replacer); JSONFlags flags = JSON_IGNORE_FUNCTIONS|JSON_NO_UNDEFINED|JSON_ARRAYBUFFER_AS_ARRAY|JSON_JSON_COMPATIBILE|JSON_ALLOW_TOJSON; JsVar *result = jsvNewFromEmptyString(); if (result) {// could be out of memory char whites...
vuln
Safe
C/C++
public function enable() { $this->checkCSRFParam(); $project = $this->getProject(); $swimlane = $this->getSwimlane($project); if ($this->swimlaneModel->enable($project['id'], $swimlane['id'])) { $this->flash->success(t('Swimlane updated successfully.')); } else {...
vuln
Safe
PHP
@Override public void onDestroy() { super.onDestroy(); runningProcess.destroy(); }
vuln
Vulnerable
Java
static int __key_instantiate_and_link(struct key *key, struct key_preparsed_payload *prep, struct key *keyring, struct key *authkey, struct assoc_array_edit **_edit) { int ret, awaken; key_check(key); key_check(keyring); awaken = 0; ret = -EBUSY; mutex_lock(&key_construc...
vuln
Vulnerable
C/C++
@Override public void g() { WStackedSpawner stackedSpawner = this.stackedSpawner.get(); if (stackedSpawner == null) { super.g(); return; } if (!hasNearbyPlayers()) { if (stackedSpawner.isDebug()) Debug.debug("StackedMobSpawner", "...
vuln
Safe
Java
n.toDataURL();if(x.length<e.length){var K=document.createElement("canvas");K.width=L;K.height=M;var B=K.toDataURL();x!==B&&(e=x,y=L,A=M)}}}catch(F){}g(e,y,A)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,g){try{var k=new Ima...
vuln
Safe
JavaScript
static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) { BMPInfo bmp_info; Image *image; IndexPacket index; MagickBooleanType status; MagickOffsetType offset, start_position; MemoryInfo *pixel_info; register IndexPacket *indexes; register ...
vuln
Vulnerable
C/C++
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
vuln
Safe
Python
private void addCertCaToTrustStore(String alias, Map<String, String> certData) { try { File certFile = File.createTempFile("tls", "-cert"); Files.write(certFile.toPath(), Base64.getDecoder().decode(certData.get(CA_CRT))); try { File trustStoreFile = File.creat...
vuln
Vulnerable
Java
static int do_sendv_recvv(int sockfd, struct iovec *iov, int len, int offset, int do_sendv) { int ret, diff, iovlen; struct iovec *last_iov; iovlen = 1; last_iov = iov; len += offset; while (last_iov->iov_len < len) { len -= last_iov->iov_len; last_...
vuln
Vulnerable
C/C++
int rpl_ext_header_srh_update(void) { #if RPL_WITH_NON_STORING struct uip_routing_hdr *rh_header; struct uip_rpl_srh_hdr *srh_header; /* Look for routing ext header */ rh_header = (struct uip_routing_hdr *)uipbuf_search_header(uip_buf, uip_len, UIP_PROTO_ROUTING); if(rh_header != NULL && rh_header->routing_...
vuln
Safe
C/C++
@Inject(method = "<init>", at = @At("TAIL")) public void noLoadingScreen(CallbackInfo ci){ MinecraftClient.getInstance().currentScreen.closeScreen(); }
vuln
Vulnerable
Java
print __('Item # %d', ($i+1)); if ($disable_controls == false) { print '</a>'; } print '</td>'; if (empty($item['data_source_name'])) { $item['data_source_name'] = __('No Task'); } switch (true) { case preg_match('/(TEXTALIGN)/', $_graph_type_name): $matrix_title = 'TEXTALIGN: ' . ucfirst($item['te...
vuln
Safe
PHP
QString Helper::temporaryMountDevice(const QString &device, const QString &name, bool readonly) { QString mount_point = mountPoint(device); if (!mount_point.isEmpty()) return mount_point; mount_point = "%1/.%2/mount/%3"; const QStringList &tmp_paths = QStandardPaths::standardLocations(QStandar...
vuln
Vulnerable
C/C++
bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) { int c; char_u buf[NUMBUFLEN + MB_MAXBYTES]; int idx = 0; char_u *end = find_termcode((char_u *)"PE"); int ret_char = -1; int save_allow_keys = allow_keys; int save_paste = p_paste; // If the end code is too long we can't...
vuln
Safe
Unknown
static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate, TALLOC_CTX *mem_ctx, struct dnsserver_zone *z, unsigned int client_version, const char *node_name, const char *start_child, enum dns_record_type record_type, unsigned int select_flag, const char *filter_st...
vuln
Vulnerable
Unknown
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
vuln
Safe
Java
private RebootPreparationError armRebootEscrow(String packageName, boolean slotSwitch) { if (packageName == null) { Slog.w(TAG, "Missing packageName when rebooting with lskf."); return new RebootPreparationError( RESUME_ON_REBOOT_REBOOT_ERROR_INVALID_PACKA...
vuln
Safe
Java
static void coroutine_fn v9fs_flush(void *opaque) { ssize_t err; int16_t tag; size_t offset = 7; V9fsPDU *cancel_pdu = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "w", &tag); if (err < 0) { pdu_complete(pdu, err); return; } ...
vuln
Safe
C/C++
sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { sctp_disposition_t retval; struct sctp_chunk *chunk = arg; struct sctp_association *new_asoc; int error = 0; char ac...
vuln
Safe
Unknown
def patch_user(**kwargs) -> APIResponse: """Update a user.""" return user_endpoint.patch_user(**kwargs)
vuln
Vulnerable
Python
static cmd_rec *make_ftp_cmd(pool *p, char *buf, size_t buflen, int flags) { register unsigned int i, j; char *arg, *ptr, *wrd; size_t arg_len; cmd_rec *cmd; pool *subpool; array_header *tarr; int have_crnul = FALSE, str_flags = PR_STR_FL_PRESERVE_COMMENTS|flags; /* Be pedantic (and RFC-compliant) by n...
vuln
Vulnerable
C/C++
private String formatDropChance() { if (chance == null) { return ""; } if (!chance.endsWith("%")) { return chance; } String chanceText = chance.substring(0, chance.length() - 1); int chanceIn; try { chanceIn = (int) (100.0 / Double.parseDouble(chanceText)); } catch (NumberFormat...
vuln
Safe
Java
static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) { VGACommonState *vga = &qxl->vga; DisplaySurface *surface; int i; if (qxl->guest_primary.resized) { qxl->guest_primary.resized = 0; qxl->guest_primary.data = qxl_phys2virt(qxl, ...
vuln
Safe
C/C++
/* * Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (a...
vuln
Safe
C/C++
ip_optprint(netdissect_options *ndo, register const u_char *cp, u_int length) { register u_int option_len; const char *sep = ""; for (; length > 0; cp += option_len, length -= option_len) { u_int option_code; ND_PRINT((ndo, "%s", sep)); sep = ","; ND_TCHECK(*cp); option_code = *cp; ND_PRI...
vuln
Safe
Unknown
static void vty_insert_word_overwrite (struct vty *vty, char *str) { int len = strlen (str); vty_write (vty, str, len); strcpy (&vty->buf[vty->cp], str); vty->cp += len; vty->length = vty->cp; }
vuln
Vulnerable
C/C++
static int http_prepare_data(HTTPContext *c, long cur_time) { int i; switch(c->state) { case HTTPSTATE_SEND_DATA_HEADER: memset(&c->fmt_ctx, 0, sizeof(c->fmt_ctx)); pstrcpy(c->fmt_ctx.author, sizeof(c->fmt_ctx.author), c->stream->author); pstrcpy(c->fmt_ctx.comment, sizeof(c->fmt_ctx...
vuln
Vulnerable
C/C++
(W.removeAttribute("disabled"),W.checked=!u.pageVisible):(W.setAttribute("disabled","disabled"),W.checked=!1)};K=200;var F=1,G=null;if(d.pdfPageExport&&!n){var N=function(){U.value=Math.max(1,Math.min(F,Math.max(parseInt(U.value),parseInt(H.value))));H.value=Math.max(1,Math.min(F,Math.min(parseInt(U.value),parseInt(H.v...
vuln
Vulnerable
JavaScript
/* * Description: * History: yang@haipo.me, 2016/03/30, create */ # include <stdlib.h> # include <assert.h> # include "ut_rpc.h" # include "ut_crc32.h" # include "ut_misc.h" int rpc_decode(nw_ses *ses, void *data, size_t max) { if (max < RPC_PKG_HEAD_SIZE) return 0; rpc_pkg *pkg = data; ...
vuln
Safe
C/C++
void HttpResponseHeaders::AddHeader(const std::string& header) { DCHECK_EQ('\0', raw_headers_[raw_headers_.size() - 2]); DCHECK_EQ('\0', raw_headers_[raw_headers_.size() - 1]); std::string new_raw_headers(raw_headers_, 0, raw_headers_.size() - 1); new_raw_headers.append(header); new_raw_headers.push_back('\...
vuln
Vulnerable
C/C++
public DefaultFileSystemResourceLoader(String path) { this(Paths.get(normalize(path))); }
vuln
Safe
Java
ftrace_regex_lseek(struct file *file, loff_t offset, int whence) { loff_t ret; if (file->f_mode & FMODE_READ) ret = seq_lseek(file, offset, whence); else file->f_pos = ret = 1; return ret; }
vuln
Vulnerable
C/C++
public Set<InheritanceVertex> getChildren() { if (children == null) { String name = getName(); children = new HashSet<>(); childrenLookup.apply(value.getName()) .stream() .filter(childName -> !name.equals(childName)) .forEach(childName -> children.add(lookup.apply(childName))); } return ch...
vuln
Safe
Java
int sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key, const char *principal, const char *sig_namespace) { FILE *f = NULL; char *line = NULL; size_t linesize = 0; u_long linenum = 0; int r = SSH_ERR_INTERNAL_ERROR, oerrno; /* Check key and principal against file */ if ((f = fopen(pat...
vuln
Vulnerable
C/C++
@Override protected void onStop() { super.onStop(); Log.d(TAG, "APP - On Stop"); mUsbMaskConnection.stop(); mVideoReader.stop(); usbConnected = false; }
vuln
Vulnerable
Java
foreach ($elem[2] as $field) { echo ' <tr class="tr_cf tr_fields hidden" id="cf_tr_'.$field[0].'"> <td valign="top" class="td_title">&nbsp;&nbsp;<i class="fa fa-caret-right"></i>&nbsp;<i>'.$field[1].'</i> :</td> <td colspan="2">'; ...
vuln
Safe
PHP
@RequiresPermissions("tag:list") @GetMapping("/list") public String list(@RequestParam(defaultValue = "1") Integer pageNo, String name, Model model) { if (StringUtils.isEmpty(name)) name = null; IPage<Tag> page = tagService.selectAll(pageNo, null, name); model.addAttribute("page", page);...
vuln
Vulnerable
Java
void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride, int parity) { int bufsize = JPC_CEILDIVPOW2(numrows, 1); jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE]; jpc_fix_t *buf = splitbuf; register jpc_fix_t *srcptr; register jpc_fix_t *dstptr; register int n; register int m; int hstartcol; /* Get a buffer. *...
vuln
Vulnerable
Unknown
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
vuln
Vulnerable
Python
private boolean isHeaderPresent(RequestContext req, ThrottleCondition.HeaderConditions conditions) { boolean status = true; Map<String, String> headers = req.getHeaders(); for (Map.Entry<String, String> entry : conditions.getValues().entrySet()) { if (headers != null) { ...
vuln
Safe
Java
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
vuln
Vulnerable
Java
static ssize_t environ_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { char *page; unsigned long src = *ppos; int ret = 0; struct mm_struct *mm = file->private_data; unsigned long env_start, env_end; /* Ensure the process spawned far enough to have an environment. */ if (!mm || !mm->e...
vuln
Safe
Unknown
static int csrhci_write(struct CharDriverState *chr, const uint8_t *buf, int len) { struct csrhci_s *s = (struct csrhci_s *) chr->opaque; int plen = s->in_len; if (!s->enable) return 0; s->in_len += len; memcpy(s->inpkt + plen, buf, len); while (1) { if (s->in_len...
vuln
Vulnerable
C/C++
/* Copyright 2015 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
Vulnerable
C/C++
Variant HHVM_METHOD(XMLReader, expand, const Variant& basenode /* = null */) { auto* data = Native::data<XMLReader>(this_); req::ptr<XMLDocumentData> doc; xmlDocPtr docp = nullptr; SYNC_VM_REGS_SCOPED(); if (!basenode.isNull()) { auto dombasenode = Native::data<DOMNode>(basenode.toObj...
vuln
Vulnerable
C/C++
int SpdyProxyClientSocket::DoReadReplyComplete(int result) { if (result < 0) return result; if (response_.headers->GetParsedHttpVersion() < HttpVersion(1, 0)) return ERR_TUNNEL_CONNECTION_FAILED; net_log_.AddEvent( NetLog::TYPE_HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS, base::Bind(&Http...
vuln
Safe
C/C++
int jpc_enc_enccblks(jpc_enc_t *enc) { jpc_enc_tcmpt_t *tcmpt; jpc_enc_tcmpt_t *endcomps; jpc_enc_rlvl_t *lvl; jpc_enc_rlvl_t *endlvls; jpc_enc_band_t *band; jpc_enc_band_t *endbands; jpc_enc_cblk_t *cblk; jpc_enc_cblk_t *endcblks; int i; int j; jpc_fix_t mx; jpc_fix_t bmx; jpc_fix_t v; jpc_enc_tile_t *ti...
vuln
Vulnerable
Unknown
def boboAwareZopeTraverse(object, path_items, econtext): """Traverses a sequence of names, first trying attributes then items. This uses zope.traversing path traversal where possible and interacts correctly with objects providing OFS.interface.ITraversable when necessary (bobo-awareness). """ r...
vuln
Safe
Python
static int MagickDLLCall PDFDelegateMessage(void *handle,const char *message, int length) { char **messages; ssize_t offset; offset=0; messages=(char **) handle; if (*messages == (char *) NULL) *messages=(char *) AcquireQuantumMemory(length+1,sizeof(char *)); else { offset=strlen(*...
vuln
Vulnerable
C/C++
static MatroskaLevel1Element *matroska_find_level1_elem(MatroskaDemuxContext *matroska, uint32_t id) { int i; MatroskaLevel1Element *elem; if (id == MATROSKA_ID_CLUSTER) if (id != MATROSKA_ID_SEEKHEAD) { for (i = 0; i < matroska->...
vuln
Vulnerable
C/C++
/* Copyright 2015 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
import logging import os import sys from functools import lru_cache from typing import Dict, Optional, Union import yaml from vault_cli import exceptions, types logger = logging.getLogger(__name__) ENV_PREFIX = "VAULT_CLI" # Ordered by increasing priority CONFIG_FILES = ["./vault.yml", "~/.vault.yml", "/etc/vault....
vuln
Vulnerable
Python
import $ from 'jquery'; import renderjson from 'renderjson'; import CodeMirror from './codeMirrorLoader'; function getParameterByName(name) { name = name.replace(/\[/, '\\[').replace(/[\]]/, '\\]'); const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); const results = regex.exec(window.location.search); ret...
vuln
Vulnerable
JavaScript
static int check_func_arg(struct bpf_verifier_env *env, u32 arg, struct bpf_call_arg_meta *meta, const struct bpf_func_proto *fn) { u32 regno = BPF_REG_1 + arg; struct bpf_reg_state *regs = cur_regs(env), *reg = &regs[regno]; enum bpf_arg_type arg_type = fn->arg_type[arg]; enum bpf_reg_type type = reg->ty...
vuln
Vulnerable
Unknown
package reason const ( // Success . Success = "base.success" // UnknownError unknown error UnknownError = "base.unknown" // RequestFormatError request format error RequestFormatError = "base.request_format_error" // UnauthorizedError unauthorized error UnauthorizedError = "base.unauthorized_error" // Database...
vuln
Safe
Go
/* * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #inc...
vuln
Vulnerable
C/C++
uint32_t vga_mem_readb(VGACommonState *s, hwaddr addr) { int memory_map_mode, plane; uint32_t ret; memory_map_mode = (s->gr[VGA_GFX_MISC] >> 2) & 3; addr &= 0x1ffff; switch(memory_map_mode) { case 0: break; case 1: if (addr >= 0x10000) return 0xff; ad...
vuln
Vulnerable
C/C++
public static NativeLong invoke(NativeLong id, Pointer selectorPointer, Object... args) { return FOUNDATION.objc_msgSend(id, selectorPointer, args); }
vuln
Vulnerable
Java
public static void main(String[] args) throws RemoteException, AlreadyBoundException { SSRFServer server = new SSRFServer(defaultPort); server.start(); Logger.printlnMixedYellow("Creating RMI-Registry on port", String.valueOf(registryPort)); Registry registry = LocateRegistry.create...
vuln
Vulnerable
Java
static int v4l2_loopback_add(struct v4l2_loopback_config *conf, int *ret_nr) { struct v4l2_loopback_device *dev; struct v4l2_ctrl_handler *hdl; struct v4l2loopback_private *vdev_priv = NULL; int err = -ENOMEM; int _max_width = DEFAULT_FROM_CONF( max_width, < V4L2LOOPBACK_SIZE_MIN_WIDTH, max_width); int _max_h...
vuln
Safe
C/C++
token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save) { os_ptr op = osp; int code; ref token; /* Note that gs_scan_token may change osp! */ pop(1); /* remove the file or scanner state */ again: code = gs_scan_token(i_ctx_p, &token, pstate); op = osp; sw...
vuln
Vulnerable
Unknown
Http::FilterDataStatus Context::onRequestBody(int body_buffer_length, bool end_of_stream) { if (!wasm_->onRequestBody_) { return Http::FilterDataStatus::Continue; } switch (wasm_ ->onRequestBody_(this, id_, static_cast<uint32_t>(body_buffer_length), static_cast<uin...
vuln
Vulnerable
C/C++
static function getParentGroup($group_id) { global $user; $mdb2 = getConnection(); $sql = "select parent_id from tt_groups where id = $group_id and org_id = $user->org_id and status = 1"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); return $val[...
vuln
Vulnerable
PHP
static MagickBooleanType ReadHEICImageByID(const ImageInfo *image_info, Image *image,struct heif_context *heif_context,heif_item_id image_id, ExceptionInfo *exception) { const char *option; int stride_y, stride_cb, stride_cr; MagickBooleanType status; ssize_t y; struct heif_dec...
vuln
Safe
C/C++
static int qcow2_cache_entry_flush(BlockDriverState *bs, Qcow2Cache *c, int i) { BDRVQcowState *s = bs->opaque; int ret = 0; if (!c->entries[i].dirty || !c->entries[i].offset) { return 0; } trace_qcow2_cache_entry_flush(qemu_coroutine_self(), c == s->l2_tabl...
vuln
Vulnerable
C/C++
bgp_capability_as4 (struct peer *peer, struct capability_header *hdr) { as_t as4 = stream_getl (BGP_INPUT(peer)); if (BGP_DEBUG (as4, AS4)) zlog_debug ("%s [AS4] about to set cap PEER_CAP_AS4_RCV, got as4 %u", peer->host, as4); SET_FLAG (peer->cap, PEER_CAP_AS4_RCV); return as4; }
vuln
Vulnerable
Unknown
z_jbig2decode(i_ctx_t * i_ctx_p) { os_ptr op = osp; ref *sop = NULL; s_jbig2_global_data_t *gref; stream_jbig2decode_state state; /* Extract the global context reference, if any, from the parameter dictionary and embed it in our stream state. The original object ref is under the JBIG2...
vuln
Vulnerable
C/C++
def define_constraint_deferrability(self, constraint): text = "" if constraint.deferrable is not None: if constraint.deferrable: text += " DEFERRABLE" else: text += " NOT DEFERRABLE" if constraint.initially is not None: text += ...
vuln
Vulnerable
Python
public boolean sendGuestScienceStop(String apkName) { if (mApkMessengers.containsKey(apkName)) { Messenger messenger = mApkMessengers.get(apkName); Message msg = Message.obtain(null, MessageType.STOP.toInt()); // Check to make sure the message and messenger aren't null ...
vuln
Safe
Java
static ssize_t stellaris_enet_receive(NetClientState *nc, const uint8_t *buf, size_t size) { stellaris_enet_state *s = qemu_get_nic_opaque(nc); int n; uint8_t *p; uint32_t crc; if ((s->rctl & SE_RCTL_RXEN) == 0) return -1; if (s->np >= 31) { return 0; } DPRINTF("Received ...
vuln
Safe
C/C++
private void addOdyseeAccountExplicitly(String currentEmail) { // Add account explicitly Account account = new Account("odysee", ARG_ACCOUNT_TYPE); AccountManager accountManager = AccountManager.get(getApplicationContext()); try { Bundle bundle = new Bundle(); bun...
vuln
Vulnerable
Java
static void pcie_mmcfg_data_write(PCIBus *s, uint32_t mmcfg_addr, uint32_t val, int len) { PCIDevice *pci_dev = pcie_dev_find_by_mmcfg_addr(s, mmcfg_addr); if (!pci_dev) { return; } pci_host_config_write_common(pci_dev, PCIE_MMCFG_CONFOFFSET(mmcfg_addr), ...
vuln
Vulnerable
C/C++
/* Copyright 2018 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
Vulnerable
Python
static int on_header_value( multipart_parser *parser, const char *at, size_t length) { multipart_parser_data_t *data = NULL; ogs_assert(parser); data = multipart_parser_get_data(parser); ogs_assert(data); if (data->num_of_part < OGS_SBI_MAX_NUM_OF_PART && at && length) { SWITCH(dat...
vuln
Safe
Unknown
void ServiceWorkerContainer::registerServiceWorkerImpl(ExecutionContext* executionContext, const KURL& rawScriptURL, const KURL& scope, PassOwnPtr<RegistrationCallbacks> callbacks) { if (!m_provider) { callbacks->onError(WebServiceWorkerError(WebServiceWorkerError::ErrorTypeState, "Failed to register a Serv...
vuln
Vulnerable
C/C++
def delete_event(self, event_id): sql = """DELETE FROM events WHERE event_id = {0} """.format(event_id) affected_count = self.cur.execute(sql) self.conn.commit() return affected_count
vuln
Vulnerable
Python
static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) { AVStream *st; int len, ret; for(;;) { st = s->cur_st; if (st) { if (!st->parser) { *pkt = s->cur_pkt; compute_pkt_fields(s, st, NULL, ...
vuln
Vulnerable
C/C++
static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { AVIContext *avi = s->priv_data; AVStream *st; int i, index; int64_t pos, pos_min; AVIStream *ast; if (!avi->index_loaded) { avi_load_index(s); avi->index_loaded = 1; } ...
vuln
Vulnerable
C/C++
issuerAndThisUpdateCheck( struct berval *in, struct berval *is, struct berval *tu, void *ctx ) { int numdquotes = 0; struct berval x = *in; struct berval ni = BER_BVNULL; /* Parse GSER format */ enum { HAVE_NONE = 0x0, HAVE_ISSUER = 0x1, HAVE_THISUPDATE = 0x2, HAVE_ALL = ( HAVE_ISSUER | HAVE_THISUPDAT...
vuln
Vulnerable
C/C++
/**@license * sysend.js - send messages between browser windows/tabs version 1.9.0 * * Copyright (C) 2014-2022 Jakub T. Jankiewicz <https://jcubic.pl/me> * Released under the MIT license * * The idea for localStorage implementation came from this StackOverflow question: * http://stackoverflow.com/q/24182409...
vuln
Vulnerable
JavaScript
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import get_path from os.path import join as join_path, exists as...
vuln
Vulnerable
Python