code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
BGD_DECLARE(gdImagePtr) gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold) { const int width = gdImageSX(im); const int height = gdImageSY(im); int x,y; int match; gdRect crop; crop.x = 0; crop.y = 0; crop.width = 0; crop.height = 0; /* Pierre: crop everything sounds bad *...
vuln
Vulnerable
C/C++
public function lostpasswordAction(Request $request, BruteforceProtectionHandler $bruteforceProtectionHandler) { $view = $this->buildLoginPageViewModel(); $error = null; if ($request->getMethod() === 'POST' && $username = $request->get('username')) { $user = User::getByName($use...
vuln
Safe
PHP
public void authChallengeSuccessCallback(AuthData authChallenge, boolean useOriginalAuthState, String authRole, int clientProtocolVersion, S...
vuln
Vulnerable
Java
package com.salesmanager.core.business.services.catalog.product.attribute; import java.util.List; import com.salesmanager.core.business.exception.ServiceException; import com.salesmanager.core.business.services.common.generic.SalesManagerEntityService; import com.salesmanager.core.model.catalog.product.Product; impor...
vuln
Safe
Java
package version import ( "strconv" "strings" ) // Version is the service current released version. // Semantic versioning: https://semver.org/ var Version = "0.9.1" // DevVersion is the service current development version. var DevVersion = "0.9.1" func GetCurrentVersion(mode string) string { if mode == "dev" { ...
vuln
Vulnerable
Go
/****************************************************************************** * emulate.c * * Generic x86 (32-bit and 64-bit) instruction decoder and emulator. * * Copyright (c) 2005 Keir Fraser * * Linux coding style, mod r/m decoder, segment base fixes, real-mode * privileged instructions: * * Copyright (...
vuln
Safe
C/C++
static void curl_close(BlockDriverState *bs) { BDRVCURLState *s = bs->opaque; DPRINTF("CURL: Close\n"); curl_detach_aio_context(bs); qemu_mutex_destroy(&s->mutex); g_free(s->cookie); g_free(s->url); }
vuln
Vulnerable
C/C++
void Fill(OpKernelContext* ctx, random::PhiloxRandom random, Tensor* output) override { const Tensor& alpha_t = ctx->input(2); TensorShape samples_shape = output->shape(); OP_REQUIRES(ctx, TensorShapeUtils::EndsWith(samples_shape, alpha_t.shape()), errors::InvalidArgument( ...
vuln
Safe
C/C++
static void ahci_init_d2h(AHCIDevice *ad) { IDEState *ide_state = &ad->port.ifs[0]; AHCIPortRegs *pr = &ad->port_regs; if (ad->init_d2h_sent) { return; } if (ahci_write_fis_d2h(ad)) { ad->init_d2h_sent = true; pr->sig = ((uint32_t)ide_state->hcyl << 24) | ...
vuln
Safe
C/C++
static VALUE cState_space_before_set(VALUE self, VALUE space_before) { unsigned long len; GET_STATE(self); Check_Type(space_before, T_STRING); len = RSTRING_LEN(space_before); if (len == 0) { if (state->space_before) { ruby_xfree(state->space_before); state->space_bef...
vuln
Vulnerable
Unknown
static void sx1_init(MachineState *machine, const int version) { struct omap_mpu_state_s *mpu; MemoryRegion *address_space = get_system_memory(); MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *flash_1 = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); static uint32...
vuln
Vulnerable
C/C++
yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2, unsigned U, unsigned V, unsigned A1, unsigned A2, const void *_r, const void *_g, const void *_b, int y, enum PixelFormat target, int hasAlpha) { if (target == PIX_FMT_ARGB || target == PIX_FMT_RGBA || t...
vuln
Safe
C/C++
/* * 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
Vulnerable
Java
def remote_media_thumbnail_rel_legacy( self, server_name: str, file_id: str, width: int, height: int, content_type: str ) -> str: top_level_type, sub_type = content_type.split("/") file_name = "%i-%i-%s-%s" % (width, height, top_level_type, sub_type) return os.path.join( ...
vuln
Vulnerable
Python
static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile, unsigned *nb_files_alloc) { ConcatContext *cat = avf->priv_data; ConcatFile *file; char *url = NULL; size_t url_len; int ret; if (cat->safe > 0 && !safe_filename(filename)) { av_log(avf, AV_...
vuln
Safe
C/C++
void avfilter_destroy(AVFilterContext *filter) { int i; if(filter->filter->uninit) filter->filter->uninit(filter); for(i = 0; i < filter->input_count; i ++) { if(filter->inputs[i]) { if (filter->inputs[i]->src) filter->inputs[i]->src->outputs[filter->inputs[i]->srcpad...
vuln
Safe
C/C++
void getvcol( win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end) { colnr_T vcol; char_u *ptr; // points to current char char_u *posptr; // points to char at pos->col char_u *line; // start of the line int incr; int head; #ifdef FEAT_VARTABS int *vt...
vuln
Safe
C/C++
static void gen_mtmsrd(DisasContext *ctx) { CHK_SV; #if !defined(CONFIG_USER_ONLY) if (ctx->opcode & 0x00010000) { TCGv t0 = tcg_temp_new(); tcg_gen_andi_tl(t0, cpu_gpr[rS(ctx->opcode)], (1 << MSR_RI) | (1 << MSR_EE)); tcg_gen_andi_tl(cpu_msr, cpu_msr, ~(target_ulong)((1 << MSR_...
vuln
Safe
C/C++
async def on_send_leave_request(self, origin: str, content: JsonDict) -> dict: logger.debug("on_send_leave_request: content: %s", content) assert_params_in_dict(content, ["room_id"]) room_version = await self.store.get_room_version(content["room_id"]) pdu = event_from_pdu_json(content, ...
vuln
Safe
Python
target_ulong helper_add_suov(CPUTriCoreState *env, target_ulong r1, target_ulong r2) { int64_t t1 = extract64(r1, 0, 32); int64_t t2 = extract64(r2, 0, 32); int64_t result = t1 + t2; return suov32(env, result); }
vuln
Vulnerable
C/C++
Status ConstantFolding::IsSimplifiableReshape( const NodeDef& node, const GraphProperties& properties) const { if (!IsReshape(node)) { return errors::Internal("Node ", node.name(), " is not a Reshape node"); } if (2 > node.input_size()) { return errors::Internal("Node ", node.name(), ...
vuln
Vulnerable
C/C++
#if !defined(MONGO_ENV_STANDARD) && (defined(_WIN32) || defined(_WIN64)) /* env_win32.c */ /* Copyright 2009-2012 10gen 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 ...
vuln
Safe
C/C++
@Override public int compress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) { long inputAddress = ARRAY_BYTE_BASE_OFFSET + inputOffset; long outputAddress = ARRAY_BYTE_BASE_OFFSET + outputOffset; return Lz4RawCompressor.compress(in...
vuln
Vulnerable
Java
static void patch_pci_windows(PcPciInfo *pci, uint8_t *start, unsigned size) { ACPI_BUILD_SET_LE(start, size, acpi_pci32_start[0], 32, pci->w32.begin); ACPI_BUILD_SET_LE(start, size, acpi_pci32_end[0], 32, pci->w32.end - 1); if (pci->w64.end || pci->w64.begin) { ACPI_BUILD_SET_LE(start, size, acpi_p...
vuln
Safe
C/C++
static void build_request(h2o_req_t *req, h2o_iovec_t *method, h2o_url_t *url, h2o_headers_t *headers, h2o_httpclient_properties_t *props, int keepalive, const char *upgrade_to, int use_proxy_protocol, int *reprocess_if_too_early, h2o_url_t *origin) { size_t remot...
vuln
Vulnerable
C/C++
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator( VaapiVideoDecodeAccelerator* vaapi_dec, VaapiWrapper* vaapi_wrapper) : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) { DCHECK(vaapi_wrapper_); DCHECK(vaapi_dec_); }
vuln
Vulnerable
C/C++
static bool vmxnet_tx_pkt_parse_headers(struct VmxnetTxPkt *pkt) { struct iovec *l2_hdr, *l3_hdr; size_t bytes_read; size_t full_ip6hdr_len; uint16_t l3_proto; assert(pkt); l2_hdr = &pkt->vec[VMXNET_TX_PKT_L2HDR_FRAG]; l3_hdr = &pkt->vec[VMXNET_TX_PKT_L3HDR_FRAG]; bytes_read = iov_to_...
vuln
Vulnerable
C/C++
static void smtp_log_to_file(smtp_t *smtp) { FILE *fp = fopen("/tmp/smtp-alert.log", "a"); time_t now; struct tm tm; char time_buf[25]; int time_buf_len; time(&now); localtime_r(&now, &tm); time_buf_len = strftime(time_buf, sizeof time_buf, "%a %b %e %X %Y", &tm); fprintf(fp, "%s: %s -> %s\n" "%*sSubje...
vuln
Vulnerable
C/C++
public boolean isServersOK() { this.updateServersStatus(); double numServersWithOkStatus = 0; for (HostAddress hostAddress : addresses) { if (serversStatus.get(hostAddress) == S_OK) { numServersWithOkStatus++; } } // Check health rate. ...
vuln
Safe
Java
public function beforeAction($action) { // Bypass when not installed for installer if (empty(Yii::$app->params['installed']) && Yii::$app->controller->module != null && Yii::$app->controller->module->id == 'installer') { return true; } ...
vuln
Safe
PHP
int archive_write_disk_set_acls(struct archive *a, int fd, const char *name, struct archive_acl *abstract_acl, __LA_MODE_T mode) { int ret = ARCHIVE_OK; (void)mode; /* UNUSED */ if ((archive_acl_types(abstract_acl) & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) { if ((archive_acl_types(abstract_acl) & A...
vuln
Vulnerable
C/C++
@Override public ViewController<?> getTargetParent (Invalidator context) { return this.parent; }
vuln
Vulnerable
Java
static void kvm_hwpoison_page_add(ram_addr_t ram_addr) { HWPoisonPage *page; QLIST_FOREACH(page, &hwpoison_page_list, list) { if (page->ram_addr == ram_addr) { return; } } page = g_malloc(sizeof(HWPoisonPage)); page->ram_addr = ram_addr; QLIST_INSERT_HEAD(&hwpoison_pa...
vuln
Vulnerable
C/C++
public List<Rect2i> getTabRectangles() { List<Rect2i> ret = new ArrayList<>(); children.forEach(child -> ret.add(child.getRectangle())); return ret; }
vuln
Vulnerable
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
def set_k304(self) -> bool: v = self.uparam["k304"].lower() if v == "y": dur = 86400 * 299 else: dur = None v = "x" ck = gencookie("k304", v, self.args.R, False, dur) self.out_headerlist.append(("Set-Cookie", ck)) self.redirect("", "?h...
vuln
Safe
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Safe
C/C++
static s32 gf_hevc_read_vps_bs_internal(GF_BitStream *bs, HEVCState *hevc, Bool stop_at_vps_ext) { u8 vps_sub_layer_ordering_info_present_flag, vps_extension_flag; u32 i, j; s32 vps_id; HEVC_VPS *vps; u8 layer_id_included_flag[MAX_LHVC_LAYERS][64]; //nalu header already parsed vps_id = gf_bs_read_int_log(bs, 4,...
vuln
Safe
C/C++
function Pe(e,t){if(i(e)&&d(t))return void e.splice(t,1);const n=e.__ob__;e._isVue||n&&n.vmCount||Fe(e)||x(e,t)&&(delete e[t],n&&n.dep.notify())}
vuln
Safe
JavaScript
def nextRandomString(bitsEntropy: i32 = 130, base36: Bo = true, base64UrlSafe: Bo = false): St = { require(base36 != base64UrlSafe) if (base36) { // Hmm the resulting length is a bit random — if the BigInteger happens to start // with 0, the base 36 encoding will be shorter (leading zeroes...
vuln
Safe
Scala
static struct task_struct *copy_process(unsigned long clone_flags, unsigned long stack_start, struct pt_regs *regs, unsigned long stack_size, int __user *child_tidptr, struct pid *pid, int trace) { int retval; struct task_struct *p; int cgroup_callbacks_done = 0; if ((clone_flags & (C...
vuln
Safe
C/C++
static abi_ulong copy_elf_strings(int argc,char ** argv, void **page, abi_ulong p) { char *tmp, *tmp1, *pag = NULL; int len, offset = 0; if (!p) { return 0; } while (argc-- > 0) { tmp = argv[argc]; if (!tmp) { fprintf(stder...
vuln
Safe
C/C++
http_isfiltered(const struct http *fm, unsigned u, unsigned how) { const char *e; const struct http_hdrflg *f; if (fm->hdf[u] & HDF_FILTER) return (1); e = strchr(fm->hd[u].b, ':'); if (e == NULL) return (0); f = http_hdr_flags(fm->hd[u].b, e); return (f != NULL && f->flag & how); }
vuln
Vulnerable
C/C++
NativeModule::NativeModule(const std::string& filename) : init(nullptr) { if (!IsolateEnvironment::GetCurrent()->IsDefault()) { throw RuntimeGenericError("NativeModule may only be instantiated from default nodejs isolate"); } if (uv_dlopen(filename.c_str(), &lib) != 0) { throw RuntimeGenericError("Failed to load...
vuln
Safe
C/C++
public void setProperty(final String propertyName, final String propertyValue) { try { if (hasCustomVersion() || hasInternalVersion()) { throw new IllegalArgumentException( format("File %s cannot be modified directly, as a writable version exists", propertyNam...
vuln
Safe
Java
ba,ja,ia){function ma(La,Ta){null==Ja?(Ga=La,Ga=/^https?:\/\//.test(Ga)&&!b.editor.isCorsEnabledForUrl(Ga)?PROXY_URL+"?url="+encodeURIComponent(Ga):TEMPLATE_PATH+"/"+Ga,mxUtils.get(Ga,mxUtils.bind(this,function(Ua){200<=Ua.getStatus()&&299>=Ua.getStatus()&&(Ja=Ua.getText());Ta(Ja,Ga)}))):Ta(Ja,Ga)}function qa(La,Ta,Ua)...
vuln
Vulnerable
JavaScript
static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l) { TCGMemOp opc = l->opc; TCGMemOp s_bits = opc & MO_SIZE; uint8_t **label_ptr = &l->label_ptr[0]; TCGReg retaddr; tcg_patch32(label_ptr[0], s->code_ptr - label_ptr[0] - 4); if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) ...
vuln
Safe
C/C++
struct _mdi *_WM_ParseNewXmi(uint8_t *xmi_data, uint32_t xmi_size) { struct _mdi *xmi_mdi = NULL; uint32_t xmi_tmpdata = 0; uint8_t xmi_formcnt = 0; uint32_t xmi_catlen = 0; uint32_t xmi_subformlen = 0; uint32_t i = 0; uint32_t j = 0; uint32_t xmi_evntlen = 0; uint32_t xmi_divisions...
vuln
Vulnerable
C/C++
@Override public void truncate() { synchronized (lock) { super.truncate(); log.info("{} CLEAR ALL", tableLogHeader()); cache.invalidateAll(); } }
vuln
Safe
Java
protected void updateLoops(){ //clear loops when in menu if(!state.isGame()){ sounds.clear(); return; } float avol = Core.settings.getInt("ambientvol", 100) / 100f; sounds.each((sound, data) -> { data.curVolume = Mathf.lerpDelta(data.curVolum...
vuln
Vulnerable
Java
static int mptctl_eventreport (unsigned long arg) { struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; struct mpt_ioctl_eventreport karg; MPT_ADAPTER *ioc; int iocnum; int numBytes, maxEvents, max; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { printk(KERN_ERR M...
vuln
Vulnerable
C/C++
static void InsertStdSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_std_sampler_interval, uint16_t offset_std_sampler_algorithm) { option_offset_t **t; t = &(fs->option_offset_table); while ( *t ) { if ( (*t)->id == id ) { // table already known to us - update data dbg_printf("Found existing std ...
vuln
Vulnerable
Unknown
public void setHideApps(View view) { if (prefMgr.getIsHidden()) { Toast.makeText(this, R.string.setting_not_ava_when_hidden, Toast.LENGTH_SHORT).show(); return; } if (!hider.appHider.checkAvailability()) { Toast.makeText(this, R.string.apphider_not_ava, Toas...
vuln
Vulnerable
Java
static void integratorcm_init(int memsz, uint32_t flash_offset) { int iomemtype; integratorcm_state *s; s = (integratorcm_state *)qemu_mallocz(sizeof(integratorcm_state)); s->cm_osc = 0x01000048; s->cm_auxosc = 0x0007feff; s->cm_sdram = 0x00011122; if (memsz >= 256) { integrator...
vuln
Vulnerable
C/C++
void sctp_generate_t3_rtx_event(unsigned long peer) { int error; struct sctp_transport *transport = (struct sctp_transport *) peer; struct sctp_association *asoc = transport->asoc; struct sock *sk = asoc->base.sk; struct net *net = sock_net(sk); /* Check whether a task is in the sock. */ bh_lock_sock(sk); if...
vuln
Safe
Unknown
TfLiteTensor* GetVariableInput(TfLiteContext* context, const TfLiteNode* node, int index) { TfLiteTensor* tensor = GetMutableInput(context, node, index); if (tensor == nullptr) return nullptr; return tensor->is_variable ? tensor : nullptr; }
vuln
Safe
C/C++
static void vnc_connect(VncDisplay *vd, int csock, bool skipauth, bool websocket) { VncState *vs = g_malloc0(sizeof(VncState)); int i; vs->csock = csock; vs->vd = vd; if (skipauth) { vs->auth = VNC_AUTH_NONE; vs->subauth = VNC_AUTH_INVALID; } else { if (websocke...
vuln
Vulnerable
C/C++
/* * Copyright (c) 2008-2017, 2019-2020 Nicira, 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 applic...
vuln
Safe
C/C++
void do_POWER_div (void) { uint64_t tmp; if (((int32_t)T0 == INT32_MIN && (int32_t)T1 == -1) || (int32_t)T1 == 0) { T0 = (long)((-1) * (T0 >> 31)); env->spr[SPR_MQ] = 0; } else { tmp = ((uint64_t)T0 << 32) | env->spr[SPR_MQ]; env->spr[SPR_MQ] = tmp % T1; T0 = tmp / (i...
vuln
Vulnerable
C/C++
static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor) { int code, value, ofs = 0; char layout[16] = {0}; do { code = avio_r8(pb); value = avio_r8(pb); av_dlog(NULL, "pixel layout: code %#x\n", code); if (ofs <= 14) { layout[ofs++] = code; ...
vuln
Safe
C/C++
void tls_cert_generate(TALLOC_CTX *mem_ctx, const char *hostname, const char *keyfile, const char *certfile, const char *cafile) { gnutls_x509_crt cacrt, crt; gnutls_x509_privkey key, cakey; uint32_t serial = (uint32_t)time(NULL); unsigned char keyid[100]; char buf[4096]; size_t bufsi...
vuln
Safe
Unknown
int ssl3_enc(SSL *s, int send) { SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; unsigned long l; int bs,i,mac_size=0; const EVP_CIPHER *enc; if (send) { ds=s->enc_write_ctx; rec= &(s->s3->wrec); if (s->enc_write_ctx == NULL) enc=NULL; else enc=EVP_CIPHER_CTX_cipher(s->enc_write_ctx); } else { ds=s...
vuln
Safe
Unknown
@Override public TaskQuery caseVariableValueLessThanOrEqual(String name, Object value) { if (orActive) { currentOrQueryObject.scopedVariableValueLessThanOrEqual(name, value, ScopeTypes.CMMN); } else { this.scopedVariableValueLessThanOrEqual(name, value, ScopeTypes.CMMN); ...
vuln
Safe
Java
custom(tag, name, value) { if (tag === "span" && name === "style") { return /^(font-size:(xx-small|x-small|small|medium|large|x-large|xx-large|[0-9]{1,3}%)|background-color:#?[a-zA-Z0-9]+|color:#?[a-zA-Z0-9]+|font-family:'[a-zA-Z0-9\s-]+')$/.exec( value ); } if (tag === "div...
vuln
Safe
JavaScript
def wrapped(self, *args, **kwargs): remaining_tries = int(C.ANSIBLE_SSH_RETRIES) + 1 cmd_summary = "%s..." % args[0] for attempt in range(remaining_tries): cmd = args[0] if attempt != 0 and self._play_context.password and isinstance(cmd, list): # If this i...
vuln
Safe
Python
int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx) { if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) { int rgba = ff_random_get_seed(); rgba_color[0] = rgba >> 24; rgba_color[1] = rgba >> 16; rgba_color[2] = rgba >> 8; ...
vuln
Safe
C/C++
static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int type, int stackptr, int stacktop, BOOL has_quit) { delayed_mem_copy_status status; PCRE2_SPTR alternative; sljit_sw private_srcw[2]; sljit_sw shared_srcw[3]; sljit_sw kept_shared_srcw[2]; int private_count, shared_count, kept_...
vuln
Safe
C/C++
@Override public InteractionResultHolder<ItemStack> use(Level worldIn, Player playerIn, InteractionHand handIn) { BlockHitResult lookingAt = (BlockHitResult) playerIn.pick(Config.wirelessRange, 0f, true); BlockState state = worldIn.getBlockState(lookingAt.getBlockPos()); if(state.is(StorageTags.REMOTE_ACTIVATE))...
vuln
Vulnerable
Java
void yajl_tree_free (yajl_val v) /*+ Pointer to a JSON value returned by * "yajl_tree_parse". Passing NULL is * valid and results in a no-op. +*/ { if (v == NULL) return; if (YAJL_IS_STRING(v)) { free(v->u.str...
vuln
Vulnerable
C/C++
protected void genericBlockEvent( BlockBreakEvent e, boolean monitor ) { // Fast fail: If the prison's mine manager is not loaded, then no point in processing anything. if ( getPrisonMineManager() != null && (!monitor && !e.isCancelled() || monitor) ) { // long startNano = System.nanoT...
vuln
Vulnerable
Java
static void cpia2_usb_disconnect(struct usb_interface *intf) { struct camera_data *cam = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); DBG("Stopping stream\n"); cpia2_usb_stream_stop(cam); mutex_lock(&cam->v4l2_lock); DBG("Unregistering camera\n"); cpia2_unregister_camera(cam); v4l2_device_disconnect(...
vuln
Vulnerable
C/C++
/* * "NUT" Container Format demuxer * Copyright (c) 2004-2006 Michael Niedermayer * Copyright (c) 2003 Alex Beregszaszi * * 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 So...
vuln
Vulnerable
C/C++
static int flashsv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { int buf_size = avpkt->size; FlashSVContext *s = avctx->priv_data; int h_blocks, v_blocks, h_part, v_part, i, j; GetBitContext gb; if (buf_size == 0) ...
vuln
Vulnerable
C/C++
int audio_level_json(struct list *levell, const char *userid_self, const char *clientid_self, char **json_str, char **anon_str) { struct json_object *jobj; struct json_object *jarr; char uid_anon[ANON_ID_LEN]; char cid_anon[ANON_CLIENT_LEN]; struct mbuf *pmb = NULL; int err = 0; struct le *le; if...
vuln
Vulnerable
C/C++
resolve_symlinks(char *path) { #ifdef HAVE_READLINK struct stat buf; char orig_wd[MAXPGPATH], link_buf[MAXPGPATH]; char *fname; /* * To resolve a symlink properly, we have to chdir into its directory and * then chdir to where the symlink points; otherwise we may fail to * resolve relative links corre...
vuln
Vulnerable
Unknown
private ReportShuffleResultResponse doReportShuffleResult(ReportShuffleResultRequest rpcRequest) { int retryNum = 0; while (retryNum < maxRetryAttempts) { try { ReportShuffleResultResponse response = blockingStub.withDeadlineAfter( rpcTimeout, TimeUnit.MILLISECONDS).reportShuffleResult...
vuln
Vulnerable
Java
/* * WindowsServiceControl.h - class for managing a Windows service * * Copyright (c) 2017-2020 Tobias Junghans <tobydox@veyon.io> * * This file is part of Veyon - https://veyon.io * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License ...
vuln
Safe
C/C++
static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { if (*rsize >= 107 && rdesc[104] == 0x26 && rdesc[105] == 0x80 && rdesc[106] == 0x03) { hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n"); rdesc[105] = rdesc[110] = 0x03; rdesc[106] = rdesc[111] =...
vuln
Vulnerable
C/C++
xps_select_best_font_encoding(xps_font_t *font) { static struct { int pid, eid; } xps_cmap_list[] = { { 3, 10 }, /* Unicode with surrogates */ { 3, 1 }, /* Unicode without surrogates */ { 3, 5 }, /* Wansung */ { 3, 4 }, /* Big5 */ { 3, 3 }, /*...
vuln
Safe
C/C++
function renderPipelineInstance(node_id, instance, node) { var gui = ''; var stagesCount = 0; gui += '<li class="instance">'; if (instance.label != '') { if (isCurrent) { gui += '<h4 title="' + instance.label + '"><span class="pipeline_run_label">Instance: ' +...
vuln
Vulnerable
JavaScript
@Override public String getUserName() { final int callingUid = Binder.getCallingUid(); if (!hasManageOrCreateUsersPermission() || hasPermissionGranted( android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED, callingUid)) { throw new SecurityException(...
vuln
Vulnerable
Java
/* * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * 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 ap...
vuln
Safe
Java
@Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { String host = request.getUrl().getHost(); if (Stream.of(WOLVIC_HOSTS).anyMatch(host::equalsIgnoreCase)) { return false; } else { ...
vuln
Vulnerable
Java
network_init () { #ifdef HAVE_GNUTLS char *ca_path, *ca_path2; gnutls_global_init (); gnutls_certificate_allocate_credentials (&gnutls_xcred); ca_path = string_expand_home (CONFIG_STRING(config_network_gnutls_ca_file)); if (ca_path) { ca_path2 = string_replace (ca_path, "%h", weech...
vuln
Safe
C/C++
static void vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride, int mode, int rnd) { int i, j; uint8_t tmp[8*11], *tptr; int m, r; m = (mode & 3); r = rnd; src -= stride; tptr = tmp; for(j = 0; j < 11; j++) { for(i = 0; i < 8; i++) tptr[i] = vc1_mspel_filter(sr...
vuln
Vulnerable
C/C++
private void fetchTranslation(CharSequence text, long minDuration, OnTranslationSuccess onSuccess, OnTranslationFail onFail) { if (!translateQueue.isAlive()) { translateQueue.start(); } translateQueue.postRunnable(() -> { TranslatorHelper.translate(new TranslatorHelper.Tr...
vuln
Safe
Java
/* omzmq3.c * Copyright 2012 Talksum, Inc * Using the czmq interface to zeromq, we output * to a zmq socket. * Copyright (C) 2014 Rainer Gerhards * * This program 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 Soft...
vuln
Vulnerable
C/C++
void print_summary(const MOBIData *m) { char *title = mobi_meta_get_title(m); if (title) { printf("Title: %s\n", title); free(title); } char *author = mobi_meta_get_author(m); if (author) { printf("Author: %s\n", author); free(author); } char *contributor = mo...
vuln
Vulnerable
C/C++
open_log_file(const char *name, const char *prog, const char *namespace, const char *instance) { char *file_name; if (log_file) { fclose(log_file); log_file = NULL; } if (!name) return; file_name = make_file_name(name, prog, namespace, instance); log_file = fopen_safe(file_name, "a"); if (log_file) { ...
vuln
Safe
C/C++
static void spatial_compose97i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride){ int y = cs->y; DWTELEM *b0= cs->b0; DWTELEM *b1= cs->b1; DWTELEM *b2= cs->b2; DWTELEM *b3= cs->b3; DWTELEM *b4= buffer + mirror(y+3, height-1)*stride; DWTELEM *b5= buffer + mirror(y+4, h...
vuln
Safe
C/C++
import codecs import json import os import stat import sys import tempfile import uuid import traceback try: from collections.abc import Mapping except ImportError: from collections import Mapping import ansible_runner from ansible_runner.exceptions import ConfigurationError from ansible_runner.loader import A...
vuln
Vulnerable
Python
static int get_physical_address_data(CPUState *env, target_phys_addr_t *physical, int *prot, target_ulong address, int rw, int is_user) { unsigned int i; uint64_t context; if ((env->lsu & DMMU_E) == 0) { *physical = ultraspar...
vuln
Safe
C/C++
public static Typeface loadTypeface(Context context, int font) { if (fontArray.get(font) == null) { try { File file = new File(Environment.getDataDirectory(), "data/" + context.getPackageName() + "/fonts"); if (!file.exists()) { file.mkdirs(); } file = new File(file, Integer.toHexString(...
vuln
Vulnerable
Java
def visit_Call(self, node): """ A couple function calls are supported: bson's ObjectId() and datetime(). """ if isinstance(node.func, ast.Name): expr = None if node.func.id == 'ObjectId': expr = "('" + node.args[0].s + "')" elif node.fu...
vuln
Vulnerable
Python
def tid_num_to_tag_nums(self, tid_num): ''' Returns list of the associated tag_nums to the given tid_num. ''' q = "SELECT tag FROM tid_tag WHERE tid = ?" self.query(q, tid_num) return [i[0] for i in self.c.fetchall()]
vuln
Safe
Python
package command import ( "time" "github.com/zitadel/zitadel/internal/eventstore" "github.com/zitadel/zitadel/internal/domain" "github.com/zitadel/zitadel/internal/repository/user" ) type HumanRefreshTokenWriteModel struct { eventstore.WriteModel TokenID string RefreshToken string UserState domai...
vuln
Vulnerable
Go
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst) { AVBSFList *lst; char *bsf_str, *buf, *dup, *saveptr; int ret; if (!str) return av_bsf_get_null_filter(bsf_lst); lst = av_bsf_list_alloc(); if (!lst) return AVERROR(ENOMEM); if (!(dup = buf = av_strdup(str)))...
vuln
Vulnerable
C/C++
@Override public Element[] supStreamFeatures(XMPPResourceConnection session) { if (log.isLoggable(Level.FINEST) && (session != null)) { log.finest("VHostItem: " + session.getDomain()); } if ((session != null) && session.getDomain().isRegisterEnabled()) { return FEATURES; } else { return null; } }
vuln
Vulnerable
Java
TranslateInfoBarDelegate* TranslateManager::GetTranslateInfoBarDelegate( TabContents* tab) { for (int i = 0; i < tab->infobar_delegate_count(); ++i) { TranslateInfoBarDelegate* delegate = tab->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); if (delegate) return delegate; } ret...
vuln
Safe
C/C++
static uint64_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries) { assert(entries < (UINT64_C(1) << (64 - 9))); return DIV_ROUND_UP(entries << s->refcount_order, 8); }
vuln
Safe
C/C++