code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int _hostsock_getsockopt( oe_fd_t* sock_, int level, int optname, void* optval, oe_socklen_t* optlen) { int ret = -1; sock_t* sock = _cast_sock(sock_); oe_socklen_t optlen_in = 0; oe_errno = 0; if (!sock) OE_RAISE_ERRNO(OE_EINVAL); if (optlen) optlen...
vuln
Vulnerable
Unknown
function I(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}
vuln
Safe
JavaScript
static inline void gen_lookup_tb(DisasContext *s) { tcg_gen_movi_i32(cpu_R[15], s->pc & ~1); s->is_jmp = DISAS_UPDATE; }
vuln
Vulnerable
C/C++
// imagew-util.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. // This file is mainly for portability wrappers, and any code that // may require unusual header files (malloc.h, strsafe.h). #include "imagew-config.h" #include <stdio.h> #include <stdli...
vuln
Safe
C/C++
############################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
vuln
Safe
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
private ReturningRunnable<Void> _signOut(final SignOutOptions signOutOptions) { return new ReturningRunnable<Void>() { @Override public Void run() throws Exception { if (signOutOptions.isSignOutGlobally()) { final GlobalSignOutRequest globalSignOutRequ...
vuln
Vulnerable
Java
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { switch (ps_parsing) { case XML_SUSPENDED: errorCode = XML_ERROR_SUSPENDED; return XML_STATUS_ERROR; case XML_FINISHED: errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; case XML_INITIALIZED: if (parentParser == NULL &...
vuln
Safe
C/C++
static void unzzip_mem_disk_cat_file(ZZIP_MEM_DISK* disk, char* name, FILE* out) { ZZIP_DISK_FILE* file = zzip_mem_disk_fopen (disk, name); if (file) { char buffer[1025]; int len; while ((len = zzip_mem_disk_fread (buffer, 1, 1024, file))) { fwrite (buffer, 1, len, out); } zzip_mem_disk_fclose...
vuln
Vulnerable
C/C++
static long madvise_remove(struct vm_area_struct *vma, struct vm_area_struct **prev, unsigned long start, unsigned long end) { loff_t offset; int error; *prev = NULL; /* tell sys_madvise we drop mmap_sem */ if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB)) return -EINVAL; if (!vma->vm_file || !...
vuln
Vulnerable
C/C++
static int init_sig_algs(SSL *s, unsigned int context) { /* Clear any signature algorithms extension received */ OPENSSL_free(s->s3->tmp.peer_sigalgs); s->s3->tmp.peer_sigalgs = NULL; s->s3->tmp.peer_sigalgslen = 0; return 1; }
vuln
Safe
Unknown
static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, TCGv var) { int val, rm, shift, shiftop; TCGv offset; if (!(insn & (1 << 25))) { val = insn & 0xfff; if (!(insn & (1 << 23))) val = -val; if (val != ...
vuln
Vulnerable
C/C++
// Copyright 2013 Unknown // // 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 agreed to in writ...
vuln
Vulnerable
Go
static int hwahc_security_create(struct hwahc *hwahc) { int result; struct wusbhc *wusbhc = &hwahc->wusbhc; struct usb_device *usb_dev = hwahc->wa.usb_dev; struct device *dev = &usb_dev->dev; struct usb_security_descriptor *secd; struct usb_encryption_descriptor *etd; void *itr, *top; size_t itr_size, needed, b...
vuln
Vulnerable
Unknown
@Override public void onDisable() { new InfoMessage("Starting EliteMobs shutdown sequence..."); new InfoMessage("Regenerating exploded blocks..."); Explosion.regenerateAllPendingBlocks(); new InfoMessage("Cancelling tasks..."); Bukkit.getServer().getScheduler().cancelTasks...
vuln
Vulnerable
Java
static void *listen_fn_(UNUSED_ATTR void *context) { prctl(PR_SET_NAME, (unsigned long)LISTEN_THREAD_NAME_, 0, 0, 0); listen_socket_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listen_socket_ == -1) { LOG_ERROR("%s socket creation failed: %s", __func__, strerror(errno)); goto cleanup; } int enable =...
vuln
Vulnerable
C/C++
private void initializeProtoArrayForkChoice() { processHead(); }
vuln
Vulnerable
Java
private Buffer compressData(Buffer uncompressed, BufferAllocator allocator) { int len = uncompressed.readableBytes(); if (len == 0) { return allocator.allocate(0); } int sizeEstimate = (int) Math.ceil(len * 1.001) + 12; if (writeHeader) { switch (wrapper)...
vuln
Safe
Java
jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *image, int x, int y, Jbig2ComposeOp op) { /* ensure image exists first */ if (page->image == NULL) { jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1, "page info possibly missing, no image defined"); return 0; } /* grow the ...
vuln
Safe
C/C++
static bool php_mb_parse_encoding(const Variant& encoding, mbfl_encoding ***return_list, int *return_size, bool persistent) { bool ret; if (encoding.isArray()) { ret = php_mb_parse_encoding_array(encoding.toArray(), ...
vuln
Vulnerable
C/C++
arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags) { struct vm_area_struct *vma; struct mm_struct *mm = current->mm; unsigned long addr = addr0; int do_align = 0; int aliasing = cache_is_vipt_aliasing(); ...
vuln
Vulnerable
Unknown
struct dump_dir *dd_create_skeleton(const char *dir, uid_t uid, mode_t mode, int flags) { /* a little trick to copy read bits from file mode to exec bit of dir mode*/ mode_t dir_mode = mode | ((mode & 0444) >> 2); struct dump_dir *dd = dd_init(); dd->mode = mode; /* Unlike dd_opendir, can't use re...
vuln
Vulnerable
Unknown
static void __svc_rdma_free(struct work_struct *work) { struct svcxprt_rdma *rdma = container_of(work, struct svcxprt_rdma, sc_work); struct svc_xprt *xprt = &rdma->sc_xprt; dprintk("svcrdma: %s(%p)\n", __func__, rdma); if (rdma->sc_qp && !IS_ERR(rdma->sc_qp)) ib_drain_qp(rdma->sc_qp); /* We should only be ...
vuln
Safe
C/C++
function(){k.checked&&(null==g||g.checked)?q.removeAttribute("disabled"):q.setAttribute("disabled","disabled")}));mxUtils.br(d);return{getLink:function(){return k.checked?"blank"===q.value?"_blank":p:null},getEditInput:function(){return k},getEditSelect:function(){return q}}};EditorUi.prototype.addLinkSection=function(...
vuln
Safe
JavaScript
static int flic_decode_frame_8BPP(AVCodecContext *avctx, void *data, int *got_frame, const uint8_t *buf, int buf_size) { FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; int pixel_ptr; int palette_ptr; unsigned char palet...
vuln
Safe
C/C++
void V8LazyEventListener::prepareListenerObject(ExecutionContext* executionContext) { if (!executionContext) return; v8::HandleScope handleScope(toIsolate(executionContext)); v8::Local<v8::Context> v8Context = toV8Context(executionContext, world()); if (v8Context.IsEmpty()) return; ...
vuln
Safe
C/C++
const got = require('@/utils/got'); const parser = require('@/utils/rss-parser'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); const { art } = require('@/utils/render'); const path = require('path'); module.exports = async (ctx) => { const region = ctx.params.region ?? '...
vuln
Vulnerable
JavaScript
inline gravity_value_t convert_value2int (gravity_vm *vm, gravity_value_t v) { if (VALUE_ISA_INT(v)) return v; // handle conversion for basic classes if (VALUE_ISA_FLOAT(v)) return VALUE_FROM_INT((gravity_int_t)v.f); if (VALUE_ISA_BOOL(v)) return VALUE_FROM_INT(v.n); if (VALUE_ISA_NULL(v)) return VALUE_FROM_INT(...
vuln
Vulnerable
C/C++
search_in_range(regex_t* reg, const UChar* str, const UChar* end, const UChar* start, const UChar* range, /* match start range */ const UChar* data_range, /* subject string range */ OnigRegion* region, OnigOptionType option, OnigMatchParam* mp) { int r; ...
vuln
Vulnerable
Unknown
public EntityAnimation activate(DoorActivator activator, @Nullable EntityPlayer player, @Nullable UUID uuid, boolean sendUpdate) throws LittleActionException { if (mainBlock.isRemoved()) throw new LittleActionException("Structure does not exist"); if (waitingForApproval) ...
vuln
Safe
Java
kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) { if (args->flags & ~(KVM_IRQFD_FLAG_DEASSIGN | KVM_IRQFD_FLAG_RESAMPLE)) return -EINVAL; if (args->gsi >= KVM_MAX_IRQ_ROUTES) return -EINVAL; if (args->flags & KVM_IRQFD_FLAG_DEASSIGN) return kvm_irqfd_deassign(kvm, args); return kvm_irqfd_assign(kvm...
vuln
Safe
C/C++
/* * Copyright (c) 2017, Salvatore Sanfilippo <antirez at gmail dot com> * 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 copyrig...
vuln
Vulnerable
C/C++
def urlsplit(url, scheme='', allow_fragments=True): """Parse a URL into 5 components: <scheme>://<netloc>/<path>?<query>#<fragment> The result is a named 5-tuple with fields corresponding to the above. It is either a SplitResult or SplitResultBytes object, depending on the type of the url parameter...
vuln
Safe
Python
@Override public HistoricTaskInstanceQuery processVariableValueLessThanOrEqual(String name, Object value) { if (inOrStatement) { currentOrQueryObject.variableValueLessThanOrEqual(name, value, ScopeTypes.BPMN); return this; } else { return variableValueLessThanOrEq...
vuln
Vulnerable
Java
void h263_encode_picture_header(MpegEncContext * s, int picture_number) { int format; align_put_bits(&s->pb); put_bits(&s->pb, 22, 0x20); put_bits(&s->pb, 8, ((s->picture_number * 30 * FRAME_RATE_BASE) / s->frame_rate) & 0xff); put_bits(&s->pb, 1, 1); put_bits(&s->pb, ...
vuln
Vulnerable
C/C++
void Compute(OpKernelContext* context) override { const float in_min = context->input(2).flat<float>()(0); const float in_max = context->input(3).flat<float>()(0); ImageResizerState st(align_corners_, false); st.ValidateAndCreateOutput(context); if (!context->status().ok()) return; // Return ...
vuln
Vulnerable
C/C++
static void usb_pwc_disconnect(struct usb_interface *intf) { struct pwc_device *pdev; int hint; lock_kernel(); pdev = usb_get_intfdata (intf); usb_set_intfdata (intf, NULL); if (pdev == NULL) { PWC_ERROR("pwc_disconnect() Called without private pointer.\n"); goto disconnect_out; } if (pdev->udev == NULL) {...
vuln
Safe
Unknown
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { mainPage } from "../../support/page_objects/mainPage"; let storedURL = ""; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${apiType.toUpperCase()} api - FORM vie...
vuln
Vulnerable
JavaScript
public synchronized String[] find(String wildPath) throws FileSystemException { // Match all the files on the system wildPath = sanitizePath(wildPath, true); // If we don't have a wildcard at all just check the file exists int starIndex = wildPath.indexOf('*'); if (starIndex == ...
vuln
Vulnerable
Java
@Override public void onClick(DialogInterface dialog, int id) { setCursorFrequencyView.findViewById(R.id.et_cursor_freq); double freq = Double.parseDouble(et_cursor_freq.getText().toString()); graphView.setCursorFreq(freq); ...
vuln
Vulnerable
Java
import { mainPage } from "../../support/page_objects/mainPage"; import { loginPage } from "../../support/page_objects/navigation"; import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; des...
vuln
Vulnerable
JavaScript
public AppDetailsPermissionItem getPermissionItem(String permissionName, boolean isGranted) { try { PermissionInfo permissionInfo = PermissionCompat.getPermissionInfo(permissionName, mPackageInfo.packageName, PackageManager.GET_META_DATA); if (permissionInfo == null) ...
vuln
Vulnerable
Java
/* * Copyright 2021 ThoughtWorks, Inc. * * 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 agr...
vuln
Vulnerable
Java
private void batchCreateEvents(List<RedoLogContent> redoLogContentList, List<TapEvent> eventList, AtomicReference<RedoLogContent> lastRedoLogContent) { for (RedoLogContent redoLogContent : redoLogContentList) { lastRedoLogContent.set(redoLogContent); if (EmptyKit.isNull(Objects.requireNo...
vuln
Vulnerable
Java
function isCleanHtml(content) { var events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; events += '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprin...
vuln
Safe
JavaScript
static void handle_read_req(struct bt_att_chan *chan, struct bt_gatt_server *server, uint8_t opcode, uint16_t handle, uint16_t offset) { struct gatt_db_attribute *attr; uint8_t ecode; struct async_read_op *op = NULL; ecode = authorize_req(server, opcode, handle); if (ecode) goto error; attr = gatt_db_...
vuln
Vulnerable
Unknown
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License") + yo...
vuln
Vulnerable
Java
package version import ( "strconv" "strings" ) // Version is the service current released version. // Semantic versioning: https://semver.org/ var Version = "0.10.0" // DevVersion is the service current development version. var DevVersion = "0.10.0" func GetCurrentVersion(mode string) string { if mode == "dev" {...
vuln
Safe
Go
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
vuln
Safe
Java
PHP_FUNCTION(link) { char *topath, *frompath; size_t topath_len, frompath_len; int ret; char source_p[MAXPATHLEN]; char dest_p[MAXPATHLEN]; wchar_t *dstw, *srcw; /*First argument to link function is the target and hence should go to frompath Second argument to link function is the link itself and hence shoul...
vuln
Vulnerable
Unknown
package com.salesmanager.shop.admin.controller; import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereoty...
vuln
Safe
Java
public function createFromBill(Request $request, Bill $bill) { $request->session()->flash('info', (string)trans('firefly.instructions_rule_from_bill', ['name' => $bill->name])); $this->createDefaultRuleGroup(); $this->createDefaultRule(); $preFilled = [ 'strict' => ...
vuln
Vulnerable
PHP
/* * XDR support for nfsd/protocol version 3. * * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de> * * 2003-08-09 Jamie Lokier: Use htonl() for nanoseconds, not htons()! */ #include <linux/namei.h> #include <linux/sunrpc/svc_xprt.h> #include "xdr3.h" #include "auth.h" #include "netns.h" #include "vf...
vuln
Vulnerable
C/C++
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
vuln
Safe
C/C++
static void text_console_resize(QemuConsole *s) { TextCell *cells, *c, *c1; int w1, x, y, last_width; last_width = s->width; s->width = surface_width(s->surface) / FONT_WIDTH; s->height = surface_height(s->surface) / FONT_HEIGHT; w1 = last_width; if (s->width < w1) w1 = s->width; ...
vuln
Vulnerable
C/C++
static ssize_t f_hidg_write(struct file *file, const char __user *buffer, size_t count, loff_t *offp) { struct f_hidg *hidg = file->private_data; struct usb_request *req; unsigned long flags; ssize_t status = -ENOMEM; if (!access_ok(buffer, count)) return -EFAULT; spin_lock_irqsave(&hidg->write_spinlo...
vuln
Safe
C/C++
@staticmethod def upsert_mapped_projects(user_id: int, project_id: int): """ Adds projects to mapped_projects if it doesn't exist """ sql = "select * from users where id = :user_id and projects_mapped @> '{{:project_id}}'" result = db.engine.execute(text(sql), user_id=user_id, project_id=pro...
vuln
Safe
Python
public BigInteger calculateAgreement( CipherParameters pubKey) { DHPublicKeyParameters pub = (DHPublicKeyParameters)pubKey; if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } ...
vuln
Safe
Java
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { const auto* params = reinterpret_cast<TfLiteSVDFParams*>(node->builtin_data); OpData* op_data = reinterpret_cast<OpData*>(node->user_data); int scratch_tensor_index = op_data->scratch_tensor_index; // Check we have all the inputs and outputs we n...
vuln
Safe
Unknown
@SuppressWarnings("unused") public static DamageSource getPlayerDamage(@Nullable EntityPlayer source) { ItemStack stack = source != null ? source.getHeldItemMainhand() : ItemStack.EMPTY; if (!stack.isEmpty() && stack.getItem() instanceof IGTTool) { IGTTool tool = (IGTTool) stack.getItem(...
vuln
Safe
Java
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { BC_STATUS ret; BC_DTS_STATUS decoder_status = { 0, }; CopyRet rec_ret; CHDContext *priv = avctx->priv_data; HANDLE dev = priv->dev; uint8_t *in_data = avpkt->data; int len = avpkt->...
vuln
Vulnerable
C/C++
App.Actions.DB.update_dns_record_hint = function(elm, hint) { // clean hint if (hint.trim() == '') { $(elm).parent().find('.hint').html(''); } // set domain name without rec in case of @ entries if (hint == '@') { hint = ''; } // dont show pregix if domain name = rec value ...
vuln
Vulnerable
JavaScript
public TransferredResource createFolder(String parentUUID, String folderName) throws GenericException, NotFoundException, AuthorizationDeniedException { Path parentPath; RodaCoreFactory.checkIfWriteIsAllowedAndIfFalseThrowException(nodeType); if (parentUUID != null) { TransferredResource parent ...
vuln
Safe
Java
@Override protected void onAuthenticated(@Nullable Bundle savedInstanceState) { setContentView(R.layout.activity_help); setSupportActionBar(findViewById(R.id.toolbar)); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) actionBar.setTitle(R.string.instructions); ...
vuln
Safe
Java
def upload_scan(self, filename): url = self.get_apibase() + "/scan/data/?mode=replace" headers = self.get_headers() if filename.endswith('.json') or filename.endswith('.jsonld'): headers['Content-Type'] = 'application/ld+json' with open(filename,"r") as f: ...
vuln
Safe
Python
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt // My HTTP Request frappe.provide('frappe.request'); frappe.provide('frappe.request.error_handlers'); frappe.request.url = '/'; frappe.request.ajax_count = 0; frappe.request.waiting_for_ajax = []; frappe.request.logs...
vuln
Vulnerable
Python
@Override protected void onSaveInstanceState(Bundle outState) { outState.putParcelable("fair:intent", getIntent()); outState.putBoolean("fair:toggle", drawerToggle.isDrawerIndicatorEnabled()); outState.putBoolean("fair:searching", searching); super.onSaveInstanceState(outState); ...
vuln
Vulnerable
Java
void Compute(OpKernelContext *ctx) override { const Tensor *indices_t, *values_t, *shape_t, *dense_t; OP_REQUIRES_OK(ctx, ctx->input("sp_indices", &indices_t)); OP_REQUIRES_OK(ctx, ctx->input("sp_values", &values_t)); OP_REQUIRES_OK(ctx, ctx->input("sp_shape", &shape_t)); OP_REQUIRES_OK(ctx, ctx->in...
vuln
Safe
C/C++
public void setUseYn(String[] useYn) { this.useYn = useYn; }
vuln
Vulnerable
Java
@Override @SuppressWarnings("unchecked") public void init(H http) { JwtSecurityContextRepository jwtSecurityContextRepository = new JwtSecurityContextRepository(); SecurityContextConfigurer<H> securityContext = http .getConfigurer(SecurityContextConfigurer.class); if (sec...
vuln
Safe
Java
@Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { boolean urlCondition = jdkOption && owner.equals("java/net/URL") && name.equals("<init>") && desc.equals("(Ljava/lang/String;)V"); boolean urlOpenCondition = jdkOption && owner.eq...
vuln
Safe
Java
def _ensureSnapshotsFolder(self, subdir=None): """ Ensure that the appropriate snapshot folder exists. """ path = ['snapshots', self._snapshot_id] if subdir is not None: path.extend(subdir.split('/')) current = self._tool for element in path: i...
vuln
Safe
Python
int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path, u64 devid) { struct btrfs_device *device; struct btrfs_fs_devices *cur_devices; struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; u64 num_devices; int ret = 0; mutex_lock(&uuid_mutex); num_devices = btrfs_num_devices(fs_...
vuln
Vulnerable
C/C++
IDNSpoofChecker::IDNSpoofChecker() { UErrorCode status = U_ZERO_ERROR; checker_ = uspoof_open(&status); if (U_FAILURE(status)) { checker_ = nullptr; return; } uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE); SetAllowedUnicodeSet(&status); int32_t checks = uspoof_getChecks(check...
vuln
Safe
C/C++
static inline void i2alaw_array (const int *ptr, int count, unsigned char *buffer) { while (--count >= 0) { if (ptr [count] == INT_MIN) buffer [count] = alaw_encode [INT_MAX >> (16 + 4)] ; else if (ptr [count] >= 0) buffer [count] = alaw_encode [ptr [count] >> (16 + 4)] ; else buffer [count] = 0x7F & alaw...
vuln
Safe
C/C++
function Editor(container,params){_classCallCheck(this,Editor),this.container=container,this.init(container,params);}
vuln
Vulnerable
JavaScript
GF_Err HintFile(GF_ISOFile *file, u32 MTUSize, u32 max_ptime, u32 rtp_rate, u32 base_flags, Bool copy_data, Bool interleave, Bool regular_iod, Bool single_group, Bool hint_no_offset) { GF_ESD *esd; GF_InitialObjectDescriptor *iod; u32 i, val, res, streamType; u32 sl_mode, prev_ocr, single_ocr, nb_done, tot_bw, bw, ...
vuln
Vulnerable
Unknown
@Command( aliases = {"finish", "end"}, desc = "End the match", usage = "[competitor]", perms = Permissions.STOP) public void end(Match match, @Maybe Party team) { if (!match.finish(team instanceof Competitor ? (Competitor) team : null)) { throw exception("admin.end.unknownError"); ...
vuln
Vulnerable
Java
<input type="hidden" value="' . $wgRequest->getVal( 'token' ) . '" name="wpEditToken" /> </form> </html>'; return $form; } return "exec must be one of the following: edit, preview, set"; }
vuln
Safe
PHP
static int iw_process_rows_intermediate_to_final(struct iw_context *ctx, int intermed_channel, const struct iw_csdescr *out_csdescr) { int i,j; int z; int k; int retval=0; iw_tmpsample tmpsamp; iw_tmpsample alphasamp = 0.0; iw_tmpsample *inpix_tofree = NULL; // Used if we need a separate temp buffer for input...
vuln
Safe
C/C++
var equipmentTable = $('#equipment-table').DataTable({ 'order': [[0, 'asc']], 'select': 'single', 'initComplete': function() { this.api().row({ order: 'current' }, 0).select(); DisplayEquipment($('#equipment-table tbody tr:eq(0)').data("equipment-id")); } }); $('#equipment-table tbody').removeClass("d-none");...
vuln
Vulnerable
JavaScript
protected void traceLdapEnv(Properties env) { if (trace) { Properties tmp = new Properties(); tmp.putAll(env); String credentials = tmp.getProperty(Context.SECURITY_CREDENTIALS); String bindCredential = tmp.getProperty(BIND_CREDENTIAL); if (credentia...
vuln
Safe
Java
/* * Copyright 2017-2019 original authors * * 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 agre...
vuln
Safe
Java
/* 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
bool Monitor::ms_verify_authorizer(Connection *con, int peer_type, int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply, bool& isvalid, CryptoKey& session_key, std::unique_ptr<AuthAuthorizerChallenge> *challenge) { dout(10) << "ms_verify_authorizer " << con->get_peer_add...
vuln
Safe
Unknown
public function testOnKernelResponseListenerRemovesItself() { $session = $this->createMock(SessionInterface::class); $session->expects($this->any())->method('getName')->willReturn('SESSIONNAME'); $tokenStorage = $this->createMock(TokenStorageInterface::class); $dispatcher = $this->cr...
vuln
Vulnerable
PHP
public SecurityContext createSchedulerSecurityContext() { SecurityContext context = SecurityContextHolder.createEmptyContext(); UserContext userContext = getAdminContext(); Collection<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList("ROLE_ADMIN"); context.setAuthentica...
vuln
Safe
Java
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onFall(final GenericGameEvent event) { Entity entity = event.getEntity(); if (entity == null) return; Block below = entity.getLocation().getBlock().getRelative(BlockFace.DOWN); SoundGroup soundGroup = ...
vuln
Vulnerable
Java
def run(self): # (use the exposed "run" method, because if we specify a thread target # of a private method, threading.Thread will keep a reference to it # indefinitely, creating a GC cycle and not letting Transport ever be # GC'd. it's a bug in Thread.) # Hold reference to 'sys...
vuln
Vulnerable
Python
void impeg2d_dec_user_data(dec_state_t *ps_dec) { UWORD32 u4_start_code; stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; u4_start_code = impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN); while(u4_start_code == USER_DATA_START_CODE) { impeg2d_bit_stream_flush(ps_stream,START...
vuln
Vulnerable
C/C++
static void stellaris_init(const char *kernel_filename, const char *cpu_model, DisplayState *ds, stellaris_board_info *board) { static const int uart_irq[] = {5, 6, 33, 34}; static const int timer_irq[] = {19, 21, 23, 35}; static const uint32_t gpio_addr[7] = { 0x40004000, 0...
vuln
Vulnerable
C/C++
/* * Copyright 2017-2020 original authors * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
vuln
Vulnerable
Java
private void concludeMarkFile() { final String aeronDirectory = aeron.context().aeronDirectoryName(); final String authenticatorClassName = authenticatorSupplier.getClass().getName(); ClusterMarkFile.checkHeaderLength( aeronDirectory, controlCh...
vuln
Safe
Java
static void read_tree(GetBitContext *gb, Tree *tree) { uint8_t tmp1[16], tmp2[16], *in = tmp1, *out = tmp2; int i, t, len; tree->vlc_num = get_bits(gb, 4); if (!tree->vlc_num) { for (i = 0; i < 16; i++) tree->syms[i] = i; return; } if (get_bits1(gb)) { len = g...
vuln
Vulnerable
C/C++
static int read_packet(AVFormatContext *s, AVPacket *pkt) { PAFDemuxContext *p = s->priv_data; AVIOContext *pb = s->pb; uint32_t count, offset; int size, i; if (p->current_frame >= p->nb_frames) return AVERROR_EOF; if (url_feof(pb)) return AVERROR_EOF; ...
vuln
Vulnerable
C/C++
z_jpx_decode(i_ctx_t * i_ctx_p) { os_ptr op = osp; ref *sop = NULL; ref *csname = NULL; stream_jpxd_state state; /* it's our responsibility to call set_defaults() */ state.memory = imemory->non_gc_memory; if (s_jpxd_template.set_defaults) (*s_jpxd_template.set_defaults)((stream_state ...
vuln
Vulnerable
Unknown
static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream *vstream, int64_t max_pos) { unsigned int arraylen = 0, timeslen = 0, fileposlen = 0, i; double num_val; char str_val[256]; int64_t *times = NULL; int64_t *filepositions = NULL; int ret = AVERROR(ENOSYS); int64_t...
vuln
Safe
C/C++
static int __rtp_recvfrom(struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int rtcp) { int len; struct ast_rtp *rtp = ast_rtp_instance_get_data(instance); #if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP) char *in = buf; #e...
vuln
Vulnerable
C/C++
static MachineClass *machine_parse(const char *name) { MachineClass *mc = NULL; GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false); if (name) { mc = find_machine(name); } if (mc) { return mc; } if (name && !is_help_option(name)) { error_report("Unsuppo...
vuln
Vulnerable
C/C++
function writeCommentDate(comment, dateDiv) { dateDiv.innerText = ''; var ts = new Date(comment.modifiedDate); var str = editorUi.timeSince(ts); if (str == null) { str = mxResources.get('lessThanAMinute'); } mxUtils.write(dateDiv, mxResources.get('timeAgo', [str], '{1} ago')); dateDiv.setAttri...
vuln
Safe
JavaScript