code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce) { int i, j, lag; float corr, s0, s1, max_corr = 0.0f; float *samples = &s->planar_samples[s->cur_channel][1024]; float *pred_signal = &sce->ltp_state[0]; int samples_num = 2048; if (s->profile != FF_PROFILE_AAC_LTP) retu...
vuln
Vulnerable
C/C++
@Override public void stop() { if (mContext != null && mAlarmMgr != null) { Intent intent = new Intent(mContext, PowerSavingReceiver.class); PendingIntent alarmIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0); mAlarmMgr.cancel(alarmIntent); mAlarmMgr = null; } super.stop(); }
vuln
Vulnerable
Java
static int run_post_create(const char *dirname) { /* If doesn't start with "g_settings_dump_location/"... */ if (!dir_is_in_dump_location(dirname)) { /* Then refuse to operate on it (someone is attacking us??) */ error_msg("Bad problem directory name '%s', should start with: '%s'", dirname,...
vuln
Vulnerable
C/C++
@mod.route('/delete/<int:cmt_id>', methods=['GET', 'POST']) def delete(cmt_id): if request.method == 'GET': cursor.execute("SELECT msg_id FROM comment where cmt_id = %s;", (cmt_id,)) m = cursor.fetchone() cursor.execute("DELETE FROM comment where cmt_id = %s;", (cmt_id,)) conn.commit...
vuln
Safe
Python
cleanup (struct query *z) { int j = 0, k = 0; qmerge_free (&z->qm); for (j = 0; j < QUERY_MAXALIAS; ++j) dns_domain_free (&z->alias[j]); for (j = 0; j < QUERY_MAXLEVEL; ++j) { dns_domain_free (&z->name[j]); for (k = 0; k < QUERY_MAXNS; ++k) dns_domain_free (&z->...
vuln
Safe
Unknown
private void updateTypingIndicators() { String typing = ""; buffer.purgeExpiredTypingIndicators(); int count = buffer.getTypingIndicators().size(); if (count > 5) { typing = String.valueOf(count) + " people are typing"; } else if(count == 1) { typing = bu...
vuln
Vulnerable
Java
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { PadContext *s = inlink->dst->priv; AVFrame *out; int needs_copy = frame_needs_copy(s, in); if (needs_copy) { av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n"); out = ff_get_video_buffer(inli...
vuln
Safe
C/C++
/** * FreeRDP: A Remote Desktop Protocol Implementation * RDP Core * * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2014 DI (FH) Martin Haimberger <martin.haimberger@thincast.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except ...
vuln
Safe
C/C++
ecb_ews_connect_sync (ECalMetaBackend *meta_backend, const ENamedParameters *credentials, ESourceAuthenticationResult *out_auth_result, gchar **out_certificate_pem, GTlsCertificateFlags *out_certificate_errors, GCancellable *cancellable, GError **error) { ECalBackendEws ...
vuln
Vulnerable
Unknown
private static ProgressDialog showShutdownDialog(Context context) { // Throw up a system dialog to indicate the device is rebooting / shutting down. ProgressDialog pd = new ProgressDialog(context); // Path 1: Reboot to recovery for update // Condition: mReason startswith REBOOT_RECOVE...
vuln
Vulnerable
Java
static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev, struct nci_rf_intf_activated_ntf *ntf, __u8 *data) { struct activation_params_nfca_poll_iso_dep *nfca_poll; struct activation_params_nfcb_poll_iso_dep *nfcb_poll; switch (ntf->activation_rf_tech_and_mode) { case NCI_NFC_A_PASSIVE_POLL_MODE: ...
vuln
Vulnerable
C/C++
int vrend_create_shader(struct vrend_context *ctx, uint32_t handle, const struct pipe_stream_output_info *so_info, const char *shd_text, uint32_t offlen, uint32_t num_tokens, uint32_t type, uint32_t pkt_length) { struct v...
vuln
Safe
Unknown
import { configFromStringAndFormat } from './from-string-and-format'; import { createUTCDate } from './date-from-array'; import { hooks } from '../utils/hooks'; import { deprecate } from '../utils/deprecate'; import getParsingFlags from './parsing-flags'; import { defaultLocaleMonthsShort } from '../units/month'; impor...
vuln
Safe
JavaScript
/* input-bmp.c: reads any bitmap I could get for testing Copyright (C) 1999, 2000, 2001 Martin Weber. This library 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 ...
vuln
Safe
C/C++
g_init(const char* app_name) { #if defined(_WIN32) WSADATA wsadata; WSAStartup(2, &wsadata); #endif setlocale(LC_CTYPE, ""); if (app_name != 0) { if (app_name[0] != 0) { if (!g_directory_exist("/tmp/.xrdp")) { g_create_dir("/tmp/.xrdp"); g_chmod_hex("/tmp/.xrdp", 0x1777); ...
vuln
Vulnerable
Unknown
function ViewController($scope, SharedService) { DEBUG.log('ViewController init'); window.viewScope = $scope; // for debugging $scope.view = { bucket: null, prefix: null, settings: null, objectCount: 0, keys_selected: [], }; $scope.stop = false; // Delegated event handler for S3 object/...
vuln
Vulnerable
JavaScript
# -*- 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
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time import hashlib from datetime import datetime from .base import WeixinError try: from flask import request, Response except ImportError: request, Response = None, None try: from django.http import HttpResponse, HttpResponseFor...
vuln
Vulnerable
Python
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif /* TODO: handle delete */ #define ChkRegexp(_this, funcPtr, dest) \ if (_this->vt == JSI_VT_OBJECT && _this->d.obj->ot == JSI_OT_FUNCTION && \ _this->d.obj->__proto__ == interp->RegExp_prototype->d.obj->__proto__ ) { \ skip =...
vuln
Vulnerable
C/C++
TfLiteStatus Eval(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 TfLiteTensor...
vuln
Safe
C/C++
def check_version(self, version): """ Determine the client's version and decide whether to continue the handshake. """ if version == self.VERSION: log.msg("Client version %s is valid" % version.strip()) # Hardcoded: 1 security type: VNC Auth. ...
vuln
Safe
Python
cff_charset_load( CFF_Charset charset, FT_UInt num_glyphs, FT_Stream stream, FT_ULong base_offset, FT_ULong offset, FT_Bool invert ) { FT_Memory memory = stream->memory; FT_Error error ...
vuln
Vulnerable
Unknown
int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame, AVFilterBufferRef **picref_ptr, AVRational *tb) { int ret; AVFilterBufferRef *picref; *picref_ptr = NULL; if ((ret = avfilter_request_frame(ctx->inputs[0])) < 0) return ret; if (!(picref = ctx->in...
vuln
Safe
C/C++
public static void main(String[] args) { try { LOGGER.info("Backend server starting."); final java.util.logging.Logger logger = java.util.logging.Logger.getLogger("io.grpc.netty.NettyServerTransport.connections"); logger.setLevel(Level.WARNING); // --------------- Start reading pro...
vuln
Vulnerable
Java
@Override public void g() { WStackedSpawner stackedSpawner = this.stackedSpawner.get(); if (stackedSpawner == null) { super.g(); return; } if (!hasNearbyPlayers()) { if (stackedSpawner.isDebug()) Debug.debug("StackedMobSpawner", "...
vuln
Vulnerable
Java
GC_generic_malloc_ignore_off_page(size_t lb, int k) { void *result; size_t lg; size_t lb_rounded; word n_blocks; GC_bool init; DCL_LOCK_STATE; if (SMALL_OBJ(lb)) return GC_generic_malloc(lb, k); GC_ASSERT(k < MAXOBJKINDS); lg = ROUNDED_UP_GRANULES(lb); lb_rounded = GRANU...
vuln
Vulnerable
Unknown
func (v *VM) DumpByteCode() string { b := new(bytes.Buffer) fmt.Fprintf(b, "Prog: %s\n", v.name) fmt.Fprintln(b, "Metrics") for i, m := range v.m { if m.Program == v.name { fmt.Fprintf(b, " %8d %s\n", i, m) } } fmt.Fprintln(b, "Regexps") for i, re := range v.re { fmt.Fprintf(b, " %8d /%s/\n", i, re) } ...
vuln
Safe
Go
cvt_whole_image( TIFF *in, TIFF *out ) { uint32* raster; /* retrieve RGBA image */ uint32 width, height; /* image width & height */ uint32 row; size_t pixel_count; TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); pixel_count = width...
vuln
Safe
Unknown
Response StorageHandler::UntrackCacheStorageForOrigin( const std::string& origin) { if (!storage_partition_) return Response::InternalError(); GURL origin_url(origin); if (!origin_url.is_valid()) return Response::InvalidParams(origin + " is not a valid URL"); BrowserThread::PostTask( Bro...
vuln
Safe
C/C++
@Override protected void handleProducer(final CommandProducer cmdProducer) { checkArgument(state == State.Connected); final long producerId = cmdProducer.getProducerId(); final long requestId = cmdProducer.getRequestId(); // Use producer name provided by client if present fin...
vuln
Safe
Java
void BrowserContextDestroyer::FinishDestroyContext() { DCHECK(finish_destroy_scheduled_); CHECK_EQ(GetHostsForContext(context_.get()).size(), 0U) << "One or more RenderProcessHosts exist whilst its BrowserContext is " << "being deleted!"; g_contexts_pending_deletion.Get().remove(this); if (contex...
vuln
Safe
C/C++
static QemuOpts *opts_parse(QemuOptsList *list, const char *params, int permit_abbrev, bool defaults) { const char *firstname; char value[1024], *id = NULL; const char *p; QemuOpts *opts; Error *local_err = NULL; assert(!permit_abbrev || list->implied_opt_name); f...
vuln
Vulnerable
C/C++
QPDF::reconstruct_xref(QPDFExc& e) { if (this->m->reconstructed_xref) { // Avoid xref reconstruction infinite loops. This is getting // very hard to reproduce because qpdf is throwing many fewer // exceptions while parsing. Most situations are warnings now. throw e; } th...
vuln
Safe
Unknown
def create_basename_core(basename): try: basename = basename.casefold() except Exception: basename = basename.lower() basename = re.sub(r'[ \./]', r'-', basename) basename = re.sub(r'<[^>]*>', r'', basename) basename = re.sub(r'[^a-z0-9\-]', r'', basename) basename = re.sub(r'\-...
vuln
Safe
Python
@Override public synchronized void init() { if (zkClient != null) { return; } String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of zookeeper r...
vuln
Safe
Java
lb_register_characteristic_read_event(lb_context lb_ctx, lb_bl_device* dev, const char* uuid, sd_bus_message_handler_t callback, void* userdata) { #ifdef DEBUG prin...
vuln
Safe
C/C++
EAS_RESULT DLSParser (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE fileHandle, EAS_I32 offset, EAS_DLSLIB_HANDLE *ppDLS) { EAS_RESULT result; SDLS_SYNTHESIZER_DATA dls; EAS_U32 temp; EAS_I32 pos; EAS_I32 chunkPos; EAS_I32 size; EAS_I32 instSize; EAS_I32 rgnPoolSize; EAS_I32 artPool...
vuln
Vulnerable
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
vuln
Vulnerable
C/C++
void HeaderMapImpl::addCopy(const LowerCaseString& key, uint64_t value) { auto* entry = getExistingInline(key.get()); if (entry != nullptr) { char buf[32]; StringUtil::itoa(buf, sizeof(buf), value); appendToHeader(entry->value(), buf); return; } HeaderString new_key; new_key.setCopy(key.get()....
vuln
Vulnerable
C/C++
uint64_t HELPER(neon_abdl_s64)(uint32_t a, uint32_t b) { uint64_t result; DO_ABD(result, a, b, int32_t, int64_t); return result; }
vuln
Safe
C/C++
void mmsServer_handleFileRenameRequest( MmsServerConnection connection, uint8_t* buffer, int bufPos, int maxBufPos, uint32_t invokeId, ByteBuffer* response) { char currentFileName[256] = ""; char newFileName[256] = ""; while (bufPos < maxBufPos) { uint8_t tag = buffe...
vuln
Safe
C/C++
static void update_open_stateflags(struct nfs4_state *state, mode_t open_flags) static void update_open_stateflags(struct nfs4_state *state, fmode_t fmode) { switch (fmode) { case FMODE_WRITE: state->n_wronly++; break; case FMODE_READ: state->n_rdonly++; break; case FMODE_READ|FMODE_WRITE: s...
vuln
Safe
C/C++
static int tta_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TTAContext *s = avctx->priv_data; int i, ret; int cur_chan = 0, framelen = s->frame_length; int32_t *p; ...
vuln
Vulnerable
C/C++
static int packet_alloc(AVBufferRef **buf, int size) { int ret; if ((unsigned)size >= (unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE) return AVERROR(EINVAL); ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE); if (ret < 0) return ret; memset((*buf)->data + size, 0, AV_I...
vuln
Vulnerable
C/C++
def self.get_for_group(group_id) SqlHelper.validate_token([group_id]) if group_id.nil? con = 'group_id is null' else con = "group_id=#{group_id}" end Location.do_expire(con) return Location.where(con).to_a end
vuln
Safe
Ruby
package com.salesmanager.shop.admin.model.web; import java.util.List; import com.salesmanager.core.model.system.MerchantConfiguration; public class ConfigListWrapper { private List<MerchantConfiguration> merchantConfigs; public List<MerchantConfiguration> getMerchantConfigs() { return merchantConfigs; } p...
vuln
Vulnerable
Java
@NonNull public List<BeaconParser> getBeaconParsers() { return beaconParsers; }
vuln
Safe
Java
@Inject(method = "setBlockEntity", at = @At(value = "INVOKE_ASSIGN", target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;")) private void tileAdded(BlockEntity be, CallbackInfo ci) { if (level.isClientSide) InstancedRenderDispatcher.getTiles(this.level) .add(be); }
vuln
Vulnerable
Java
private Response startService(String appName, final UserGroupInformation ugi) throws IOException, InterruptedException { ApplicationId appId = ugi.doAs(new PrivilegedExceptionAction<ApplicationId>() { @Override public ApplicationId run() throws YarnException, IOException ...
vuln
Vulnerable
Java
/* * Performance events core code: * * Copyright (C) 2008 Thomas Gleixner <tglx@linutronix.de> * Copyright (C) 2008-2011 Red Hat, Inc., Ingo Molnar * Copyright (C) 2008-2011 Red Hat, Inc., Peter Zijlstra * Copyright © 2009 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com> * * For licensing details see kernel...
vuln
Safe
C/C++
static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VmdAudioContext *s = avctx->priv_data; int block_type, silent_chunks; ...
vuln
Safe
C/C++
static void decode_b(AVCodecContext *ctx, int row, int col, struct VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff, enum BlockLevel bl, enum BlockPartition bp) { VP9Context *s = ctx->priv_data; VP9Block *b = s->b; enum BlockSize bs = bl * 3 + bp; int bytesperp...
vuln
Safe
C/C++
private ClonedChunkSection createSection(int x, int y, int z) { ClonedChunkSection section; if (!this.inactivePool.isEmpty()) { section = this.inactivePool.remove(); this.byPosition.remove(section.getPosition().asLong()); } else { section = this.allocate(); ...
vuln
Vulnerable
Java
static void ipa_device_close(wmfAPI * API) { wmf_magick_t *ddata = WMF_MAGICK_GetData(API); if (ddata->draw_wand != (DrawingWand *) NULL) { DestroyDrawingWand(ddata->draw_wand); ddata->draw_wand=(DrawingWand *) NULL; } if (ddata->draw_info != (DrawInfo *) NULL) { DestroyDrawInfo...
vuln
Vulnerable
C/C++
function(c,l,x){return tb(c,["width"],l,function(p,v,A,B,ha){ha=c.shape.getEdgeWidth()*c.view.scale+x;return new mxPoint(B.x+v*p/4+A*ha/2,B.y+A*p/4-v*ha/2)},function(p,v,A,B,ha,K){p=Math.sqrt(mxUtils.ptSegDistSq(B.x,B.y,ha.x,ha.y,K.x,K.y));c.style.width=Math.round(2*p)/c.view.scale-x})},tb=function(c,l,x,p,v){return fb...
vuln
Vulnerable
JavaScript
void smp_proc_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { uint8_t* p = p_data->p_data; SMP_TRACE_DEBUG("%s", __func__); if (smp_command_has_invalid_parameters(p_cb)) { tSMP_INT_DATA smp_int_data; smp_int_data.status = SMP_INVALID_PARAMETERS; android_errorWriteLog(0x534e4554, "111937065"); ...
vuln
Safe
C/C++
int kvm_arch_on_sigbus(int code, void *addr) { #ifdef KVM_CAP_MCE if ((first_cpu->mcg_cap & MCG_SER_P) && addr && code == BUS_MCEERR_AO) { ram_addr_t ram_addr; target_phys_addr_t paddr; if (qemu_ram_addr_from_host(addr, &ram_addr) || !kvm_physical_memory_addr_from_ram(fi...
vuln
Vulnerable
C/C++
/* $Id: upnpredirect.c,v 1.95 2018/07/06 12:05:48 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * MiniUPnP project * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * (c) 2006-2018 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within th...
vuln
Safe
C/C++
static void setAppDefaults() { app->company = ssplit(slower(ME_COMPANY), " ", NULL); app->serviceProgram = sclone(SERVICE_PROGRAM); app->serviceName = sclone(SERVICE_NAME); app->serviceHome = mprGetNativePath(SERVICE_HOME); app->retries = RESTART_MAX; app->signal = SIGTERM; app->logSpec = sc...
vuln
Safe
C/C++
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; import { mainPage } from "../../support/page_objects/mainPage"; import { isPostgres, isXcdb, roles, staticProjects, } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } from "../../support/page...
vuln
Safe
JavaScript
MYSQL * STDCALL CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag) { char buff[NAME_LEN+USERNAME_LENGTH+100]; int scramble_data_len, pkt_scramble_len= 0; char *end,...
vuln
Safe
Unknown
static void sycc420_to_rgb(opj_image_t *img) { int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb; const int *y, *cb, *cr, *ny; unsigned int maxw, maxh, max; int offset, upb; unsigned int i, j; upb = (int)img->comps[0].prec; offset = 1<<(upb - 1); upb = (1<<upb)-1; maxw = (unsigned int)img->comps[0].w; maxh = (unsi...
vuln
Vulnerable
C/C++
function Response(options) { options = options || {}; this.body = options.body || {}; this.headers = {}; this.status = 200; // Store the headers in lower case. for (var field in options.headers) { if (options.headers.hasOwnProperty(field)) { this.headers[field.toLowerCase()] = options.headers[fi...
vuln
Vulnerable
JavaScript
gs_grab_mouse_reset (GSGrab *grab) { if (grab->priv->mouse_grab_window != NULL) { g_object_remove_weak_pointer (G_OBJECT (grab->priv->mouse_grab_window), (gpointer *) &grab->priv->mouse_grab_window); } grab->priv->mouse_grab_window =...
vuln
Safe
Unknown
def parse_profile(name, contents): if name.endswith('.yaml'): # this was a full path name = os.path.splitext(os.path.basename(name))[0] data = yaml.load(contents) if data is None: # this happens if a completely empty YAML file is passed in to # parse_profile, for example ...
vuln
Vulnerable
Python
var contra = require("contra"), path = require("path"), fUtils = require("./files"), cp = require("child_process"); var gitApp = "git", gitExtra = { env: process.env }; var escapeQuotes = function (str) { if (typeof str === "string") { return '"' + str.replace(/(["'$`\\])/g, "\\$1") + '"'; } else { ...
vuln
Safe
JavaScript
def rebuild_manifest(self): """Rebuild the manifest object if it is missing Iterates through all objects in the repository looking for archive metadata blocks. """ def valid_archive(obj): if not isinstance(obj, dict): return False return REQUIRED...
vuln
Safe
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
def _resolve_jdbc_connection(self) -> dict[str, Any]: conn_data = {"url": "", "schema": "", "conn_prefix": "", "user": "", "password": ""} try: conn = self.get_connection(self._jdbc_conn_id) if "/" in conn.host: raise ValueError("The jdbc host should not contain a...
vuln
Safe
Python
static void tftp_handle_ack(Slirp *slirp, struct sockaddr_storage *srcsas, struct tftphdr *hdr) { int s; s = tftp_session_find(slirp, srcsas, hdr); if (s < 0) { return; } tftp_send_next_block(&slirp->tftp_sessions[s], hdr); }
vuln
Safe
Unknown
private void updateAtmWithLub(AnnotatedTypeMirror sourceCodeATM, AnnotatedTypeMirror ajavaATM) { if (sourceCodeATM.getKind() != ajavaATM.getKind()) { // Ignore null types: passing them to asSuper causes a crash, as they cannot be // substituted for type variables. If sourceCodeATM is a null type, only ...
vuln
Safe
Java
@Override public void load(CompoundTag compoundTag) { super.load(compoundTag); this.color = compoundTag.contains(COLOR_TAG) ? compoundTag.getInt(COLOR_TAG) : DEFAULT_COLOR; if (compoundTag.contains(STATUS_EFFECT_TAG) && !compoundTag.getString(STATUS_EFFECT_TAG).trim().equals("")) { ...
vuln
Vulnerable
Java
ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len) { if (src == NULL || src_len == 0) { return -1; } size_t ret = 0; const char16_t* const end = src + src_len; while (src < end) { if ((*src & 0xFC00) == 0xD800 && (src + 1) < end && (*(src + 1) & 0xFC00) == 0xDC00)...
vuln
Safe
C/C++
static int add_time_element(struct ldb_message *msg, const char *attr, time_t t) { struct ldb_message_element *el; char *s; int ret; if (ldb_msg_find_element(msg, attr) != NULL) { return LDB_SUCCESS; } s = ldb_timestring(msg, t); if (s == NULL) { return LDB_ERR_OPERATIONS_ERROR; } ret = ldb_msg_add_stri...
vuln
Vulnerable
Unknown
void PartialMagnificationController::CreateMagnifierWindow() { if (event->type() == ui::ET_MOUSE_PRESSED) SetActive(true); if (event->type() == ui::ET_MOUSE_RELEASED) SetActive(false); if (!is_active_) return; // If the previous root window was detached host_widget_ will be null; // reconstru...
vuln
Safe
C/C++
public function getData() { $this->validate('transactionReference', 'amount'); $data = array(); $data['amount'] = $this->getAmountInteger(); if ($this->getRefundApplicationFee()) { $data['refund_application_fee'] = 'true'; } return $data; }
vuln
Vulnerable
JavaScript
private int execute () { final int count = list.size(); if (count == 0) return 0; List<Runnable> pending = new ArrayList<>(list); list.clear(); for (int i = count - 1; i >= 0; i--) { pending.get(i).run(); } return count; }
vuln
Safe
Java
def is_internal_attribute(obj, attr): """Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden. >...
vuln
Vulnerable
Python
plpgsql_validator(PG_FUNCTION_ARGS) { Oid funcoid = PG_GETARG_OID(0); HeapTuple tuple; Form_pg_proc proc; char functyptype; int numargs; Oid *argtypes; char **argnames; char *argmodes; bool is_dml_trigger = false; bool is_event_trigger = false; int i; /* Get the new function's pg_proc ent...
vuln
Vulnerable
Unknown
def saveProviders(self, newznab_string='', torrentrss_string='', provider_order=None, **kwargs): newznabProviderDict = dict( zip((x.get_id() for x in sickbeard.newznabProviderList), sickbeard.newznabProviderList)) finished_names = [] # add all the newznab info we got into our list ...
vuln
Safe
Python
static PHP_FUNCTION(gzopen) { char *filename; char *mode; int filename_len, mode_len; int flags = REPORT_ERRORS; php_stream *stream; long use_include_path = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAIL...
vuln
Safe
C/C++
static ssize_t mon_text_read_u(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { struct mon_reader_text *rp = file->private_data; struct mon_event_text *ep; struct mon_text_ptr ptr; ssize_t ret; mutex_lock(&rp->printf_lock); if (rp->printf_togo == 0) { ep = mon_text_read_wait(rp, file);...
vuln
Safe
Unknown
import discord from typing import Optional from datetime import datetime from redbot.core import commands, checks, Config, modlog class Ticketer(commands.Cog): """Ticketer""" __version__="1.0.0" async def red_delete_data_for_user(self, *, requester, user_id): # This cog stores no EUD retu...
vuln
Vulnerable
C/C++
void impeg2d_peek_next_start_code(dec_state_t *ps_dec) { stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; impeg2d_bit_stream_flush_to_byte_boundary(ps_stream); while ((impeg2d_bit_stream_nxt(ps_stream,START_CODE_PREFIX_LEN) != START_CODE_PREFIX) && (ps_dec->s_bit_stream.u4_offset <= ps_...
vuln
Vulnerable
C/C++
function bp_core_admin_slugs_options() { // Get the existing WP pages. $existing_pages = bp_core_get_directory_page_ids(); // Set up an array of components (along with component names) that have directory pages. $directory_pages = bp_core_admin_get_directory_pages(); if ( !empty( $directory_pages ) ) : ?> <h...
vuln
Safe
PHP
function change_pass() { global $txp_user; extract(psa(array('new_pass', 'mail_password'))); if (empty($new_pass)) { author_list(array(gTxt('password_required'), E_ERROR)); return; } $rs = change_user_password($txp_user, $new_pass); if ($rs) { $message = gTxt('passwo...
vuln
Vulnerable
PHP
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 * th...
vuln
Safe
Java
/*- * Copyright (c) 2011 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of ...
vuln
Vulnerable
C/C++
private @Nullable Term compareMetaLiteral(@NotNull MetaLitTerm litLhs, @NotNull Term preRhs, @NotNull Term type, Sub lr, Sub rl) { if (!compare(litLhs.type(), type, null)) return null; var inline = litLhs.inline(); // try getting the solved literal if (inline == litLhs) return null; // unsolvable? retur...
vuln
Vulnerable
Java
index_constraint_create(Relation heapRelation, Oid indexRelationId, IndexInfo *indexInfo, const char *constraintName, char constraintType, bool deferrable, bool initdeferred, bool mark_as_primary, bool update_pgindex, bool remove_old_dependencies, bool allow_s...
vuln
Vulnerable
Unknown
size_t c_shquote_strncspn(const char *string, size_t n_string, const char *reject) { bool buffer[UCHAR_MAX + 1] = {}; if (strlen(reject) == 1) { const char *p; p = memchr(string, reject[0], n_string); i...
vuln
Safe
Unknown
int bdrv_check(BlockDriverState *bs) { if (bs->drv->bdrv_check == NULL) { return -ENOTSUP; } return bs->drv->bdrv_check(bs); }
vuln
Vulnerable
C/C++
private void pushOntoStack(Token t) { if (t!=null && !stack.isEmpty() && t.equals(stack.peek())) { throw new InternalError("ERROR: Token being duplicated: " + t); } else if (t==null) { throw new InternalError("ERROR: null token pushed onto stack"); } // This method should always be called with the most recent...
vuln
Safe
Java
finish_newstyle_options (struct connection *conn) { int64_t r; r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { nbdkit_error (".get_size function returned invalid value " "(%" PRIi64 ")", r); return -1; } conn->exportsize = (uint64_t) r; if (proto...
vuln
Vulnerable
Unknown
@Override public void callSessionResumed(ImsCallProfile profile) { if (mListener != null) { TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionResumed( ImsCallSession.this, profile), mListenerExecutor); } }
vuln
Vulnerable
Java
public void createDeleteHistoryAlert(BaseFragment fragment, TLRPC.Chat chat, long mergeDialogId, Theme.ResourcesProvider resourcesProvider) { if (fragment == null || fragment.getParentActivity() == null || chat == null) { return; } Context context = fragment.getParentActivity(); ...
vuln
Safe
Java
SCK_RemoveSocket(int sock_fd) { union sockaddr_all saddr; socklen_t saddr_len; saddr_len = sizeof (saddr); if (getsockname(sock_fd, &saddr.sa, &saddr_len) < 0) { DEBUG_LOG("getsockname() failed : %s", strerror(errno)); return 0; } if (saddr_len > sizeof (saddr) || saddr_len <= sizeof (saddr.sa.sa...
vuln
Safe
Unknown
void calculateStepDetails(float speedStep, float distance) { float stepIncrement = _throttle.getSpeedIncrement(); log.debug("Desired Speed Step {} asked for {}", desiredSpeedStep, speedStep); desiredSpeedStep = speedStep; //int step = Math.round(_throttle.getSpeedSetting()*1000); ...
vuln
Vulnerable
Java
static int mszh_decomp(unsigned char * srcptr, int srclen, unsigned char * destptr) { unsigned char *destptr_bak = destptr; unsigned char mask = 0; unsigned char maskbit = 0; unsigned int ofs, cnt; while (srclen > 0) { if (maskbit == 0) { mask = *(srcptr++); maskbi...
vuln
Vulnerable
C/C++
HeapObjectHeader* NormalPage::findHeaderFromAddress(Address address) { if (address < payload()) return nullptr; if (!m_objectStartBitMapComputed) populateObjectStartBitMap(); size_t objectOffset = address - payload(); size_t objectStartNumber = objectOffset / allocationGranularity; size_t mapIndex = o...
vuln
Safe
C/C++