code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
def build_IR(self, expr, args, kwargs, context): return IRnode.from_list( [ "if", ["slt", args[0], 0], ["sdiv", ["sub", args[0], DECIMAL_DIVISOR - 1], DECIMAL_DIVISOR], ["sdiv", args[0], DECIMAL_DIVISOR], ], typ=...
vuln
Safe
Python
renderError(t,e,n,r,s){const i=new Error(t);return i.exception=e||null,i.file=n||null,i.line=r||null,i.trace=s||[],i}
vuln
Vulnerable
JavaScript
/* 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
def window(): target_url = request.args.get('location') if target_url.startswith('gAAAAA'): cipher_suite = Fernet(g.session_key) target_url = cipher_suite.decrypt(target_url.encode()).decode() content_filter = Filter( g.session_key, root_url=request.url_root, config=...
vuln
Vulnerable
Python
void mutt_init (int skip_sys_rc, LIST *commands) { struct passwd *pw; struct utsname utsname; char *p, buffer[STRING], error[STRING]; int i, default_rc = 0, need_pause = 0; BUFFER err; memset (&err, 0, sizeof (err)); err.data = error; err.dsize = sizeof (error); Groups = hash_create (1031, 0); Rev...
vuln
Safe
Unknown
static unsigned int XBMInteger(Image *image,short int *hex_digits) { int c; unsigned int value; /* Skip any leading whitespace. */ do { c=ReadBlobByte(image); if (c == EOF) return(0); } while ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r')); /* Evaluate num...
vuln
Vulnerable
C/C++
static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb) { if (sk->sk_backlog.len >= max(sk->sk_backlog.limit, sk->sk_rcvbuf << 1)) return -ENOBUFS; __sk_add_backlog(sk, skb); sk->sk_backlog.len += skb->truesize; return 0; }
vuln
Vulnerable
Unknown
static void release_drive(Object *obj, const char *name, void *opaque) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; BlockBackend **ptr = qdev_get_prop_ptr(dev, prop); if (*ptr) { blk_detach_dev(*ptr, dev); blockdev_auto_del(*ptr); } }
vuln
Vulnerable
C/C++
static int hdev_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; int ret; #if defined(__APPLE__) && defined(__MACH__) if (strstart(filename, "/dev/cdrom", NULL)) { kern_return_t kernResult; io_iterator_t mediaIterator; char bsdPath[ MAXPATHL...
vuln
Safe
C/C++
MagickPrivate const char* GetOpenCLCachedFilesDirectory() { if (openclCachedFilesDirectory == NULL) { if (openclCachedFilesDirectoryLock == NULL) { ActivateSemaphoreInfo(&openclCachedFilesDirectoryLock); } LockSemaphoreInfo(openclCachedFilesDirectoryLock); if (openclCachedFilesDirectory == N...
vuln
Vulnerable
C/C++
static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, int mvn, int r_x, int r_y, uint8_t* is_intra) { MpegEncContext *s = &v->s; int xy, wrap, off = 0; int A[2], B[2], C[2]; int px, py; int a_valid = 0, b_valid = 0, c_valid = 0; int...
vuln
Vulnerable
C/C++
/* Copyright 2019 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
void do_change_user(int afdt_fd) { std::string uname; lwp_read(afdt_fd, uname); if (!uname.length()) return; StructuredLogEntry* log = nullptr; int err = 0; SCOPE_EXIT { if (log) { log->setInt("errno", err); log->setStr("new_user", uname); StructuredLog::log("hhvm_lightprocess_error",...
vuln
Safe
C/C++
/* Legal Notice: Some portions of the source code contained in this file were derived from the source code of TrueCrypt 7.1a, which is Copyright (c) 2003-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0, also from the source code of Encryption for the Masses 2.02a, which is ...
vuln
Vulnerable
C/C++
static int xan_huffman_decode(uint8_t *dest, int dest_len, const uint8_t *src, int src_len) { uint8_t byte = *src++; uint8_t ival = byte + 0x16; const uint8_t * ptr = src + byte*2; int ptr_len = src_len - 1 - byte*2; uint8_t val = ival; uint8_t *dest_end = dest + de...
vuln
Vulnerable
C/C++
static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; int entries, i, j; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; avio_rb32(pb); // version + flags entries = avio_rb...
vuln
Safe
C/C++
def hierarchical_tile(masterfile,tilefile): """ Create Hierarchical tile from Master prior :param masterfile: Master prior file :param tilefile: File containing Tiling scheme """ try: taskid = np.int(os.environ['SGE_TASK_ID']) task_first=np.int(os.environ['SGE_TASK_FIRST']) ...
vuln
Safe
Python
static TPM_RESULT SWTPM_NVRAM_CheckHeader(unsigned char *data, uint32_t length, uint32_t *dataoffset, uint16_t *hdrflags, uint8_t *hdrversion, bool quiet) { blobheader *bh = (blobheader *)data; uint16_t hdrsize; if (length < sizeof(bh)) { if (!quiet) ...
vuln
Safe
C/C++
int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, int (*put_cb)(const SSL_CIPHER *, unsigned char *)) { int i,j=0; SSL_CIPHER *c; unsigned char *q; #ifndef OPENSSL_NO_KRB5 int nokrb5 = !kssl_tgt_is_available(s->kssl_ctx); #endif /* OPENSSL_NO_KRB5 */...
vuln
Vulnerable
Unknown
void ff_aac_search_for_ltp(AACEncContext *s, SingleChannelElement *sce, int common_window) { int w, g, w2, i, start = 0, count = 0; int saved_bits = -(15 + FFMIN(sce->ics.max_sfb, MAX_LTP_LONG_SFB)); float *C34 = &s->scoefs[128*0], *PCD = &s->scoefs[128*1]; float *PCD34 = &s->...
vuln
Vulnerable
C/C++
public static File zipFile(File file2zip, File zippedFile) throws IOException { byte[] block = new byte[4096]; int inBytes = 0; FileInputStream iStream = null; ZipOutputStream oStream = null; try { // open input stream iStream = new FileInputStream(file2zip); // create ZipEntry, us...
vuln
Vulnerable
Java
static int vaapi_encode_issue(AVCodecContext *avctx, VAAPIEncodePicture *pic) { VAAPIEncodeContext *ctx = avctx->priv_data; VAAPIEncodeSlice *slice; VAStatus vas; int err, i; char data[MAX_PARAM_BUFFER_SIZE]; size_t bit_len; av_log(avctx, AV_LOG_DEBUG, "Issuing ...
vuln
Safe
C/C++
void AppControllerImpl::LaunchApp(const std::string& app_id) { app_service_proxy_->Launch(app_id, ui::EventFlags::EF_NONE, apps::mojom::LaunchSource::kFromAppListGrid, display::kDefaultDisplayId); }
vuln
Vulnerable
C/C++
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Setting IpAddress To Log and taking header for original IP if forwarded from proxy ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For")); Http...
vuln
Safe
Java
GC_INNER GC_bool GC_collect_or_expand(word needed_blocks, GC_bool ignore_off_page, GC_bool retry) { GC_bool gc_not_stopped = TRUE; word blocks_to_get; IF_CANCEL(int cancel_state;) DISABLE_CANCEL(cancel_state); if (!GC_incre...
vuln
Vulnerable
C/C++
void ff_xvmc_decode_mb(MpegEncContext *s) { XvMCMacroBlock *mv_block; struct xvmc_pix_fmt *render; int i, cbp, blocks_per_mb; const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; if (s->encoding) { av_log(s->avctx, AV_LOG_ERROR, "XVMC doesn't support encoding!!!\n"); return; } ...
vuln
Vulnerable
C/C++
void fp6_read_bin(fp6_t a, const uint8_t *bin, size_t len) { if (len != 6 * RLC_FP_BYTES) { RLC_THROW(ERR_NO_BUFFER); return; } fp2_read_bin(a[0], bin, 2 * RLC_FP_BYTES); fp2_read_bin(a[1], bin + 2 * RLC_FP_BYTES, 2 * RLC_FP_BYTES); fp2_read_bin(a[2], bin + 4 * RLC_FP_BYTES, 2 * RLC_FP_BYTES); }
vuln
Safe
C/C++
static int tgv_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TgvContext *s = avctx->priv_data; const uint8_t *buf_end = buf + ...
vuln
Vulnerable
C/C++
is_vlan_packet(E1000State *s, const uint8_t *buf) { return (be16_to_cpup((uint16_t *)(buf + 12)) == le16_to_cpu(s->mac_reg[VET])); }
vuln
Safe
C/C++
/* * 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
u_undo_end( int did_undo, // just did an undo int absolute) // used ":undo N" { char *msgstr; u_header_T *uhp; char_u msgbuf[80]; #ifdef FEAT_FOLDING if ((fdo_flags & FDO_UNDO) && KeyTyped) foldOpenCursor(); #endif if (global_busy // no messages now, wait until global is finished ...
vuln
Safe
Unknown
void Editor::Transpose() { //// TODO(yosin): We should move |Transpose()| into |ExecuteTranspose()| in //// "EditorCommand.cpp" void Transpose(LocalFrame& frame) { Editor& editor = frame.GetEditor(); if (!editor.CanEdit()) return; Document* const document = frame.GetDocument(); document->UpdateStyleAndL...
vuln
Safe
C/C++
static void simpleCopy(SwsContext *c, uint8_t* srcParam[], int srcStrideParam[], int srcSliceY, int srcSliceH, uint8_t* dstParam[], int dstStride[]){ int srcStride[3]; uint8_t *src[3]; uint8_t *dst[3]; if(c->srcFormat == IMGFMT_I420){ src[0]= srcParam[0]; src[1]= srcParam[2]; src[2]= srcParam[1];...
vuln
Vulnerable
C/C++
@app.route('/<short_url>') def reroute(short_url): conn = MySQLdb.connect(host , user , passwrd, db) cursor = conn.cursor() platform = request.user_agent.platform browser = request.user_agent.browser counter = 1 # Platform , Browser vars browser_dict = {'firefox': 0 , 'chrome':0 , 'safari':0 , 'other':0} p...
vuln
Safe
Python
# -*- 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
Vulnerable
Python
/* * Copyright (c) 2007 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this sou...
vuln
Safe
C/C++
static struct ldb_message *winsdb_message(struct ldb_context *ldb, struct winsdb_record *rec, TALLOC_CTX *mem_ctx) { int i, ret; size_t addr_count; const char *expire_time; struct ldb_message *msg = ldb_msg_new(mem_ctx); if (msg == NULL) goto failed; /* make sure we don't put in corrupted records *...
vuln
Vulnerable
Unknown
static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd) { int ret; ret = read_block(ctx, bd); if (ret) return ret; ret = decode_block(ctx, bd); return ret; }
vuln
Vulnerable
C/C++
void registerServer() { VersionAgnosticServerCommandManager.get().register( CommandManager.literal(Modget.NAMESPACE_SERVER) .then(CommandManager.literal(COMMAND) .requires(source -> source.hasPermissionLevel(PERMISSION_LEVEL)) .executes(context...
vuln
Safe
Java
private static Thread newThread(Runnable r, @Nullable String name, boolean daemon){ Thread thread = name == null ? new Thread(r) : new Thread(r, name); thread.setDaemon(daemon); thread.setUncaughtExceptionHandler((t, e) -> throwAppException(e)); return thread; }
vuln
Vulnerable
Java
var mxClient={VERSION:"20.3.0",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum...
vuln
Safe
JavaScript
static int resolveExprStep(Walker *pWalker, Expr *pExpr){ NameContext *pNC; Parse *pParse; pNC = pWalker->u.pNC; assert( pNC!=0 ); pParse = pNC->pParse; assert( pParse==pWalker->pParse ); #ifndef NDEBUG if( pNC->pSrcList && pNC->pSrcList->nAlloc>0 ){ SrcList *pSrcList = pNC->pSrcList; int i; ...
vuln
Safe
Unknown
int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode, unsigned int cmd, void __user *arg) { int ret; ret = scsi_verify_blk_ioctl(bd, cmd); if (ret < 0) return ret; return scsi_cmd_ioctl(bd->bd_disk->queue, bd->bd_disk, mode, cmd, arg); }
vuln
Safe
C/C++
void OfflineAudioDestinationHandler::NotifyComplete() { DCHECK(IsMainThread()); render_thread_.reset(); if (Context() && Context()->GetExecutionContext()) Context()->FireCompletionEvent(); }
vuln
Vulnerable
C/C++
bool Server::MatchViewOrStatic(const std::string& method, const std::string& url_path, bool* stream) { if (Router::MatchView(method, url_path, stream)) { return true; } // Try to match a static file. if (method == methods::kGet && !doc_root_.empty()) { fs::path sub_path =...
vuln
Safe
C/C++
function(p,C,I,T,P,O,R,Y,da,ha){if(null!=I&&null==mxMarker.markers[I]){var Z=this.getPackageForType(I);null!=Z&&mxStencilRegistry.getStencil(Z)}return U.apply(this,arguments)};var Q=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(p,C,I,T,P,O){"1"==mxUtils.getValue(C.style,"lineShape",null)&&p.setFi...
vuln
Vulnerable
JavaScript
function peg$parsepartial() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; peg$silentFails++; s0 = peg$currPos; s1 = peg$parseld(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s2 = peg$c26; peg$currPos++; } else { s2 = ...
vuln
Safe
JavaScript
int qemu_strtoll(const char *nptr, const char **endptr, int base, int64_t *result) { char *p; int err = 0; if (!nptr) { if (endptr) { *endptr = nptr; } err = -EINVAL; } else { errno = 0; *result = strtoll(nptr, &p, base); err =...
vuln
Safe
C/C++
BOOL license_read_scope_list(wStream* s, SCOPE_LIST* scopeList) { UINT32 i; UINT32 scopeCount; if (Stream_GetRemainingLength(s) < 4) return FALSE; Stream_Read_UINT32(s, scopeCount); /* ScopeCount (4 bytes) */ scopeList->count = scopeCount; scopeList->array = (LICENSE_BLOB*) malloc(sizeof(LICENSE_BLOB) * scop...
vuln
Vulnerable
Unknown
int tcp_test(const char* ip_str, const short port) { int sock, i; struct sockaddr_in s_in; int packetsize = 1024; unsigned char packet[packetsize]; struct timeval tv, tv2, tv3; int caplen = 0; int times[REQUESTS]; int min, avg, max, len; struct net_hdr nh; tv3.tv_sec=0; tv3....
vuln
Safe
Unknown
int jpc_ppxstab_grow(jpc_ppxstab_t *tab, int maxents) { jpc_ppxstabent_t **newents; if (tab->maxents < maxents) { newents = (tab->ents) ? jas_realloc(tab->ents, maxents * sizeof(jpc_ppxstabent_t *)) : jas_malloc(maxents * sizeof(jpc_ppxstabent_t *)); if (!newents) { return -1; } tab->ents = newents; ...
vuln
Vulnerable
Unknown
rs_filter_graph(RSFilter *filter) { g_return_if_fail(RS_IS_FILTER(filter)); GString *str = g_string_new("digraph G {\n"); rs_filter_graph_helper(str, filter); g_string_append_printf(str, "}\n"); g_file_set_contents("/tmp/rs-filter-graph", str->str, str->len, NULL); if (0 != system("dot -Tpng >/tmp/rs-filter-gr...
vuln
Vulnerable
C/C++
static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, size_t size) { int64_t len; if (!bdrv_is_inserted(bs)) return -ENOMEDIUM; if (bs->growable) return 0; len = bdrv_getlength(bs); if (offset < 0) if ((offset > len) || (len -...
vuln
Vulnerable
C/C++
/* * pcrypt - Parallel crypto wrapper. * * Copyright (C) 2009 secunet Security Networks AG * Copyright (C) 2009 Steffen Klassert <steffen.klassert@secunet.com> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * versio...
vuln
Safe
C/C++
static opj_bool pi_next_rpcl(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; long index = 0; if (!pi->first) { goto LABEL_SKIP; } else { int compno, resno; pi->first = 0; pi->dx = 0; pi->dy = 0; for (compno = 0; ...
vuln
Safe
C/C++
'use strict'; var util = require('util'), path = require('path'), shell = require('shelljs'), debug = require('debug')('dns-sync'); //source - http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address var ValidHostnameRegex = new RegExp("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-...
vuln
Vulnerable
JavaScript
static int pkey_GOST_ECcp_encrypt(EVP_PKEY_CTX *pctx, unsigned char *out, size_t *out_len, const unsigned char *key, size_t key_len) { GOST_KEY_TRANSPORT *gkt = NULL; EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(pctx); struct gost_pmeth_data *data = EVP_PKEY_...
vuln
Vulnerable
C/C++
private Map<String, String> getRequestHeaders(HttpExchange exchange) { Map<String, String> headers = new HashMap<>(); for (Map.Entry<String, List<String>> e : exchange.getResponseHeaders().entrySet()) { List<String> value = e.getValue(); headers.put(e.getKey(), new TextStringBuil...
vuln
Vulnerable
Java
inline gravity_value_t convert_value2float (gravity_vm *vm, gravity_value_t v) { if (VALUE_ISA_FLOAT(v)) return v; // handle conversion for basic classes if (VALUE_ISA_INT(v)) return VALUE_FROM_FLOAT((gravity_float_t)v.n); if (VALUE_ISA_BOOL(v)) return VALUE_FROM_FLOAT(v.n); if (VALUE_ISA_NULL(v)) return VALUE_F...
vuln
Safe
C/C++
@Override public void toBytes(FriendlyByteBuf buf) { buf.writeUtf(group, 16); }
vuln
Vulnerable
Java
int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, int is_write1, int mmu_idx) { X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; uint64_t ptep, pte; target_ulong pde_addr, pte_addr; int error_code = 0; int is_dirty, prot, page_size, is_write, is_user; ...
vuln
Vulnerable
C/C++
def cluster_stop(params, request, session) if params[:name] params_without_name = params.reject {|key, value| key == "name" or key == :name } code, response = send_request_with_token( session, params[:name], 'cluster_stop', true, params_without_name ) else if not allowed_for_local_cl...
vuln
Vulnerable
Ruby
void Document::DispatchUnloadEvents() { PluginScriptForbiddenScope forbid_plugin_destructor_scripting; if (parser_) parser_->StopParsing(); if (load_event_progress_ == kLoadEventNotRun) return; if (load_event_progress_ <= kUnloadEventInProgress) { Element* current_focused_element = FocusedElement(...
vuln
Safe
C/C++
struct dir_iterator *dir_iterator_begin(const char *path, unsigned int flags) { struct dir_iterator_int *iter = xcalloc(1, sizeof(*iter)); struct dir_iterator *dir_iterator = &iter->base; int saved_errno, err; strbuf_init(&iter->base.path, PATH_MAX); strbuf_addstr(&iter->base.path, path); ALLOC_GROW(iter->level...
vuln
Safe
C/C++
static int bdrv_qed_open(BlockDriverState *bs, int flags) { BDRVQEDState *s = bs->opaque; QEDHeader le_header; int64_t file_size; int ret; s->bs = bs; QSIMPLEQ_INIT(&s->allocating_write_reqs); ret = bdrv_pread(bs->file, 0, &le_header, sizeof(le_header)); if (ret < 0) { return ret...
vuln
Safe
C/C++
void Compute(OpKernelContext* context) override { const Tensor& splits = context->input(0); const Tensor& values = context->input(1); const Tensor& weights = context->input(2); bool use_weights = weights.NumElements() > 0; bool is_1d = false; if (use_weights) { OP_REQUIRES( cont...
vuln
Safe
Unknown
/* asn.c * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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 2 of the License, or * (at your option) a...
vuln
Safe
C/C++
static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); int version = 0; uint32_t tag = track->tag; if (track->mode == MODE_MOV) { if (track->timescale > UINT16_MAX) { if (mov_get_lpcm_flags(track->par->...
vuln
Vulnerable
C/C++
static int mov_write_mdia_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); ffio_wfourcc(pb, "mdia"); mov_write_mdhd_tag(pb, mov, track); mov_write_hdlr_tag(pb, track); mov_write_minf_tag(pb, track); retu...
vuln
Vulnerable
C/C++
MagickExport Image *DistortImage(const Image *image, DistortMethod method, const size_t number_arguments,const double *arguments, MagickBooleanType bestfit,ExceptionInfo *exception) { #define DistortImageTag "Distort/Image" double *coeff, output_scaling; Image *distort_image; RectangleInfo ...
vuln
Safe
Unknown
int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname, int lookup, struct fscrypt_name *fname) { int ret = 0, bigname = 0; memset(fname, 0, sizeof(struct fscrypt_name)); fname->usr_fname = iname; if (!dir->i_sb->s_cop->is_encrypted(dir) || fscrypt_is_dot_dotdot(iname)) { fname->dis...
vuln
Safe
Unknown
static int usb_hub_handle_data(USBDevice *dev, USBPacket *p) { USBHubState *s = (USBHubState *)dev; int ret; switch(p->pid) { case USB_TOKEN_IN: if (p->devep == 1) { USBHubPort *port; unsigned int status; uint8_t buf[4]; int i, n; n = (...
vuln
Safe
C/C++
def write_section(self, section_name, section_data): self.write_line("") self.write_line("define %s {" % section_name) sorted_keys = section_data.keys() sorted_keys.sort() for key in sorted_keys: value = self.value_to_icinga(section_data[key]) icinga_line ...
vuln
Safe
Python
void operator()(OpKernelContext* ctx, const CPUDevice& d, const T* rate_flat, int num_rate, int num_samples, const random::PhiloxRandom& rng, U* samples_flat) { // Two different algorithms are employed, depending on the size of // rate. // If rate < 10, we use an algorith...
vuln
Vulnerable
Unknown
public Seq<Fi> resolveDependencies(Seq<Fi> files){ ObjectMap<String, Fi> fileMapping = new ObjectMap<>(); ObjectMap<String, Seq<String>> dependencies = new ObjectMap<>(); for(Fi file : files){ ModMeta meta = null; try{ Fi zip = file.isDirectory() ? file ...
vuln
Safe
Java
static int vnc_update_client(VncState *vs, int has_dirty, bool sync) { if (vs->need_update && vs->csock != -1) { VncDisplay *vd = vs->vd; VncJob *job; int y; int width, height; int n = 0; if (vs->output.offset && !vs->audio_cap && !vs->force_update) ...
vuln
Safe
C/C++
// Image Transform Functions /* IIPImage image processing routines Copyright (C) 2004-2021 Ruven Pillay. 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 3 of the Lic...
vuln
Vulnerable
C/C++
static void l2tp_msgtype_print(netdissect_options *ndo, const u_char *dat, u_int length) { const uint16_t *ptr = (const uint16_t *)dat; if (length < 2) { ND_PRINT((ndo, "AVP too short")); return; } ND_PRINT((ndo, "%s", tok2str(l2tp_msgtype2str, "MSGTYPE-#%u", EXTRACT_16BITS(ptr)))); }
vuln
Safe
C/C++
@Override public SQLStatement preHandle(DumpFileContext context, String stmt) throws SQLSyntaxErrorException { String schema; stmt = stmt.replace("/*!", "/*#"); SQLStatement sqlStatement = DruidUtil.parseMultiSQL(stmt); if (sqlStatement instanceof SQLUseStatement) { SQLUs...
vuln
Vulnerable
Java
public static Principal getPrincipalForRefreshToken(String refreshToken) throws FrameworkException { final String jwtSecretType = Settings.JWTSecretType.getValue(); Jws<Claims> claims = null; switch (jwtSecretType) { default: case "secret": final String secret = Settings.JWTSecret.getValue(); cla...
vuln
Vulnerable
Java
def grid_data(self): """Returns grid data.""" dag_id = request.args.get("dag_id") dag = get_airflow_app().dag_bag.get_dag(dag_id) if not dag: return {"error": f"can't find dag {dag_id}"}, 404 root = request.args.get("root") if root: filter_upstre...
vuln
Safe
Python
function d(ja,U,J,V){function P(){U.removeChild(la);U.removeChild(ta);ia.style.display="block";R.style.display="block"}H={div:U,comment:ja,saveCallback:J,deleteOnCancel:V};var R=U.querySelector(".geCommentTxt"),ia=U.querySelector(".geCommentActionsList"),la=document.createElement("textarea"); la.className="geCommentEdi...
vuln
Vulnerable
JavaScript
static int qemu_rdma_broken_ipv6_kernel(Error **errp, struct ibv_context *verbs) { struct ibv_port_attr port_attr; #ifdef CONFIG_LINUX if (!verbs) { int num_devices, x; struct ibv_device ** dev_list = ibv_get_device_list(&num_devices); bool roce_found = false; bool ib_f...
vuln
Safe
C/C++
int ff_wma_init(AVCodecContext * avctx, int flags2) { WMACodecContext *s = avctx->priv_data; int i; float *window; float bps1, high_freq; volatile float bps; int sample_rate1; int coef_vlc_table; s->sample_rate = avctx->sample_rate; s->nb_channels = avctx->channels; s->bit_rate =...
vuln
Vulnerable
C/C++
static int img_amend(int argc, char **argv) { Error *err = NULL; int c, ret = 0; char *options = NULL; QemuOptsList *create_opts = NULL; QemuOpts *opts = NULL; const char *fmt = NULL, *filename, *cache; int flags; bool quiet = false, progress = false; BlockBackend *blk = NULL; Bl...
vuln
Safe
C/C++
void performMigration0To1() { String deviceIDType = storage.getDeviceIDType(); String deviceID = storage.getDeviceID(); //update the device ID type //noinspection StatementWithEmptyBody if (deviceIDType.equals(DeviceIdType.OPEN_UDID.toString())) { //current device ID...
vuln
Vulnerable
Java
private void preventSelfClipping() { boolean clipped = false; int runs = 0; do { clipped = false; // check the cape parts against each other. Bad implementation for (int a = 0; a < points.size(); a++) { for(int b = a + 1; b < points.size(); b++...
vuln
Safe
Java
// Homer-App // // Homer-App User interface for WEB AI // // Schemes: http, https // Host: localhost:9080 // BasePath: /api/v3 // Version: 1.1.2 // License: AGPL https://www.gnu.org/licenses/agpl-3.0.en.html // Copyright: QXIP B.V. 2019-2020 // // Consumes: // - application/json // // ...
vuln
Safe
Go
package com.bezman.servlet; import org.apache.commons.lang.StringEscapeUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframe...
vuln
Vulnerable
Java
/* * Copyright 2015, Red Hat, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
vuln
Vulnerable
C/C++
void ScriptLoader::executeScript(const ScriptSourceCode& sourceCode) { ASSERT(m_alreadyStarted); if (sourceCode.isEmpty()) return; RefPtr<Document> elementDocument(m_element->document()); RefPtr<Document> contextDocument = elementDocument->contextDocument().get(); if (!contextDocument) ...
vuln
Safe
C/C++
void testHeaderNameNormalization() { final HttpHeadersBase headers = newHttp2Headers(); headers.add("Foo", "bar"); assertThat(headers.getAll("foo")).containsExactly("bar"); assertThat(headers.getAll("fOO")).containsExactly("bar"); assertThat(headers.names()).contains(HttpHeaderNa...
vuln
Safe
Java
static int frame_thread_init(AVCodecContext *avctx) { int thread_count = avctx->thread_count; AVCodec *codec = avctx->codec; AVCodecContext *src = avctx; FrameThreadContext *fctx; int i, err = 0; if (thread_count <= 1) { avctx->active_thread_type = 0; return 0; } avctx->t...
vuln
Vulnerable
C/C++
public void ping() throws ServiceException { try { final HttpGet httpGet = new HttpGet(grobidPath + "/isalive"); final Future<HttpResponse> futureResponse = httpClient.execute(httpGet, null); HttpResponse response = futureResponse.get(); if (response.getStatusLine...
vuln
Vulnerable
Java
html: function (token, attrs, content) { var size = $.inArray(attrs.defaultattr, mybbCmd.fsStr) + 1; if (!isNaN(attrs.defaultattr)) { size = attrs.defaultattr; if (size > 7) size = 7; if (size < 1) size = 1; } if (size < 0) { size = 0; } return '<font data-scefontsize="' + $....
vuln
Safe
JavaScript
TEE_Result crypto_acipher_alloc_dh_keypair(struct dh_keypair *s, size_t key_size_bits) { memset(s, 0, sizeof(*s)); s->g = crypto_bignum_allocate(key_size_bits); if (!s->g) goto err; s->p = crypto_bignum_allocate(key_size_bits); if (!s->p) goto err; s->y = crypto_bignum_allocate(key_size_bits); if (!s...
vuln
Vulnerable
C/C++
void SSL_CTX_free(SSL_CTX *a) { int i; if (a == NULL) return; i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_SSL_CTX); #ifdef REF_PRINT REF_PRINT("SSL_CTX",a); #endif if (i > 0) return; #ifdef REF_CHECK if (i < 0) { fprintf(stderr,"SSL_CTX_free, bad reference count\n"); abort(); /* ok */ } #endif if (a->...
vuln
Vulnerable
Unknown
public boolean isContactPresent(String contactNumber, Contact.ContactType contactType) { Cursor cursor = null; try { SQLiteDatabase db = dbHelper.getReadableDatabase(); String sql = "SELECT COUNT(*) FROM contact where " + MobiComDatabaseHelper.CONTACT_NO + " = ? AND " + MobiCom...
vuln
Safe
Java
const bootbox = require('bootbox'); require('../services/Requisitions'); const RequisitionNode = require('../model/RequisitionNode'); const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (functi...
vuln
Safe
Java
export function loadFromGitSync(input: Input): string | never { try { return execSync(createCommand(input), { encoding: 'utf-8' }); } catch (error) { throw createLoadError(error); } }
vuln
Vulnerable
JavaScript