code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
RequestHandler::RequestHandler( std::shared_ptr<CheckWorkflow> check_workflow, std::shared_ptr<context::ServiceContext> service_context, std::unique_ptr<Request> request_data) : context_(new context::RequestContext(service_context, std::move(request_data))), ...
vuln
Vulnerable
C/C++
const { randomUUID } = require("crypto"); const { encryptCookie, verifyCsrf } = require("./encryption"); const cookieParams = { httpOnly: true, sameSite: "strict", signed: true, maxAge: 300000 }; const csurf = (secret, forbiddenMethods, excludedUrls) => { if (!forbiddenMethods) forbiddenMethods = ["POST", "...
vuln
Safe
JavaScript
static inline int ccid_hc_tx_getsockopt(struct ccid *ccid, struct sock *sk, const int optname, int len, u32 __user *optval, int __user *optlen) { int rc = -ENOPROTOOPT; if (ccid != NULL && ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL) rc = ccid->ccid_ops->ccid_hc_tx_getsockopt(sk, optname, len, op...
vuln
Safe
C/C++
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
vuln
Safe
JavaScript
/** * $Id: mxRack.js,v 1.5 2014/01/21 13:10:37 gaudenz Exp $ * Copyright (c) 2006-2013, JGraph Ltd */ //********************************************************************************************************************************************************** //Rack Numbering //***************************************...
vuln
Vulnerable
Java
module.exports = async function remote() { const origin = await exec('git remote get-url origin'); const nosuffix = origin.replace(/\.git$/, ''); const [ match ] = nosuffix.match(/[\w-]*\/[\w-]+$/) || [ nosuffix ]; const [ name, owner = '' ] = match.split('/').reverse(); return { name, owner }; };
vuln
Vulnerable
JavaScript
gs_nulldevice(gs_gstate * pgs) { int code = 0; if (pgs->device == 0 || !gx_device_is_null(pgs->device)) { gx_device *ndev; code = gs_copydevice(&ndev, (const gx_device *)&gs_null_device, pgs->memory); if (code < 0) return code; ...
vuln
Vulnerable
C/C++
def index respond_to do |format| format.json do dir = params[:dir] dir = 'desc' unless SORT_DIRECTIONS.include?(dir.try(:upcase)) @occurrences = @bug.occurrences.order("occurred_at #{dir}").limit(50) last = params[:last].present? ? @bug.occurrences.find_by_number(params[:last...
vuln
Vulnerable
Ruby
static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size) { const unsigned char *data_end = data + data_size; GetBitContext gb; int flags, i, j, x, y, op; unsigned char c[3]; unsigned char *dst; uint32_t *palette; flags = *data++; if (flags & 1) { ...
vuln
Safe
C/C++
@GET @Path("/project/{uuid}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation( value = "Returns a list of all findings for a specific project", response = Finding.class, responseContainer = "List", responseHeaders = @ResponseHeader(name = TOTAL_COUNT_HEADE...
vuln
Safe
Java
ex_substitute(exarg_T *eap) { linenr_T lnum; long i = 0; regmmatch_T regmatch; static subflags_T subflags = {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, 0}; #ifdef FEAT_EVAL subflags_T subflags_save; #endif int save_do_all; // remember user specified 'g' flag int save_do_...
vuln
Safe
Unknown
static struct ip *ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp) { register struct mbuf *m = dtom(slirp, ip); register struct ipasfrag *q; int hlen = ip->ip_hl << 2; int i, next; DEBUG_CALL("ip_reass"); DEBUG_ARG("ip = %p", ip); DEBUG_ARG("fp = %p", fp); DEBUG_ARG("m = %p", m); ...
vuln
Safe
C/C++
static void io_req_drop_files(struct io_kiocb *req) { struct io_ring_ctx *ctx = req->ctx; unsigned long flags; spin_lock_irqsave(&ctx->inflight_lock, flags); list_del(&req->inflight_entry); if (waitqueue_active(&ctx->inflight_wait)) wake_up(&ctx->inflight_wait); spin_unlock_irqrestore(&ctx->inflight_lock, flag...
vuln
Safe
Unknown
void rose_stop_heartbeat(struct sock *sk) { del_timer(&sk->sk_timer); }
vuln
Vulnerable
Unknown
public int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException { int space; if (ciphertextOffset < 0 || ciphertextOffset > ciphertext.length) throw new IllegalArgumentException(); else spa...
vuln
Safe
Java
function render() { localStorage.setItem("storedState", JSON.stringify(entries)) let renderEntries = entries if (entries.length === 0) renderEntries.push(emptyObject) let html = "" for (let i = 0; i < renderEntries.length; i++) { let entry = entries[i] let birthdateType = "date" ...
vuln
Safe
JavaScript
bootp_print(netdissect_options *ndo, register const u_char *cp, u_int length) { register const struct bootp *bp; static const u_char vm_cmu[4] = VM_CMU; static const u_char vm_rfc1048[4] = VM_RFC1048; bp = (const struct bootp *)cp; ND_TCHECK(bp->bp_op); ND_PRINT((ndo, "BOOTP/DHCP, %s", tok2str(bootp_op...
vuln
Safe
C/C++
$scope.add = function() { bootbox.prompt('Please enter the name for the new requisition', function(foreignSource) { if (foreignSource) { // Validate Requisition if (foreignSource.match(/[/\\?:&*'"]/)) { bootbox.alert('Cannot add the requisition ' + _.escape(foreignSource) +...
vuln
Safe
JavaScript
package pipelineserver import ( "net/http" "github.com/concourse/concourse/atc" "github.com/concourse/concourse/atc/db" ) type RejectArchivedHandlerFactory struct { teamFactory db.TeamFactory } func NewRejectArchivedHandlerFactory(factory db.TeamFactory) RejectArchivedHandlerFactory { return RejectArchivedHand...
vuln
Safe
Go
list_dbs(MYSQL *mysql,const char *wild) { const char *header; uint length, counter = 0; ulong rowcount = 0L; char tables[NAME_LEN+1], rows[NAME_LEN+1]; char query[255]; MYSQL_FIELD *field; MYSQL_RES *result; MYSQL_ROW row= NULL, rrow; if (!(result=mysql_list_dbs(mysql,wild))) { fprintf(stderr,"...
vuln
Vulnerable
C/C++
private static boolean is(int config, int key) { return (config & key) != 0; }
vuln
Safe
Java
long Segment::DoLoadCluster(long long& pos, long& len) { if (m_pos < 0) return DoLoadClusterUnknownSize(pos, len); long long total, avail; long status = m_pReader->Length(&total, &avail); if (status < 0) // error return status; if (total >= 0 && avail > total) return E_FILE_FORMAT_INVALID; ...
vuln
Safe
C/C++
def sendEmail( sydent: "Sydent", templateFile: str, mailTo: str, substitutions: Dict[str, str], log_send_errors: bool = True, ) -> None: """ Sends an email with the given parameters. :param sydent: The Sydent instance to use when building the configuration to send the email with...
vuln
Safe
Python
/** * @interface SchemaOptions * @property {Function} afterMigration Execute a callback after running schema migrations. * @property {Function} beforeMigration Execute a callback before running schema migrations. * @property {Any} definitions Rest representation on Parse.Schema https://docs.parseplatform.org/rest/g...
vuln
Safe
JavaScript
static bool gen_check_privilege(DisasContext *dc) { if (dc->cring) { gen_exception_cause(dc, PRIVILEGED_CAUSE); dc->is_jmp = DISAS_UPDATE; return false; } return true; }
vuln
Safe
C/C++
public String[] getWatcherDivision() { return watcherDivision; }
vuln
Vulnerable
Java
static ssize_t exitcode_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { char *end, buf[sizeof("nnnnn\0")]; size_t size; int tmp; size = min(count, sizeof(buf)); if (copy_from_user(buf, buffer, size)) return -EFAULT; tmp = simple_strtol(buf, &end, 0); if ((*end != '\0')...
vuln
Safe
C/C++
private void handleFaceError(int msgId, String errString) { Assert.isMainThread(); if (DEBUG_FACE) Log.d(TAG, "Face error received: " + errString); if (mHandler.hasCallbacks(mFaceCancelNotReceived)) { mHandler.removeCallbacks(mFaceCancelNotReceived); } // Error is al...
vuln
Safe
Java
public static int getColor(ItemStack stack, int tintIndex) { if (stack.getItem() instanceof CustomHoneyBucketItem bucket && tintIndex == 1) { return bucket.getHoneyBucketColor(); } return BeeConstants.DEFAULT_ITEM_COLOR; }
vuln
Safe
Java
status_t BnCrypto::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case INIT_CHECK: { CHECK_INTERFACE(ICrypto, data, reply); reply->writeInt32(initCheck()); return OK; } case IS_CRYPTO_SUPPORTED: { CHECK_INTERFACE(ICrypto, dat...
vuln
Vulnerable
C/C++
static void ptrace_link(struct task_struct *child, struct task_struct *new_parent) { __ptrace_link(child, new_parent, current_cred()); }
vuln
Safe
C/C++
static void show_format(WriterContext *w, AVFormatContext *fmt_ctx) { char val_str[128]; int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; print_section_header("format"); print_str("filename", fmt_ctx->filename); print_int("nb_streams", fmt_ctx->nb_streams); print_str("form...
vuln
Vulnerable
C/C++
int nfc_register_device(struct nfc_dev *dev) { int rc; pr_debug("dev_name=%s\n", dev_name(&dev->dev)); mutex_lock(&nfc_devlist_mutex); nfc_devlist_generation++; rc = device_add(&dev->dev); mutex_unlock(&nfc_devlist_mutex); if (rc < 0) return rc; rc = nfc_llcp_register_device(dev); if (rc) pr_err("Could...
vuln
Vulnerable
Unknown
SPL_METHOD(Array, unserialize) { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC); char *buf; int buf_len; const unsigned char *p, *s; php_unserialize_data_t var_hash; zval *pmembers, *pflags = NULL; HashTable *aht; long flags; if (zend_parse_parameters(ZEND_NUM...
vuln
Safe
C/C++
public void setCdDtlNm(String[] cdDtlNm) { this.cdDtlNm = cdDtlNm; }
vuln
Vulnerable
Java
generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { struct address_space *mapping = out->f_mapping; struct inode *inode = mapping->host; ssize_t ret; int err; err = remove_suid(out->f_dentry); if (unlikely(err)) return err; ret...
vuln
Safe
Unknown
static void *bpf_obj_do_get(const struct filename *pathname, enum bpf_type *type) { struct inode *inode; struct path path; void *raw; int ret; ret = kern_path(pathname->name, LOOKUP_FOLLOW, &path); if (ret) return ERR_PTR(ret); inode = d_backing_inode(path.dentry); ret = inode_permission(inode, MAY_W...
vuln
Vulnerable
Unknown
parse_device(dev_t *pdev, struct archive *a, char *val) { #define MAX_PACK_ARGS 3 unsigned long numbers[MAX_PACK_ARGS]; char *p, *dev; int argc; pack_t *pack; dev_t result; const char *error = NULL; memset(pdev, 0, sizeof(*pdev)); if ((dev = strchr(val, ',')) != NULL) { /* * Device's major/minor are given...
vuln
Vulnerable
C/C++
static void exif_mnote_data_canon_load (ExifMnoteData *ne, const unsigned char *buf, unsigned int buf_size) { ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne; ExifShort c; size_t i, tcount, o, datao; if (!n || !buf || !buf_size) { exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Short Ma...
vuln
Vulnerable
C/C++
static int dissect_dvb_s2_bb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *ti; proto_tree *dvb_s2_bb_tree; guint8 input8, matype1; guint8 sync_flag = 0; guint16 input16, bb_data_len = 0, user_packet_length; int sub_dissected = 0...
vuln
Vulnerable
C/C++
def fetch_resultSet(self, session, id): self._openContainer(session) sid = str(id) if (self.idNormalizer is not None): sid = self.idNormalizer.process_string(session, sid) query = ("SELECT class, data FROM %s WHERE identifier = $1;" % (self.table) ...
vuln
Safe
Python
R_API RBinJavaAttrInfo *r_bin_java_local_variable_type_table_attr_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { RBinJavaLocalVariableTypeAttribute *lvattr; ut64 offset = 6; ut32 i = 0; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (buffer, sz, 0); if (!attr) { return NULL; } attr->type = R_BIN_JAVA_ATTR_...
vuln
Safe
Unknown
LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) { static const char module[] = "LogL16Decode"; LogLuvState* sp = DecoderState(tif); int shft; tmsize_t i; tmsize_t npixels; unsigned char* bp; int16* tp; int16 b; tmsize_t cc; int rc; assert(s == 0); assert(sp != NULL); npixels = occ / sp->pixel_...
vuln
Vulnerable
Unknown
public void log(Object message, boolean await) throws InterruptedException { if (Core.getInstance().profile.checkJoinedThreadStack()) { if (message instanceof TextHelper) { logInternal((TextHelper)message); } else if (message != null) { logInternal(message...
vuln
Vulnerable
Java
int cpu_restore_state(TranslationBlock *tb, CPUState *env, unsigned long searched_pc, void *puc) { TCGContext *s = &tcg_ctx; int j; unsigned long tc_ptr; #ifdef CONFIG_PROFILER int64_t ti; #endif #ifdef CONFIG_PROFILER ti = profile_getclock(); #endif t...
vuln
Vulnerable
C/C++
static int omap_intc_init(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); struct omap_intr_handler_s *s = OMAP_INTC(dev); if (!s->iclk) { error_report("omap-intc: clk not connected"); return -1; } s->nbanks = 1; sysbus_init_irq(sbd, &s->parent_intr[0]); sysbus_init_irq(s...
vuln
Safe
C/C++
function Karma (updater, socket, iframe, opener, navigator, location, document) { this.updater = updater var startEmitted = false var self = this var queryParams = util.parseQueryParams(location.search) var browserId = queryParams.id || util.generateId('manual-') var displayName = queryParams.displayName ...
vuln
Safe
JavaScript
PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules(bool omitCharsetRules) { if (doc() && !doc()->securityOrigin()->canRequest(baseURL())) return 0; return CSSRuleList::create(this, omitCharsetRules); }
vuln
Vulnerable
C/C++
void ProtocolV2::write_event() { ldout(cct, 10) << __func__ << dendl; ssize_t r = 0; connection->write_lock.lock(); if (can_write) { if (keepalive) { ldout(cct, 10) << __func__ << " appending keepalive" << dendl; auto keepalive_frame = KeepAliveFrame::Encode(); if (!append_frame(keepalive...
vuln
Safe
Unknown
static cmark_node *try_opening_table_row(cmark_syntax_extension *self, cmark_parser *parser, cmark_node *parent_container, unsigned char *input, int len) { cmark_node *table_row_block; table_ro...
vuln
Vulnerable
Unknown
static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); int err; if (opcode == BPF_END || opcode == BPF_NEG) { if (opcode == BPF_NEG) { if (BPF_SRC(insn->code) != 0 || insn->src_reg != BPF_REG_0 || ...
vuln
Vulnerable
Unknown
const _ = require('lodash') const cheerio = require('cheerio') const uslug = require('uslug') const pageHelper = require('../../../helpers/page') const URL = require('url').URL const mustacheRegExp = /(\{|&#x7b;?){2}(.+?)(\}|&#x7d;?){2}/i /* global WIKI */ module.exports = { async render() { const $ = cheerio....
vuln
Safe
JavaScript
yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target) { const int16_t *bu...
vuln
Vulnerable
C/C++
protected void processZipEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream zipout) throws IOException, ParserConfigurationException, SAXException, TransformerException { zipout.putNextEntry(new ZipEntry(zipEntry.getName())); if (zipEntry.getName().toLowerCase().endsWith(".xml")) { Doc...
vuln
Vulnerable
Java
/*jshint node:true*/ "use strict"; var exec = require("child_process").spawn; function runCommand(command, args, done) { if(typeof args === "function") { done = args; args = ""; } if(!Array.isArray(args)) { args = [args]; } args.unshift(command); var child = spawn("p4...
vuln
Safe
JavaScript
GF_Err gf_isom_text_get_encoded_tx3g(GF_ISOFile *file, u32 track, u32 sidx, u32 sidx_offset, u8 **tx3g, u32 *tx3g_size) { GF_BitStream *bs; GF_TrackBox *trak; GF_Tx3gSampleEntryBox *a; trak = gf_isom_get_track_from_file(file, track); if (!trak) return GF_BAD_PARAM; a = (GF_Tx3gSampleEntryBox *) gf_list_get(trak...
vuln
Vulnerable
Unknown
private IAIState chopTree() { worker.getCitizenStatusHandler().setLatestStatus(new TranslatableComponent("com.minecolonies.coremod.status.chopping")); final boolean shouldBreakLeaves = building.shouldDefoliate() || job.getTree().isNetherTree(); if (job.getTree().hasLogs() || (shouldBreakLe...
vuln
Vulnerable
Java
public void parse(List<String> words){ command = ""; args = new LinkedList<>(); int size = words.size(); if(size == 1){ command = words.get(0); }else if(size > 1){ command = words.get(0); args = new LinkedList<>(words.subList(1, size)); ...
vuln
Safe
Java
proc_file_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { struct inode * inode = file->f_dentry->d_inode; char *page; ssize_t retval=0; int eof=0; ssize_t n, count; char *start; struct proc_dir_entry * dp; dp = PDE(inode); if (!(page = (char*) __get_free_page(GFP_KERNEL))) ...
vuln
Vulnerable
Unknown
pci_lintr_assert(struct pci_vdev *dev) { assert(dev->lintr.pin > 0); pthread_mutex_lock(&dev->lintr.lock); if (dev->lintr.state == IDLE) { if (pci_lintr_permitted(dev)) { dev->lintr.state = ASSERTED; pci_irq_assert(dev); } else dev->lintr.state = PENDING; } pthread_mutex_unlock(&dev->lintr.lock); }
vuln
Vulnerable
C/C++
/* p_lx_elf.cpp -- This file is part of the UPX executable compressor. Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Laszlo Molnar Copyright (C) 2000-2020 John F. Reiser All Rights Reserved. UPX and the UCL library are free software; you can redistribute them...
vuln
Safe
C/C++
int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, int proto) { struct net *net = dev_net(skb->dev); struct sock *sk; struct udphdr *uh; struct in6_addr *saddr, *daddr; u32 ulen = 0; if (!pskb_may_pull(skb, sizeof(struct udphdr))) goto short_packet; saddr = &ipv6_hdr(skb)->saddr; daddr...
vuln
Safe
Unknown
static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx, struct vrend_resource *res, const struct iovec *iov, int num_iovs, const struct vrend_transfer_info *info) { v...
vuln
Safe
Unknown
static bool NPN_RemoveProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName) { notImplemented(); return false; }
vuln
Vulnerable
C/C++
static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, AVPacket *pkt) { int chunk_type; if (s->audio_chunk_offset) { if (s->audio_type != CODEC_ID_INTERPLAY_DPCM) { s->audio_chunk_offset += 6; s->audio_chunk_size -= 6; avio_seek(pb, s->audio_chunk_o...
vuln
Vulnerable
C/C++
static int raw_pread(BlockDriverState *bs, int64_t offset, uint8_t *buf, int count) { BDRVRawState *s = bs->opaque; int size, ret, shift, sum; sum = 0; if (s->aligned_buf != NULL) { if (offset & 0x1ff) { shift = offset & 0x1ff; size = (s...
vuln
Vulnerable
C/C++
package com.salesmanager.shop.filter; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;...
vuln
Safe
Java
@Override public String fromXML(String source) throws MessageSerializerException { StringBuilder builder = new StringBuilder(); try { DelimitedXMLHandler handler = new DelimitedXMLHandler(deserializationProperties); XMLReader xr = XMLReaderFactory.createXMLReader(); ...
vuln
Safe
Java
static void vpc_close(BlockDriverState *bs) { BDRVVPCState *s = bs->opaque; qemu_vfree(s->pagetable); #ifdef CACHE g_free(s->pageentry_u8); #endif migrate_del_blocker(s->migration_blocker); error_free(s->migration_blocker); }
vuln
Safe
Unknown
static inline void gen_neon_widen(TCGv_i64 dest, TCGv src, int size, int u) { if (u) { switch (size) { case 0: gen_helper_neon_widen_u8(dest, src); break; case 1: gen_helper_neon_widen_u16(dest, src); break; case 2: tcg_gen_extu_i32_i64(dest, src); break; default: abort(); ...
vuln
Vulnerable
C/C++
static void mov_metadata_creation_time(AVMetadata **metadata, time_t time) { char buffer[32]; if (time) { time -= 2082844800; strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", gmtime(&time)); av_metadata_set2(metadata, "creation_time", buffer, 0); } }
vuln
Vulnerable
C/C++
@Override public int drainWater(int max, boolean execute) { if(this.isMultiBlockOrigin()) { return super.drainWater(max, execute); } else { return this.getMultiBlockOrigin().drainWater(max, execute); } }
vuln
Vulnerable
Java
DecodeIPV6ExtHdrs(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, uint16_t len, PacketQueue *pq) { SCEnter(); uint8_t *orig_pkt = pkt; uint8_t nh = 0; /* careful, 0 is actually a real type */ uint16_t hdrextlen = 0; uint16_t plen; char dstopts = 0; char exthdr_fh_done ...
vuln
Vulnerable
C/C++
static int main_loop(void) { int ret, timeout; #ifdef CONFIG_PROFILER int64_t ti; #endif CPUState *env; cur_cpu = first_cpu; next_cpu = cur_cpu->next_cpu ?: first_cpu; for(;;) { if (vm_running) { for(;;) { env = next_cpu; #ifdef CONFIG_PROFILE...
vuln
Safe
C/C++
@Override public void addMenu(ActionContext context) { context.addSubMenu("new", "New") .add("Android Class") .setOnMenuItemClickListener(item -> { CreateClassDialogFragment fragment = CreateClassDialogFragment.newInstance( Coll...
vuln
Vulnerable
Java
mm_answer_pam_free_ctx(int sock, Buffer *m) { debug3("%s", __func__); (sshpam_device.free_ctx)(sshpam_ctxt); buffer_clear(m); mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m); auth_method = "keyboard-interactive"; auth_submethod = "pam"; return (sshpam_authok == sshpam_ctxt); }
vuln
Vulnerable
C/C++
public static int cleanUpDirectoryFiles(File directory) throws IOException { int counter = 0; File[] allDirFiles = directory.listFiles(); if (allDirFiles != null) { for (int i = 0; i < allDirFiles.length; i++) { File aFile = allDirFiles[i]; if (aFile.isFile()) { if (aFile.del...
vuln
Vulnerable
Java
static int compat_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, const AVPacket *pkt) { AVCodecInternal *avci = avctx->internal; int ret = 0; av_assert0(avci->compat_decode_consumed == 0); *got_frame = 0; avci->compat_decode = 1; if (avci->compat_decode_pa...
vuln
Safe
C/C++
public static void onSystemServerStart() { try { if (!inited) commonInit(true); Log.i(TAG, "System server is started!"); // Start loading the properties asynchronously first to minimize time-consuming. DreamlandManagerService dms = DreamlandManagerService.start()...
vuln
Safe
Java
static int qcow2_create2(const char *filename, int64_t total_size, const char *backing_file, const char *backing_format, int flags, size_t cluster_size, int prealloc, QEMUOptionParameter *options, int version, Error **er...
vuln
Vulnerable
C/C++
/** * @file resolve.c * @author Michal Vasko <mvasko@cesnet.cz> * @brief libyang resolve functions * * Copyright (c) 2015 - 2018 CESNET, z.s.p.o. * * This source code is licensed under BSD 3-Clause License (the "License"). * You may not use this file except in compliance with the License. * You may obtain a co...
vuln
Vulnerable
C/C++
int jas_matrix_resize(jas_matrix_t *matrix, int numrows, int numcols) { int size; int i; size = numrows * numcols; if (size > matrix->datasize_ || numrows > matrix->maxrows_) { return -1; } matrix->numrows_ = numrows; matrix->numcols_ = numcols; for (i = 0; i < numrows; ++i) { matrix->rows_[i] = &mat...
vuln
Vulnerable
C/C++
$otherCampaignName = MAX_buildName($aOtherCampaign['placement_id'], $aOtherCampaign['name']); if ($aOtherCampaign['placement_id'] != $campaignId) { $form .= "<option value='" . $aOtherCampaign['placement_id'] . "'>" . htmlspecialchars($otherCampaignName) . "</option>"; } else { ...
vuln
Safe
PHP
window._load_metadata = function(ev, viewport) { /* Image details */ var tmp = viewport.getMetadata(); $('#wblitz-image-name').html(tmp.imageName); $('#wblitz-image-description-content').html(tmp.imageDescription.replace(/\n/g, '<br />')); $('#wblitz-image-author').html(tmp.imag...
vuln
Vulnerable
JavaScript
static int get_bitmap_file(struct mddev *mddev, void __user * arg) { mdu_bitmap_file_t *file = NULL; /* too big for stack allocation */ char *ptr; int err; file = kmalloc(sizeof(*file), GFP_NOIO); if (!file) return -ENOMEM; err = 0; spin_lock(&mddev->lock); /* bitmap disabled, zero the first byte and copy o...
vuln
Vulnerable
C/C++
static void set_proc_name(const char *s) { #if defined(__linux__) && defined(PR_SET_NAME) char name[16]; if (!s) return; name[sizeof(name) - 1] = 0; strncpy(name, s, sizeof(name)); prctl(PR_SET_NAME, name); #endif }
vuln
Safe
C/C++
public int getPerimeterDistance(BiomeAccess biomeAccess, BlockPos pos) { float minimum = cardinalHorizon + 1; BlockPos iterPos; int horizon; int dx; int dz; // If we are on the perimeter, avoid some difficult "edge" cases (har har) by short-circuiting. for (EightWayDirection direction : EightWayDirection...
vuln
Vulnerable
Java
public void readExternal(DataInput in) throws IOException { if (!isEmpty()) { throw new NotActiveException(); } boolean fLite = in.readBoolean(); if (fLite) { readAndInitObjectArray(in); } else ...
vuln
Safe
Java
private int calculateOctreeOrigin(Collection<ChunkPosition> chunksToLoad, boolean centerOctree) { int xmin = Integer.MAX_VALUE; int xmax = Integer.MIN_VALUE; int zmin = Integer.MAX_VALUE; int zmax = Integer.MIN_VALUE; for (ChunkPosition cp : chunksToLoad) { if (cp.x < xmin) { xmin = cp...
vuln
Safe
Java
public static FileContentHandle compileToJavaFile(String contractName, List<ABIDefinition> abiInfo, String contractBin, String packageName) throws IOException { File abiFile = new File(Constants.ABI_DIR + Constants.DIAGONAL + contractName + ".abi"); FrontUtils.createFileIfNotEx...
vuln
Vulnerable
Java
public boolean observe(Player player, HitResult result) { if (toObserve.isEmpty()) { return false; } if (result instanceof BlockHitResult) { BlockHitResult blockResult = (BlockHitResult) result; BlockInWorld blockInWorld = new BlockInWorld(player.level, blockResult.getBlockPos(), false); BlockState ...
vuln
Vulnerable
Java
@Override public boolean prevGroup() { int position = mBinding.group.getSelectedPosition() - 1; if (position < 0) position = mGroupAdapter.size() - 1; mGroup = (Group) mGroupAdapter.get(position); mBinding.group.setSelectedPosition(position); if (mGroup.getChannel().isEmpty()...
vuln
Safe
Java
static int mode_encrypt(File filein, File fileout) { size_t bytesread; size_t chunkbuflen; uchar *chunkbuf = NULL; void *ivbuf = NULL; size_t encryptbuflen = 0; size_t encryptedlen = 0; void *encryptbuf = NULL; ulonglong ttlchunkswritten = 0; ulonglong ttlbyteswritten = 0; xb_wcrypt_t *xbcryp...
vuln
Safe
C/C++
const convict = function convict(def, opts) { // TODO: Rename this `rv` variable (supposedly "return value") into something // more meaningful. const rv = { /** * Gets the array of process arguments, using the override passed to the * convict function or process.argv if no override was passed. ...
vuln
Vulnerable
JavaScript
static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel) { if (parcel == NULL) { return NULL; } android::Parcel* p = android::parcelForJavaObject(env, parcel); const size_t size = p->readInt32(); const void* regionData = p->readInplace(size); if (regionData == NULL) { retur...
vuln
Vulnerable
Unknown
static void common_hrtimer_rearm(struct k_itimer *timr) { struct hrtimer *timer = &timr->it.real.timer; if (!timr->it_interval) return; timr->it_overrun += (unsigned int) hrtimer_forward(timer, timer->base->get_time(), timr->it_interval); hrtimer_restart(timer); }
vuln
Vulnerable
Unknown
public static BitmapDrawable scaleDrawable(Resources res, Drawable drawable, int new_x, int new_y) { if((new_x == 0) || (new_y == 0)) return null; Bitmap bitmap = Bitmap.createBitmap(new_x, new_y, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBou...
vuln
Safe
Java
package middleware import ( "encoding/json" "fmt" "net/http" "strings" ctx "github.com/gophish/gophish/context" "github.com/gophish/gophish/models" "github.com/gorilla/csrf" ) // CSRFExemptPrefixes are a list of routes that are exempt from CSRF protection var CSRFExemptPrefixes = []string{ "/api", } // CSRF...
vuln
Safe
Go
@Override protected void onCreate(@Nullable final Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivityScenesBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); mViewModel = new ViewModelProvider(this).get(ScenesViewModel.class); ...
vuln
Vulnerable
Java
static int dca_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int channel_mask; int channel_layout; int lfe_samples; int num_core_channels = 0; int i, ret; fl...
vuln
Vulnerable
C/C++