code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@Override public Void visitForLoop(ForLoopTree javacTree, Node javaParserNode) { ForStmt node = castNode(ForStmt.class, javaParserNode, javacTree); processForLoop(javacTree, node); Iterator<? extends StatementTree> javacInitializers = javacTree.getInitializer().iterator(); for (Expression initializer ...
vuln
Vulnerable
Java
static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, int id, int bpp) { int h; uint8_t *dst; int ret; if (src_size < avctx->width * avctx->height * (int64_t)bpp) { av_log(avctx, AV_L...
vuln
Safe
C/C++
/* * Copyright 2013-2022 Erudika. https://erudika.com * * 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 appli...
vuln
Vulnerable
Java
static av_cold int atrac3_decode_init(AVCodecContext *avctx) { int i, ret; int version, delay, samples_per_frame, frame_factor; const uint8_t *edata_ptr = avctx->extradata; ATRAC3Context *q = avctx->priv_data; if (avctx->channels <= 0 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Ch...
vuln
Safe
C/C++
static int econet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sock *sk; struct econet_sock *eo; struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr; if (peer) return -EOPNOTSUPP; memset(sec, 0, sizeof(*sec)); mutex_lock(&econet_mutex); sk = sock->sk; eo = ...
vuln
Safe
Unknown
@Override public boolean packageHasActiveAdmins(String packageName, int userHandle) { if (!mHasFeature) { return false; } Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkC...
vuln
Vulnerable
Java
int nfc_disable_se(struct nfc_dev *dev, u32 se_idx) { struct nfc_se *se; int rc; pr_debug("%s se index %d\n", dev_name(&dev->dev), se_idx); device_lock(&dev->dev); if (dev->shutting_down) { rc = -ENODEV; goto error; } if (!dev->dev_up) { rc = -ENODEV; goto error; } if (!dev->ops->enable_se || !dev...
vuln
Safe
Unknown
@Method(0x8002ced8L) public static void start(final int argc, final long argv) { bzero(_8005a1d8.getAddress(), 0x6c4b0); main(); assert !Hardware.isAlive() : "Shouldn't get here"; }
vuln
Safe
Java
TfLiteStatus ResizeOutput(TfLiteContext* context, const TfLiteTensor* input, const TfLiteTensor* axis, TfLiteTensor* output) { int axis_value; // Retrive all 8 bytes when axis type is kTfLiteInt64 to avoid data loss. if (axis->type == kTfLiteInt64) { axis_value = static_cast<int>(*Ge...
vuln
Vulnerable
C/C++
void cb_metrics_prometheus(mk_request_t *request, void *data) { int i; int j; int m; int len; int time_len; int start_time_len; size_t index; size_t num_metrics = 0; long now; flb_sds_t sds; flb_sds_t sds_metric; flb_sds_t tmp_sds; struct flb_sds *metric_helptxt_head;...
vuln
Vulnerable
C/C++
static int print_exception_notes(struct exception_print_context *ctx, PyObject *value) { PyObject *f = ctx->file; if (!PyExceptionInstance_Check(value)) { return 0; } PyObject *notes; int res = PyObject_GetOptionalAttr(value, &_Py_ID(__notes__), &notes); if (res <= 0) { return ...
vuln
Safe
C/C++
int rsa_pkcs1_sign( rsa_context *ctx, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, int hash_id, unsigned int hashlen, const unsigned char *hash, unsigned c...
vuln
Vulnerable
Unknown
int kvm_arch_release_virq_post(int virq) { MSIRouteEntry *entry, *next; QLIST_FOREACH_SAFE(entry, &msi_route_list, list, next) { if (entry->virq == virq) { trace_kvm_x86_remove_msi_route(virq); QLIST_REMOVE(entry, list); break; } } return 0; }
vuln
Vulnerable
C/C++
GF_EXPORT u32 gf_base64_encode(const u8 *_in, u32 inSize, u8 *_out, u32 outSize) { s32 padding; u32 i = 0, j = 0; unsigned char *in = (unsigned char *)_in; unsigned char *out = (unsigned char *)_out; if (outSize < (inSize * 4 / 3)) return 0; while (i < inSize) { padding = 3 - (inSize - i); if (padding == 2)...
vuln
Vulnerable
C/C++
public function checkout($name) { $this->run('checkout', '--end-of-options', $name); return $this; }
vuln
Safe
PHP
MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image, const CacheView_ *image_view,const PixelInterpolateMethod method, const double x,const double y,PixelInfo *pixel,ExceptionInfo *exception) { MagickBooleanType status; double alpha[16], gamma; PixelInfo pixels[16]; reg...
vuln
Safe
C/C++
MqttClient.prototype._setupStream = function () { var connectPacket var that = this var writable = new Writable() var parser = mqttPacket.parser(this.options) var completeParse = null var packets = [] this._clearReconnect() this.stream = this.streamBuilder(this) parser.on('packet', function (packet...
vuln
Safe
JavaScript
@Override public org.bukkit.inventory.ItemStack getPlayerHead(Player player, org.bukkit.inventory.ItemStack copyTagFrom) { org.bukkit.inventory.ItemStack head = new org.bukkit.inventory.ItemStack(materialPlayerHead()); if (copyTagFrom != null) { ItemStack i = CraftItemStack.asNMSCopy(he...
vuln
Vulnerable
Java
/* * wildmidi_lib.c -- Midi Wavetable Processing library * * Copyright (C) WildMIDI Developers 2001-2016 * * This file is part of WildMIDI. * * WildMIDI is free software: you can redistribute and/or modify the player * under the terms of the GNU General Public License and you can redistribute * and/or modify t...
vuln
Vulnerable
C/C++
static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) { uchar *cursor = s->cur; char *str, *ptr = NULL; std: s->tok = cursor; s->len = 0; #line 965 "ext/date/lib/parse_date.re" #line 846 "<stdout>" { YYCTYPE yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 0, 0, 0, ...
vuln
Safe
C/C++
public void markMessagesReadAfter(long timestamp) { this.cleanUpReadMap(timestamp); for (Map.Entry<String, Long> entry : unreadMessagesSentAt.entrySet()) { if (entry.getValue() < timestamp) { messagesReadAt.put(entry.getKey(), entry.getValue()); unreadMessage...
vuln
Vulnerable
Java
err_t verify_signed_hash(const struct RSA_public_key *k , u_char *s, unsigned int s_max_octets , u_char **psig , size_t hash_len , const u_char *sig_val, size_t sig_len) { unsigned int padlen; /* actual exponent...
vuln
Vulnerable
C/C++
/* * mms_common_msg.c * * Copyright 2013-2022 Michael Zillgith * * This file is part of libIEC61850. * * libIEC61850 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 3 of the Licen...
vuln
Safe
Go
static inline int get16(const uint8_t **pp, const uint8_t *p_end) { const uint8_t *p; int c; p = *pp; if ((p + 1) >= p_end) return AVERROR_INVALIDDATA; c = AV_RB16(p); p += 2; *pp = p; return c; }
vuln
Vulnerable
C/C++
static void mark_context_stack(mrb_state *mrb, struct mrb_context *c) { size_t i; size_t e; if (c->stack == NULL) return; e = c->stack - c->stbase; if (c->ci) e += c->ci->nregs; if (c->stbase + e > c->stend) e = c->stend - c->stbase; for (i=0; i<e; i++) { mrb_value v = c->stbase[i]; if (!mrb_imm...
vuln
Vulnerable
C/C++
(function() { // Adds ArchiMate 2.1 shapes Sidebar.prototype.addArchiMatePalette = function() { var w = 100; var h = 75; var s = 'html=1;outlineConnect=0;shape=mxgraph.archimate.'; var am1 = 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#ffff99;shape=mxgraph.archimate.'; var am2 = 'html=1;outlineConne...
vuln
Safe
Java
func inHeadIM(p *parser) bool { switch p.tok.Type { case TextToken: s := strings.TrimLeft(p.tok.Data, whitespace) if len(s) < len(p.tok.Data) { // Add the initial whitespace to the current node. p.addText(p.tok.Data[:len(p.tok.Data)-len(s)]) if s == "" { return true } p.tok.Data = s } case S...
vuln
Safe
Go
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { CHECK_LE(ipc_nesting_level_, 1); blink::WebLocalFrame* frame = NULL; GetPrintFrame(&frame); DCHECK(frame); auto plugin = delegate_->GetPdfElement(frame); if (!plugin.isNull()) { PrintNode(plugin); return; } print_preview_c...
vuln
Safe
C/C++
def get(self): """Returns a list of roles --- description: >- Returns a list of roles. Depending on your permission, you get all the roles at the server or only the roles that belong to your organization.\n ### Permission Table\n |Rul...
vuln
Safe
Python
static void __io_free_req(struct io_kiocb *req) { struct io_uring_task *tctx = req->task->io_uring; struct io_ring_ctx *ctx = req->ctx; io_dismantle_req(req); atomic_long_inc(&tctx->req_complete); if (tctx->in_idle) wake_up(&tctx->wait); put_task_struct(req->task); if (likely(!io_is_fallback_req(req))) km...
vuln
Safe
C/C++
this.complete = function (result) { if (resultsBuffer.length) { socket.emit('result', resultsBuffer) resultsBuffer = [] } socket.emit('complete', result || {}) if (this.config.clearContext) { navigateContextTo('about:blank') } else { self.updater.updateTestStatus('complete')...
vuln
Safe
JavaScript
@Override public void unregisterConnectivityDiagnosticsCallback( @NonNull IConnectivityDiagnosticsCallback callback) { mConnectivityDiagnosticsHandler.sendMessage( mConnectivityDiagnosticsHandler.obtainMessage( ConnectivityDiagnosticsHandler ...
vuln
Vulnerable
Java
static VirtIOSCSIVring *virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, EventNotifierHandler *handler, int n) { BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s))); ...
vuln
Vulnerable
C/C++
void PrintWebViewHelper::OnPrintForPrintPreview( const base::DictionaryValue& job_settings) { CHECK_LE(ipc_nesting_level_, 1); if (prep_frame_view_) return; if (!render_view()->GetWebView()) return; blink::WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); if (!main_frame) re...
vuln
Safe
C/C++
static ram_addr_t qxl_rom_size(void) { #define QXL_REQUIRED_SZ (sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_modes)) #define QXL_ROM_SZ 8192 QEMU_BUILD_BUG_ON(QXL_REQUIRED_SZ > QXL_ROM_SZ); return QXL_ROM_SZ; }
vuln
Safe
C/C++
static int read_header(AVFormatContext *s) { BRSTMDemuxContext *b = s->priv_data; int bom, major, minor, codec, chunk; int64_t h1offset, pos, toffset; uint32_t size, asize, start = 0; AVStream *st; int ret = AVERROR_EOF; int loop = 0; int bfstm = !strcmp("bfstm", s->iformat->name); s...
vuln
Safe
C/C++
bool RepeatedAttrDefEqual( const protobuf::RepeatedPtrField<OpDef::AttrDef>& a1, const protobuf::RepeatedPtrField<OpDef::AttrDef>& a2) { std::unordered_map<string, const OpDef::AttrDef*> a1_set; for (const OpDef::AttrDef& def : a1) { DCHECK(a1_set.find(def.name()) == a1_set.end()) << "AttrDef na...
vuln
Vulnerable
C/C++
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt SVG module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commerc...
vuln
Safe
C/C++
function We(e){return!(!e||!e[Je])}
vuln
Safe
JavaScript
static void kvm_invalidate_memslot(struct kvm *kvm, struct kvm_memory_slot *old, struct kvm_memory_slot *invalid_slot) { /* * Mark the current slot INVALID. As with all memslot modifications, * this must be done on an unreachable slot to avoid modifying the * current slot in the active tree. */ ...
vuln
Vulnerable
Unknown
boost::optional<std::vector<ServerDescriptionPtr>> SdamServerSelector::selectServers( const TopologyDescriptionPtr topologyDescription, const ReadPreferenceSetting& criteria) { // If the topology wire version is invalid, raise an error if (!topologyDescription->isWireVersionCompatible()) { uasserte...
vuln
Vulnerable
Unknown
static void final(const short *i1, const short *i2, void *out, int *statbuf, int len) { int x, i; unsigned short int work[50]; short *ptr = work; memcpy(work, statbuf,20); memcpy(work + 10, i2, len * 2); for (i=0; i<len; i++) { int sum = 0; int new_val; ...
vuln
Safe
C/C++
static int ssh_packet_set_postauth(struct ssh *ssh) { struct sshcomp *comp; int r, mode; debug("%s: called", __func__); /* This was set in net child, but is not visible in user child */ ssh->state->after_authentication = 1; ssh->state->rekeying = 0; for (mode = 0; mode < MODE_MAX; mode++) { if (ssh->state->ne...
vuln
Vulnerable
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Constructs a new graph editor */ EditorUi = function(editor, container, lightbox) { mxEventSource.call(this); this.destroyFunctions = []; this.editor = editor || new Editor(); this.container = container || document.body; var graph = this.editor.graph; gra...
vuln
Safe
Java
int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp) { if (!d_inode(dentry)) return 0; if (exp->ex_flags & NFSEXP_V4ROOT) return 1; if (nfsd4_is_junction(dentry)) return 1; if (d_mountpoint(dentry)) /* * Might only be a mountpoint in a different namespace, * but we need to check. ...
vuln
Safe
C/C++
void ConnectionToClient::Disconnect() { if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&ConnectionToClient::Disconnect, this)); return; } CloseChannels(); if (session_.get()) session_.reset(); }
vuln
Vulnerable
C/C++
@Override protected void onCreate(Bundle savedInstanceState) { FDroidApp fdroidApp = (FDroidApp) getApplication(); fdroidApp.applyPureBlackBackgroundInDarkTheme(this); super.onCreate(savedInstanceState); setContentView(R.layout.activity_repo_details); MaterialToolbar toolb...
vuln
Safe
Java
static stmt_ty ast_for_for_stmt(struct compiling *c, const node *n0, bool is_async) { const node * const n = is_async ? CHILD(n0, 1) : n0; asdl_seq *_target, *seq = NULL, *suite_seq; expr_ty expression; expr_ty target, first; const node *node_target; int end_lineno, end_col_offset; int has_t...
vuln
Safe
C/C++
void ServerSecurityFeature::collectOptions(std::shared_ptr<ProgramOptions> options) { options->addOption("--server.harden", "lock down REST APIs that reveal version information or server " "internals for non-admin users", new BooleanParameter(&_hardenedRe...
vuln
Vulnerable
C/C++
protected double unloadingPhase(double time) { int strength = worker.getNaturalAttributeManager().getAttribute(NaturalAttributeType.STRENGTH); double strengthModifier = .1D + (strength * .018D); double amountUnloading = UNLOAD_RATE * strengthModifier * time; Inventory vehicleInv = vehicle.getInventory(); if...
vuln
Safe
Java
static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, const u8 *mac, struct station_parameters *params) { struct ieee80211_local *local = wiphy_priv(wiphy); struct sta_info *sta; struct ieee80211_sub_if_data *sdata; int err; int layer2_update; if (params->vlan) { sdata = IEEE8...
vuln
Vulnerable
Unknown
@Override public boolean convertFromTranslucent(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token); // Create a transition if the activity...
vuln
Vulnerable
Java
tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh, u32 pid, u32 seq, u16 flags, int event) { struct tcmsg *tcm; struct nlmsghdr *nlh; unsigned char *b = skb->tail; nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags); tcm = NLMSG_DATA(nlh); tcm->tcm_family = AF_UNSPEC; tcm...
vuln
Vulnerable
Unknown
protected CompletableFuture<Void> internalUpdatePropertiesAsync(boolean authoritative, Map<String, String> properties) { if (properties == null || properties.isEmpty()) { log.warn("[{}] [{}] properties is empty, ignore update", clie...
vuln
Vulnerable
Java
ptr_t GC_wince_get_mem(size_t bytes) { ptr_t result = 0; /* initialized to prevent warning. */ word i; bytes = ROUNDUP_PAGESIZE(bytes); /* Try to find reserved, uncommitted pages */ for (i = 0; i < GC_n_heap_bases; i++) { if (((word)(-(signed_word)GC_heap_lengths[i]) & (GC_s...
vuln
Safe
C/C++
static int scsi_disk_emulate_mode_sense(SCSIRequest *req, uint8_t *outbuf) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); uint64_t nb_sectors; int page, dbd, buflen; uint8_t *p; uint8_t dev_specific_param; dbd = req->cmd.buf[1] & 0x8; page = req->cmd.buf[2] & 0x3f; DPRIN...
vuln
Vulnerable
C/C++
pg_SSPI_recvauth(Port *port) { int mtype; StringInfoData buf; SECURITY_STATUS r; CredHandle sspicred; CtxtHandle *sspictx = NULL, newctx; TimeStamp expiry; ULONG contextattr; SecBufferDesc inbuf; SecBufferDesc outbuf; SecBuffer OutBuffers[1]; SecBuffer InBuffers[1]; HANDLE token; TOKEN_USER *tokenu...
vuln
Safe
Unknown
static VALUE cState_array_nl_set(VALUE self, VALUE array_nl) { unsigned long len; GET_STATE(self); Check_Type(array_nl, T_STRING); len = RSTRING_LEN(array_nl); if (len == 0) { if (state->array_nl) { ruby_xfree(state->array_nl); state->array_nl = NULL; } } ...
vuln
Safe
Unknown
load_header (XwdLoader *loader) // gconstpointer in, gsize in_max_len, XwdHeader *header_out) { XwdHeader *h = &loader->header; XwdHeader in; const guint32 *p = (const guint32 *) &in; if (!file_mapping_taste (loader->mapping, &in, 0, sizeof (in))) return FALSE; h->header_size = g_ntohl (*(...
vuln
Vulnerable
C/C++
static int copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) { *dst = *src; if (src->qp_table) { int qsize = src->qp_table_size; dst->qp_table = av_malloc(qsize); if (!dst->qp_table) { av_log(NULL, AV_LOG_ERROR, "Failed to allocate qp_table\...
vuln
Safe
C/C++
int main(int argc, char **argv) { int flag; int lpc = 0; int argerr = 0; int option_index = 0; crm_cluster_t cluster; const char *actions[] = { "reboot", "off", "on", "list", "monitor", "status" }; crm_ipc_t *old_instance = NULL; crm_log_preinit(NULL, argc, argv); crm_set_options(NU...
vuln
Safe
C/C++
int validate_camera_metadata_structure(const camera_metadata_t *metadata, const size_t *expected_size) { if (metadata == NULL) { ALOGE("%s: metadata is null!", __FUNCTION__); return ERROR; } { static const struct { const char *name; size_t alignment; } alignmen...
vuln
Vulnerable
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_parse_Q046.c -- Parsing functions specific to GQUIC Q046 */ #include <assert.h> #include <errno.h> #include <inttypes.h> #include <string.h> #include <sys/queue.h> #ifndef WIN32 #include <sys/types.h> #else #include <vc_compat.h> #...
vuln
Vulnerable
C/C++
async def start_transient_service( unit_name, cmd, args, working_dir, environment_variables=None, properties=None, uid=None, gid=None, slice=None, ): """ Start a systemd transient service with given parameters """ run_cmd = [ 'systemd-run', '--unit', ...
vuln
Safe
Python
static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { int idx = -1; HotplugHandlerClass *hhc; Error *local_err = NULL; X86CPU *cpu = X86_CPU(dev); PCMachineState *pcms = PC_MACHINE(hotplug_dev); pc_find_cpu_slot(M...
vuln
Vulnerable
C/C++
@Override protected XrootdResponse<MkDirRequest> doOnMkDir(ChannelHandlerContext ctx, MkDirRequest req) throws XrootdException { if (req.getPath().isEmpty()) { throw new XrootdException(kXR_ArgMissing, "no path specified"); } _log.info("Trying to create directory {}"...
vuln
Vulnerable
Java
_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, xkbSetDeviceInfoReq * stuff) { char *wire; wire = (char *) &stuff[1]; if (stuff->change & XkbXI_ButtonActionsMask) { int sz = stuff->nBtns * SIZEOF(xkbActionWireDesc); if (!_XkbCheckRequestBounds(client, stuff, wir...
vuln
Safe
Unknown
def GetExtensionMetadata(target): if not BUILDOZER_PATH: raise ExtensionDbError('Buildozer not found!') r = subprocess.run( [BUILDOZER_PATH, '-stdout', 'print security_posture status undocumented', target], stdout=subprocess.PIPE, stderr=subprocess.PIPE) security_posture, status, undocumente...
vuln
Safe
Python
void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left) { struct snd_timer_instance *ti, *ts, *tmp; unsigned long resolution, ticks; struct list_head *p, *ack_list_head; unsigned long flags; int use_tasklet = 0; if (timer == NULL) return; spin_lock_irqsave(&timer->lock, flags); /* reme...
vuln
Safe
Unknown
def remove_auth_hashes(input: Optional[str]): if not input: return input # If there are no hashes, skip the RE for performance. input_lower = input.lower() if not any([pw_hash.lower() in input_lower for pw_hash in PASSWORD_HASHERS.keys()]): return input return re_remove_passwords.sub...
vuln
Safe
Python
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor1, &input1)); const TfLiteTensor* input2; TF_LITE_ENSURE_OK(context, ...
vuln
Safe
C/C++
int scsi_bus_legacy_handle_cmdline(SCSIBus *bus) { Location loc; DriveInfo *dinfo; int res = 0, unit; loc_push_none(&loc); for (unit = 0; unit < bus->info->max_target; unit++) { dinfo = drive_get(IF_SCSI, bus->busnr, unit); if (dinfo == NULL) { continue; } ...
vuln
Vulnerable
C/C++
static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, u32 pid, u32 seq, u16 flags, int event) { struct tcmsg *tcm; struct nlmsghdr *nlh; unsigned char *b = skb->tail; struct gnet_dump d; nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags); tcm = NLMSG_DATA(nlh); tcm->tcm_family =...
vuln
Vulnerable
Unknown
protected void doProxy(HttpServletRequest req, HttpServletResponse resp) throws IOException { ZimbraLog.clearContext(); boolean isAdmin = isAdminRequest(req); AuthToken authToken = isAdmin ? getAdminAuthTokenFromCookie(req, resp, true) : getAuthTokenFromCookie(req, resp, true); ...
vuln
Safe
Java
spnego_gss_set_sec_context_option( OM_uint32 *minor_status, gss_ctx_id_t *context_handle, const gss_OID desired_object, const gss_buffer_t value) { OM_uint32 ret; ret = gss_set_sec_context_option(minor_status, context_handle, desired_object, value); return (ret); }
vuln
Vulnerable
C/C++
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
vuln
Vulnerable
C/C++
static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct snd_timer_user *tu = file->private_data; long ret; mutex_lock(&tu->ioctl_lock); ret = __snd_timer_user_ioctl(file, cmd, arg); mutex_unlock(&tu->ioctl_lock); return ret; }
vuln
Safe
C/C++
private void securityCheck(Path base, String filename) { try { String canonicalLoggingPath = (filename != null ? new File(base.toFile().toString(), filename) : new File(base.toFile().toString())).getCanonicalPath(); String baseCanonicalPath = new File(loggingPath).getCanonicalPath(); ...
vuln
Safe
Java
int sas_ex_revalidate_domain(struct domain_device *port_dev) { int res; struct domain_device *dev = NULL; res = sas_find_bcast_dev(port_dev, &dev); while (res == 0 && dev) { struct expander_device *ex = &dev->ex_dev; int i = 0, phy_id; do { phy_id = -1; res = sas_find_bcast_phy(dev, &phy_id, i, true);...
vuln
Vulnerable
Unknown
function E(){var b,c,d,e,f;if(Bc++,b=vc,c=[],d=vc,46===a.charCodeAt(vc)?(e=Va,vc++):(e=X,0===Bc&&g(Wa)),e!==X?(f=C(),f!==X?(wc=d,e=tb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa),d!==X)for(;d!==X;)c.push(d),d=vc,46===a.charCodeAt(vc)?(e=Va,vc++):(e=X,0===Bc&&g(Wa)),e!==X?(f=C(),f!==X?(wc=d,e=tb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa);els...
vuln
Vulnerable
JavaScript
static UINT drdynvc_order_recv(drdynvcPlugin* drdynvc, wStream* s) { int value; int Cmd; int Sp; int cbChId; Stream_Read_UINT8(s, value); Cmd = (value & 0xf0) >> 4; Sp = (value & 0x0c) >> 2; cbChId = (value & 0x03) >> 0; WLog_Print(drdynvc->log, WLOG_DEBUG, "order_recv: Cmd=0x%x, Sp=%d cbChId=%d", Cmd, Sp, cbC...
vuln
Vulnerable
C/C++
TIFF* TIFFFdOpen(int fd, const char* name, const char* mode) { TIFF* tif; tif = TIFFClientOpen(name, mode, (thandle_t) fd, _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); if (tif) tif->tif_fd = fd; return (tif); }
vuln
Vulnerable
C/C++
enum SCP_SERVER_STATES_E scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s, const char *reason) { tui32 version; tui32 size; tui16 cmdset; tui16 cmd; int rlen; char buf[256]; init_stream(c->in_s, c->in_s->size); init_stream(c->out_s, c->ou...
vuln
Safe
C/C++
def restrict_user_fields?(user) (user.trust_level == TrustLevel[0] && anonymous?) || !can_see_profile?(user) end
vuln
Safe
Ruby
int pci_add_capability(PCIDevice *pdev, uint8_t cap_id, uint8_t offset, uint8_t size) { int ret; Error *local_err = NULL; ret = pci_add_capability2(pdev, cap_id, offset, size, &local_err); if (local_err) { assert(ret < 0); error_report_err(local_err); } else { ...
vuln
Vulnerable
C/C++
static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size) { int i; vector unsigned char perm = vec_lvsl(0, pixels); vector unsigned char bytes; const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0); vector signed short shorts; for (i = ...
vuln
Vulnerable
C/C++
@Override @Nullable public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { setSubtitle(R.string.title_edit_account); setHasOptionsMenu(true); view = (ViewGroup) inflater.inflate(R.layout.fragment_pop, container, f...
vuln
Safe
Java
@SubscribeEvent public void onShiftClickPlayer(PacketEvent<CPacketUseEntity> e) { if (!UtilitiesConfig.INSTANCE.preventTradesDuels) return; EntityPlayerSP player = ModCore.mc().player; if (!player.isSneaking()) return; Entity clicked = e.getPacket().getEntityFromWorld(player.world)...
vuln
Safe
Java
@Override public Object single(Object arg) throws Exception { try { URL url = FileSystem.getUploadURL((String) arg); try (InputStream in = url.openStream()) { String s = IOUtils.toString(in, Charset.defaultCharset()); return parse(s); } } catch (MalformedURLException textNotU...
vuln
Vulnerable
Java
int ff_spatial_idwt_init2(DWTContext *d, IDWTELEM *buffer, int width, int height, int stride, enum dwt_type type, int decomposition_count, IDWTELEM *temp) { int level; d->buffer = buffer; d->width = width; d->height = height; d->stride = stride; ...
vuln
Vulnerable
C/C++
void inode_init_owner(struct inode *inode, const struct inode *dir, umode_t mode) { inode->i_uid = current_fsuid(); if (dir && dir->i_mode & S_ISGID) { inode->i_gid = dir->i_gid; if (S_ISDIR(mode)) mode |= S_ISGID; } else inode->i_gid = current_fsgid(); inode->i_mode = mode; }
vuln
Vulnerable
C/C++
mips_mipssim_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; ch...
vuln
Vulnerable
C/C++
static int is_git_directory(const char *suspect) { char path[PATH_MAX]; size_t len = strlen(suspect); strcpy(path, suspect); if (getenv(DB_ENVIRONMENT)) { if (access(getenv(DB_ENVIRONMENT), X_OK)) return 0; } else { strcpy(path + len, "/objects"); if (access(path, X_OK)) return 0; } strcpy(path + ...
vuln
Vulnerable
C/C++
bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, bool *error_reported, vcol_init_mode mode) { CHARSET_INFO *save_character_set_client= thd->variables.character_set_client; CHARSET_INFO *save_collation= thd->variables.collation_connection; Query_arena *backup_stmt_arena_ptr= t...
vuln
Vulnerable
Unknown
status_t SoundTriggerHwService::Module::startRecognition(sound_model_handle_t handle, const sp<IMemory>& dataMemory) { ALOGV("startRecognition() model handle %d", handle); if (!captureHotwordAllowed()) { return PERMISSION_DENIED; } if (dataMemory == 0 || dataMemory->pointer() == NULL) { ...
vuln
Safe
C/C++
SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, const char __user *, put_old) { struct path new, old, parent_path, root_parent, root; struct mount *new_mnt, *root_mnt, *old_mnt; struct mountpoint *old_mp, *root_mp; int error; if (!may_mount()) return -EPERM; error = user_path_dir(new_root, &new);...
vuln
Safe
Unknown
static inline void constructBidiRunsForSegment(InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfRuns, VisualDirectionOverride override, bool previousLineBrokeCleanly) { ASSERT(&topResolver.runs() == &bidiRuns); ASSERT(topResolver.position() != endOfRuns); RenderObj...
vuln
Vulnerable
C/C++
static int virtio_pci_load_config(void * opaque, QEMUFile *f) { VirtIOPCIProxy *proxy = opaque; int ret; ret = pci_device_load(&proxy->pci_dev, f); if (ret) { return ret; } msix_load(&proxy->pci_dev, f); if (msix_present(&proxy->pci_dev)) { qemu_get_be16s(f, &proxy->vdev->con...
vuln
Vulnerable
C/C++
public static @NotNull Concrete.Expression generateMinimizedRepresentation( @NotNull Expression expressionToPrint, @Nullable InstanceProvider instanceProvider, @Nullable DefinitionRenamer definitionRenamer) { PrettyPrinterConfig verboseConfig; PrettyPrinterConfig empt...
vuln
Safe
Java
'use strict'; var is = require('is'); var keys = require('object-keys'); var tag = require('./tag'); var dataRegExp = /^data-[a-z]+([-][a-z]+)*$/; var ariaRegExp = /^aria-[a-z]+$/; var legalAttrs = ['autocomplete', 'autocorrect', 'autofocus', 'autosuggest', 'checked', 'dirname', 'disabled', 'tabindex', 'list', 'max',...
vuln
Safe
JavaScript