code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
Response StorageHandler::TrackCacheStorageForOrigin(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( BrowserThre...
vuln
Safe
C/C++
int host_matches(const struct sudoers_parse_tree *parse_tree, const struct passwd *pw, const char *lhost, const char *shost, const struct member *m) { struct alias *a; int matched = UNSPEC; debug_decl(host_matches, SUDOERS_DEBUG_MATCH); switch (m->type) { case ALL: matched = m->negated ? ...
vuln
Safe
C/C++
static void exif_process_COM (image_info_type *image_info, char *value, size_t length) { exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2); }
vuln
Vulnerable
Unknown
static OPJ_BOOL opj_pi_next_lrcp(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; OPJ_UINT32 index = 0; if (pi->poc.compno0 >= pi->numcomps || pi->poc.compno1 >= pi->numcomps + 1) { opj_event_msg(pi->manager, EVT_ERROR, "op...
vuln
Safe
Unknown
public static boolean isGridEmpty(HandledScreen<?> handledScreen, int gridLength) { boolean isEmpty = true; List<Slot> slots = handledScreen.getScreenHandler().slots; for (int i = 0; i < gridLength; i++) { isEmpty &= !slots.get(i + 1).hasStack(); } return isEmpty; }
vuln
Safe
Java
private void setupLauncherUiAfterSwipeUpToRecentsAnimation() { if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) { return; } endLauncherTransitionController(); mRecentsView.onSwipeUpAnimationSuccess(); if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { mTaskAn...
vuln
Vulnerable
Java
void AppCacheGroup::RemoveCache(AppCache* cache) { DCHECK(cache->associated_hosts().empty()); if (cache == newest_complete_cache_) { CancelUpdate(); AppCache* tmp_cache = newest_complete_cache_; newest_complete_cache_ = nullptr; tmp_cache->set_owning_group(nullptr); // may cause this group to ...
vuln
Vulnerable
C/C++
long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch, oggpack_buffer *b,int n){ long i,j,entry; int chptr=0; if(book->used_entries>0){ int m=(offset+n)/ch; for(i=offset/ch;i<m;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return...
vuln
Safe
Unknown
@Inject(method = "reportAbuse", at = @At("HEAD"), cancellable = true, remap = false) public void reportAbuse(AbuseReportRequest request, CallbackInfo ci) { for (var message : request.report.evidence.messages) { if (message.body != null) { if (Gaslight.removedMessages.contains(mes...
vuln
Safe
Java
@Override public boolean receiveDataByteArray(byte[] aData, INetworkHandler aNetworkHandler) { mRGBa = UT.Code.getRGBInt(new short[] {UT.Code.unsignB(aData[0]), UT.Code.unsignB(aData[1]), UT.Code.unsignB(aData[2])}); setDirectionData(aData[3]); for (int i = 0; i < 28; i++) mDisplay[i] = aData[i+4]; return T; ...
vuln
Vulnerable
Java
public String getOxAuthClientSecret() { return StringHelper.toString(getAttribute("oxAuthClientSecret")); }
vuln
Safe
Java
xmlParseComment(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; int size = XML_PARSER_BUFFER_SIZE; int len = 0; xmlParserInputState state; const xmlChar *in; int nbchar = 0, ccol; int inputid; /* * Check that there is a comment right here. */ if ((RAW != '<') || (NXT(1) != '...
vuln
Vulnerable
C/C++
static int disas_cp_insn(CPUState *env, DisasContext *s, uint32_t insn) { TCGv tmp, tmp2; uint32_t rd = (insn >> 12) & 0xf; uint32_t cp = (insn >> 8) & 0xf; if (IS_USER(s)) { return 1; } if (insn & ARM_CP_RW_BIT) { if (!env->cp[cp].cp_read) return 1; gen_set_p...
vuln
Safe
C/C++
void helper_fxtract(void) { CPU86_LDoubleU temp; unsigned int expdif; temp.d = ST0; expdif = EXPD(temp) - EXPBIAS; ST0 = expdif; fpush(); BIASEXPONENT(temp); ST0 = temp.d; }
vuln
Vulnerable
C/C++
@Override public boolean execute(CommandSender sender, String[] args) { if (args.length != 2) { sender.sendMessage(StringUtils.color(syntax.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix))); return false; } Player player = (Player) sender...
vuln
Vulnerable
Java
static char *scsibus_get_dev_path(DeviceState *dev) { SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev); DeviceState *hba = dev->parent_bus->parent; char *id = NULL; char *path; if (hba && hba->parent_bus && hba->parent_bus->info->get_dev_path) { id = hba->parent_bus->info->get_dev_path(hba);...
vuln
Safe
C/C++
/* * Copyright (c) 2004-2021, University of Oslo * 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 copyright notice, this * list of cond...
vuln
Safe
Java
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type) { if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) { fmt = av_guess_forma...
vuln
Vulnerable
C/C++
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Vulnerable
Python
@Override public <T> Publisher<T> executeReactiveWithLockReactive(MailboxPath path, Publisher<T> execution, LockType lockType) { return Mono.fromRunnable(() -> lock(path, lockType)) .then(Mono.from(execution)) .doFinally(any -> unlock(path, lockType)); }
vuln
Vulnerable
Java
static void launch(OpKernelContext* context, const TensorShape& tensor_in_shape, const Tensor& out_backprop, const std::array<int64, 3>& window, const std::array<int64, 3>& stride, const std::array<int64, 3>& output...
vuln
Safe
C/C++
static inline signed int ReadPropertySignedLong(const EndianType endian, const unsigned char *buffer) { union { unsigned int unsigned_value; signed int signed_value; } quantum; unsigned int value; if (endian == LSBEndian) { value=(unsigned int) buffer[3] << 24; val...
vuln
Safe
Unknown
static int security_context_to_sid_core(const char *scontext, u32 scontext_len, u32 *sid, u32 def_sid, gfp_t gfp_flags, int force) { char *scontext2, *str = NULL; struct context context; int rc = 0; if (!ss_initialized) { int i; for (i = 1; i < SECINITSID_NUM; i++) { if (!strcmp(initial_sid...
vuln
Vulnerable
C/C++
static bool caller_is_in_ancestor(pid_t pid, const char *contrl, const char *cg, char **nextcg) { char fnam[PROCLEN]; FILE *f; bool answer = false; char *line = NULL; size_t len = 0; int ret; ret = snprintf(fnam, PROCLEN, "/proc/%d/cgroup", pid); if (ret < 0 || ret >= PROCLEN) return false; if (!(f = fop...
vuln
Vulnerable
C/C++
void __detach_mounts(struct dentry *dentry) { struct mountpoint *mp; struct mount *mnt; namespace_lock(); mp = lookup_mountpoint(dentry); if (IS_ERR_OR_NULL(mp)) goto out_unlock; lock_mount_hash(); while (!hlist_empty(&mp->m_list)) { mnt = hlist_entry(mp->m_list.first, struct mount, mnt_mp_list); if (mnt...
vuln
Vulnerable
Unknown
static int32_t bmdma_prepare_buf(IDEDMA *dma, int32_t limit) { BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); IDEState *s = bmdma_active_if(bm); PCIDevice *pci_dev = PCI_DEVICE(bm->pci_dev); struct { uint32_t addr; uint32_t size; } prd; int l, len; pci_dma_sglist_init(&s->...
vuln
Safe
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
vuln
Vulnerable
Java
xmlParseReference(xmlParserCtxtPtr ctxt) { xmlEntityPtr ent; xmlChar *val; int was_checked; xmlNodePtr list = NULL; xmlParserErrors ret = XML_ERR_OK; if (RAW != '&') return; /* * Simple case of a CharRef */ if (NXT(1) == '#') { int i = 0; xmlChar out[10]; int hex ...
vuln
Vulnerable
C/C++
static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al) { unsigned short type; unsigned short size; unsigned short len; unsigned char *data = *p; int renegotiate_seen = 0; s->servername_done = 0; s->tlsext_status_type = -1; #ifndef OPENSSL_NO_NEXTPROTONEG s->s3->n...
vuln
Safe
Unknown
static int decode_cell_data(Cell *cell, uint8_t *block, uint8_t *ref_block, int pitch, int h_zoom, int v_zoom, int mode, const vqEntry *delta[2], int swap_quads[2], const uint8_t **data_ptr, const uint8_t *last_ptr) { int ...
vuln
Safe
C/C++
R_API void r_anal_bb_free(RAnalBlock *bb) { if (!bb) { return; } r_anal_cond_free (bb->cond); R_FREE (bb->fingerprint); r_anal_diff_free (bb->diff); bb->diff = NULL; R_FREE (bb->op_bytes); r_anal_switch_op_free (bb->switch_op); bb->switch_op = NULL; bb->fingerprint = NULL; bb->cond = NULL; R_FREE (bb->lab...
vuln
Safe
C/C++
package com.salesmanager.shop.filter; import java.util.Enumeration; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import org.springframework.web.util.HtmlUtils; /** * Cross Site Scripting filter enforcing html encoding of request parameters * @author carlsamson...
vuln
Safe
Java
@Override public void onResolve(HitResult rayTraceResult, Level world, @Nullable LivingEntity shooter, SpellStats spellStats, SpellContext spellContext, SpellResolver resolver) { if (!canSummon(shooter)) return; Vec3 hit = rayTraceResult.getLocation(); int ticks = (int) (20 * (GE...
vuln
Vulnerable
Java
read_f(int argc, char **argv) { struct timeval t1, t2; int Cflag = 0, pflag = 0, qflag = 0, vflag = 0; int Pflag = 0, sflag = 0, lflag = 0; int c, cnt; char *buf; int64_t offset; int count; int total = 0; int pattern = 0, pattern_offset = 0, pattern_count = 0; while ((c = getopt(argc, argv, "C...
vuln
Vulnerable
C/C++
static void qed_aio_write_inplace(QEDAIOCB *acb, uint64_t offset, size_t len) { if (acb->flags & QED_AIOCB_ZERO) { struct iovec *iov = acb->qiov->iov; if (!iov->iov_base) { iov->iov_base = qemu_blockalign(acb->common.bs, iov->iov_len); memset(iov->iov_base, 0, iov->iov_l...
vuln
Vulnerable
C/C++
@Result public int scan(@NonNull FrontendSettings settings, @ScanType int scanType, @NonNull @CallbackExecutor Executor executor, @NonNull ScanCallback scanCallback) { /** * Scan can be called again for blink scan if scanCallback and executor are same as before. */ if (...
vuln
Vulnerable
Java
def _read_palette(self): ret = [] for i in range(256): try: b, g, r, a = struct.unpack("<4B", self._safe_read(4)) except struct.error: break ret.append((b, g, r, a)) return ret
vuln
Safe
Python
@Override protected void startUp() { convertOldBrightnessConfig(); configGroundTextures = config.groundTextures(); configGroundBlending = config.groundBlending(); configWaterEffects = config.waterEffects(); configObjectTextures = config.objectTextures(); configTzhaarHD = config.tzhaarHD(); configProjec...
vuln
Vulnerable
Java
/* * Handle git attributes. See gitattributes(5) for a description of * the file syntax, and attr.h for a description of the API. * * One basic design decision here is that we are not going to support * an insanely large number of attributes. */ #include "cache.h" #include "config.h" #include "exec-cmd.h" #incl...
vuln
Vulnerable
C/C++
package com.salesmanager.shop.application.config; import static org.springframework.http.MediaType.IMAGE_GIF; import static org.springframework.http.MediaType.IMAGE_JPEG; import static org.springframework.http.MediaType.IMAGE_PNG; import java.util.Arrays; import java.util.List; import java.util.Locale; import org.ap...
vuln
Vulnerable
Java
static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1, uint64_t prp2, uint32_t len, NvmeCtrl *n) { hwaddr trans_len = n->page_size - (prp1 % n->page_size); trans_len = MIN(len, trans_len); int num_prps = (len >> n->page_bits) + 1; if (!prp1) { ...
vuln
Vulnerable
C/C++
@Override public boolean update(Engine engine) throws UpdateException { this.cveDB = engine.getDatabase(); this.settings = engine.getSettings(); dbProperties = cveDB.getDatabaseProperties(); final boolean autoUpdate = settings.getBoolean(Settings.KEYS.AUTO_UPDATE, true); fina...
vuln
Vulnerable
Java
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Editor constructor executed on page load. */ Editor = function(chromeless, themes, model, graph, editable) { mxEventSource.call(this); this.chromeless = (chromeless != null) ? chromeless : this.chromeless; this.initStencilRegistry(); this.graph = graph || this....
vuln
Safe
JavaScript
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform) { int i, mb_x, mb_y; uint16_t (*buffer)[4]; int left[4], top[4], topleft[4]; const int linesize = s->linesize[0]; const int mask = (1 << s->bits) - 1; int resync_mb_y = 0; int r...
vuln
Safe
C/C++
void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex) { SleepConditionVariableSRW(&cond->var, &mutex->lock, INFINITE, 0); }
vuln
Safe
C/C++
@Override public PendingIntent getActivityLaunchIntent(ComponentName component, Bundle opts, UserHandle user) { if (!canAccessProfile(user.getIdentifier(), "Cannot start activity")) { throw new ActivityNotFoundException("Activity could not be found"); } ...
vuln
Vulnerable
Java
protected String submitRequests(Locale locale, IProfile profile, IAuthToken authToken, IRequest[] reqs) { String auditSubjectID = auditSubjectID(); String auditRequesterID = ILogger.UNIDENTIFIED; String errorCode = null; String errorReason = null; for (IRequest req : reqs) { ...
vuln
Safe
Java
STATIC SSize_t S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth) /* scanp: Start here (rea...
vuln
Vulnerable
C/C++
static int userauth_pubkey(struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; struct passwd *pw = authctxt->pw; struct sshbuf *b = NULL; struct sshkey *key = NULL; char *pkalg = NULL, *userstyle = NULL, *key_s = NULL, *ca_s = NULL; u_char *pkblob = NULL, *sig = NULL, have_sig; size_t blen, slen; int r, pkty...
vuln
Safe
C/C++
'use strict' var path = require('path') var fs = require('graceful-fs') var rimraf = require('rimraf') var asyncMap = require('slide').asyncMap var correctMkdir = require('../../utils/correct-mkdir') var npm = require('../../npm.js') var andIgnoreErrors = require('../and-ignore-errors.js') var move = require('../../uti...
vuln
Vulnerable
JavaScript
def _wrapper(func): @functools.wraps(func) def _wrapped(*args, **kwargs): user_warned = not warn_user num_attempts = num_retries + 1 # +1 for the first attempt for attempt in range(1, num_attempts + 1): try: return func(*args, **kw...
vuln
Safe
Python
authhavekey( keyid_t id ) { symkey * sk; authkeylookups++; if (0 == id || cache_keyid == id) { return TRUE; } /* * Seach the bin for the key. If found and the key type * is zero, somebody marked it trusted without specifying * a key or key type. In this case consider the key missing. */ authkeyunca...
vuln
Safe
Unknown
void JavascriptArray::SliceHelper(JavascriptArray* pArr, JavascriptArray* pnewArr, uint32 start, uint32 newLen) { SparseArraySegment<T>* headSeg = (SparseArraySegment<T>*)pArr->head; SparseArraySegment<T>* pnewHeadSeg = (SparseArraySegment<T>*)pnewArr->head; // Fill the newly created slice...
vuln
Safe
C/C++
public function render() { $result = new Dto_FormResult('notsubmitted'); // Check permissions $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_perform_login, ''); /* * Create a default SpotUser so the form is always able to render * the values of the form ...
vuln
Vulnerable
PHP
@Override public File getModContainerFile(String name) { ModFileInfo mfi = LoadingModList.get().getModFileById(name); // Try case sensitive lookup if (mfi != null) { File f = mfi.getFile().getFilePath().toFile(); return f; } return null; ...
vuln
Vulnerable
Java
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0. package export import ( "bytes" "context" "database/sql" "encoding/json" "fmt" "io" "math" "strconv" "strings" "github.com/go-sql-driver/mysql" "github.com/pingcap/errors" "github.com/pingcap/failpoint" "github.com/pingcap/tidb/br/pkg/version" ...
vuln
Safe
Go
resolve: function resolve(hostname) { var output, nodeBinary = process.execPath, scriptPath = path.join(__dirname, "../scripts/dns-lookup-script"), response, cmd = util.format('"%s" "%s" %s', nodeBinary, scriptPath, hostname); response = shell.exec(cmd, {...
vuln
Vulnerable
JavaScript
static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) { struct sk_buff *skb; unsigned char *b; struct nlmsghdr *nlh; struct tcamsg *t; struct netlink_callback dcb; struct rtattr *x; struct rtattr *tb[TCA_ACT_MAX+1]; struct rtattr *kind; struct tc_action *a = create_a(0); int err = -EINV...
vuln
Vulnerable
Unknown
/* Copyright (c) 2001 Matej Pfajfar. * Copyright (c) 2001-2004, Roger Dingledine. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2015, The Tor Project, Inc. */ /* See LICENSE for licensing information */ /** * \file buffers.c * \brief Implements a generic interface buffer. Buff...
vuln
Vulnerable
C/C++
static int readOHDRHeaderMessageDataLayout(struct READER *reader, struct DATAOBJECT *data) { int i, err; unsigned size; uint8_t dimensionality, layout_class; uint32_t dataset_element_size; uint64_t data_address, store, data_size; UNUSED(dataset_element_size); ...
vuln
Vulnerable
C/C++
SyncType GetSyncType(const Extension* extension) { if (!IsSyncable(extension)) { return SYNC_TYPE_NONE; } if (!ManifestURL::GetUpdateURL(extension).is_empty() && !ManifestURL::UpdatesFromGallery(extension)) { return SYNC_TYPE_NONE; } if (PluginInfo::HasPlugins(extension)) return SYNC_TYPE...
vuln
Vulnerable
C/C++
@Override public void binderDied(IBinder who) { Slog.e(TAG, "Callback binder died: " + who); for (ClientCallback callback : mClientCallbacks) { if (callback.mCallback.asBinder().equals(who)) { Slog.e(TAG, "Removing dead callback for: " + callback.mOpPackageName); ...
vuln
Vulnerable
Java
setup: function () { var data = this.model.get('data') || {}; this.entityType = this.model.get('relatedType') || data.entityType || null; this.entityId = this.model.get('relatedId') || data.entityId || null; this.entityName = this.model.get('relatedName') || data.entity...
vuln
Safe
JavaScript
void svr_mailowner( job *pjob, /* I */ int mailpoint, /* note, single character */ int force, /* if set to MAIL_FORCE, force mail delivery */ char *text) /* (optional) additional message text */ { char *cmdbuf; int i; char *mailfrom; char mailto[1024]; char *bodyfmt, *...
vuln
Vulnerable
C/C++
bool ChromeRenderMessageFilter::OnMessageReceived(const IPC::Message& message, bool* message_was_ok) { bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(ChromeRenderMessageFilter, message, *message_was_ok) #if !defined(DISABLE_NACL) IPC_MESSAGE_HANDLER_DELAY_REPLY(C...
vuln
Vulnerable
C/C++
def GetActionAllowAnyoneRateLimited(rateLimits: RateLimits, avoidCookies: Boolean = false) (f: GetRequest => Result): Action[Unit] = PlainApiAction(cc.parsers.empty, rateLimits, allowAnyone = true, avoidCookies = avoidCookies)(f)
vuln
Vulnerable
Scala
def add_consumption_data_row(self, ts, energy_used, power_used): if power_used > 0: query = ''' INSERT OR IGNORE INTO Consumption ( TimeStamp, EnergyUsed, PowerUsed ) VALUES ...
vuln
Safe
Python
package io.onedev.server.web.page.project.builds.detail.artifacts; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.Callable; import org.apache.commons.compress.utils.IOUt...
vuln
Vulnerable
Java
@Override public TweakData[] getTweaks(ItemStack itemStack) { CompoundNBT tag = NBTHelper.getTag(itemStack); String variant = tag.getString(this.variantTagKey); String[] improvementKeys = Arrays.stream(getImprovements(itemStack)) .map(improvement -> improvement.key) ...
vuln
Vulnerable
Java
static int proxy_init(FsContext *ctx) { V9fsProxy *proxy = g_malloc(sizeof(V9fsProxy)); int sock_id; if (ctx->export_flags & V9FS_PROXY_SOCK_NAME) { sock_id = connect_namedsocket(ctx->fs_root); } else { sock_id = atoi(ctx->fs_root); if (sock_id < 0) { fprintf(stderr, ...
vuln
Safe
C/C++
public void bandwidthTest(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { res.setContentType("text/plain"); Long start = System.currentTimeMillis(); long end = start + 5000; while (System.currentTimeMillis() < end) { res.getWriter().wri...
vuln
Vulnerable
Java
private void determineCollectionSites(double roverRange, double tripTimeLimit, int numSites) { List<Coordinates> unorderedSites = new ArrayList<Coordinates>(); // Determining the actual traveling range. double range = roverRange; double timeRange = getTripTimeRange(tripTimeLimit, numSites, true); if (timeRa...
vuln
Vulnerable
Java
PHP_FUNCTION(dns_get_record) { char *hostname; int hostname_len; long type_param = PHP_DNS_ANY; zval *authns = NULL, *addtl = NULL; int type_to_fetch; #if defined(HAVE_DNS_SEARCH) struct sockaddr_storage from; uint32_t fromsize = sizeof(from); dns_handle_t handle; #elif defined(HAVE_RES_NSEARCH) struct __res_s...
vuln
Vulnerable
C/C++
void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, uint32_t max_frags, bool has_virt_hdr) { struct NetTxPkt *p = g_malloc0(sizeof *p); p->pci_dev = pci_dev; p->vec = g_new(struct iovec, max_frags + NET_TX_PKT_PL_START_FRAG); p->raw = g_new(struct iovec, max_frags); p->max_...
vuln
Safe
Unknown
compile_length_bag_node(BagNode* node, regex_t* reg) { int len; int tlen; if (node->type == BAG_OPTION) return compile_length_option_node(node, reg); if (NODE_BAG_BODY(node)) { tlen = compile_length_tree(NODE_BAG_BODY(node), reg); if (tlen < 0) return tlen; } else tlen = 0; switch (node...
vuln
Vulnerable
Unknown
void show_opcodes(u8 *rip, const char *loglvl) { #define PROLOGUE_SIZE 42 #define EPILOGUE_SIZE 21 #define OPCODE_BUFSIZE (PROLOGUE_SIZE + 1 + EPILOGUE_SIZE) u8 opcodes[OPCODE_BUFSIZE]; if (probe_kernel_read(opcodes, rip - PROLOGUE_SIZE, OPCODE_BUFSIZE)) { printk("%sCode: Bad RIP value.\n", loglvl); } else { pr...
vuln
Vulnerable
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2022 * All rights reserved * * This file is part of GPAC / AAC ADTS reframer filter * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gen...
vuln
Safe
C/C++
@Override protected void addServices(Injector injector, List<? super Service> services, List<? super AutoCloseable> closeableResources, MasterEnvironment masterEnv, MasterEnvironmentContext masterEnvContext, EnvironmentOptions opti...
vuln
Vulnerable
Java
public static SAXParserFactory createSaxParserFactory() { final SAXParserFactory parserFactory = SAXParserFactory.newInstance(); try { parserFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); parserFactory.setFeature(XMLConstants.FEATURE...
vuln
Safe
Java
efind(name) char *name; { static char efbuf[100]; my_regex_t re; sprintf(efbuf, "REG_%s", name); assert(strlen(efbuf) < sizeof(efbuf)); re.re_endp = efbuf; (void) my_regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); return(atoi(efbuf)); }
vuln
Vulnerable
C/C++
def pipeline_set_notebook_kernels(pipeline_json, pipeline_directory, project_uuid): """ Raises: KeyError: The structure of the metadata in thee Notebook's JSON was changed. """ # for each step set correct notebook kernel if it exists steps = pipeline_json["steps"].keys() ...
vuln
Vulnerable
Python
public String getHeader( HttpServletRequest request, String name ) throws ValidationException { SecurityConfiguration sc = ESAPI.securityConfiguration(); String value = request.getHeader(name); return ESAPI.validator().getValidInput("HTTP header value: " + value, value, "HTTPHeaderValue", sc.getIntPro...
vuln
Safe
Java
function Re(n){return cc(n)&&we(n)==Dn}
vuln
Safe
JavaScript
internals.Socket.prototype._authenticate = function () { const config = this._listener._settings.auth; if (!config) { return; } if (config.timeout) { this.auth._timeout = setTimeout(() => this.disconnect(), config.timeout); } const cookies = this._ws.upgradeReq.headers.cookie;...
vuln
Vulnerable
JavaScript
int smb2_allocate_rsp_buf(struct ksmbd_work *work) { struct smb2_hdr *hdr = smb2_get_msg(work->request_buf); size_t small_sz = MAX_CIFS_SMALL_BUFFER_SIZE; size_t large_sz = small_sz + work->conn->vals->max_trans_size; size_t sz = small_sz; int cmd = le16_to_cpu(hdr->Command); if (cmd == SMB2_IOCTL_HE || cmd == S...
vuln
Vulnerable
C/C++
static void do_tx_packet(lan9118_state *s) { int n; uint32_t status; /* FIXME: Honor TX disable, and allow queueing of packets. */ if (s->phy_control & 0x4000) { /* This assumes the receive routine doesn't touch the VLANClient. */ lan9118_receive(qemu_get_queue(s->nic), s->txp->data,...
vuln
Vulnerable
C/C++
int read_image_tga( gdIOCtx *ctx, oTga *tga ) { int pixel_block_size = (tga->bits / 8); int image_block_size = (tga->width * tga->height) * pixel_block_size; int* decompression_buffer = NULL; unsigned char* conversion_buffer = NULL; int buffer_caret = 0; int bitmap_caret = 0; int i = 0; int encoded_pixels; int...
vuln
Safe
C/C++
static void snd_timer_user_ccallback(struct snd_timer_instance *timeri, int event, struct timespec *tstamp, unsigned long resolution) { struct snd_timer_user *tu = timeri->callback_data; struct snd_timer_tread r1; unsigned long flags; if (event >= SNDRV_TIMER_EVENT_START && event <=...
vuln
Safe
C/C++
static void CopyTransportDIBHandleForMessage( const TransportDIB::Handle& handle_in, TransportDIB::Handle* handle_out) { #if defined(OS_MACOSX) if ((handle_out->fd = HANDLE_EINTR(dup(handle_in.fd))) < 0) { PLOG(ERROR) << "dup()"; return; } handle_out->auto_close = true; #else *handle_out ...
vuln
Vulnerable
C/C++
var CommentsWindow=function(b,f,l,d,t,u){function E(){for(var H=N.getElementsByTagName("div"),F=0,J=0;J<H.length;J++)"none"!=H[J].style.display&&H[J].parentNode==N&&F++;K.style.display=0==F?"block":"none"}function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}...
vuln
Vulnerable
JavaScript
if (!NIL_P(exc)) { volatile VALUE eclass = rb_obj_class(exc); volatile VALUE backtrace; DUMP1("(failed)"); thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; DUMP1("set backtrace"); if (!NIL_P(backtrace = rb_funcallv(exc, ID_backtrace, 0, 0))) { ...
vuln
Safe
Unknown
static VALUE cState_space_set(VALUE self, VALUE space) { unsigned long len; GET_STATE(self); Check_Type(space, T_STRING); len = RSTRING_LEN(space); if (len == 0) { if (state->space) { ruby_xfree(state->space); state->space = NULL; state->space_len = 0; ...
vuln
Safe
Unknown
unsigned int get_random_int(void) { struct keydata *keyptr; __u32 *hash = get_cpu_var(get_random_int_hash); int ret; keyptr = get_keyptr(); hash[0] += current->pid + jiffies + get_cycles(); ret = half_md4_transform(hash, keyptr->secret); put_cpu_var(get_random_int_hash); return ret; }
vuln
Vulnerable
Unknown
public void cors() { InputStream is = getClass().getResourceAsStream("/allow-origin1.xml"); PolicyRestrictor restrictor = new PolicyRestrictor(is); assertTrue(restrictor.isCorsAccessAllowed("http://bla.com")); assertFalse(restrictor.isCorsAccessAllowed("http://www.jolokia.org")); ...
vuln
Vulnerable
Java
public void init(InputStream input, String sqlDefsSection, Connection conn, Map<String, String> configParameters) throws Exception { // Parse the InputStream as an XML document. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); // Disable XXE cf CWE-611 https://cheatsheetser...
vuln
Safe
Java
ssize_t v9fs_get_xattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size) { XattrOperations *xops = get_xattr_operations(ctx->xops, name); if (xops) { return xops->getxattr(ctx, path, name, value, size); } errno = -EOPNOTSUPP; return -1; }
vuln
Vulnerable
C/C++
ConnectionExists(struct Curl_easy *data, struct connectdata *needle, struct connectdata **usethis, bool *force_reuse, bool *waitpipe) { struct connectdata *check; struct connectdata *chosen = 0; bool foundPendingCandidate = FALSE; bool canmulti...
vuln
Safe
Unknown
userauth_pubkey(struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; struct passwd *pw = authctxt->pw; struct sshbuf *b; struct sshkey *key = NULL; char *pkalg, *userstyle = NULL, *key_s = NULL, *ca_s = NULL; u_char *pkblob, *sig, have_sig; size_t blen, slen; int r, pktype; int authenticated = 0; st...
vuln
Vulnerable
C/C++
UNICORN_EXPORT uc_err uc_open(uc_arch arch, uc_mode mode, uc_engine **result) { struct uc_struct *uc; if (arch < UC_ARCH_MAX) { uc = calloc(1, sizeof(*uc)); if (!uc) { // memory insufficient return UC_ERR_NOMEM; } /* qemu/exec.c: phys_map_node_reserve() ...
vuln
Safe
C/C++
private void onHierarchy(int hierarchy) { if (mScanCallbackExecutor != null && mScanCallback != null) { mScanCallbackExecutor.execute(() -> mScanCallback.onHierarchyReported(hierarchy)); } }
vuln
Vulnerable
Java