code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
skip_short_body (int fd, wgint contlen, bool chunked) { enum { SKIP_SIZE = 512, /* size of the download buffer */ SKIP_THRESHOLD = 4096 /* the largest size we read */ }; wgint remaining_chunk_size = 0; char dlbuf[SKIP_SIZE + 1]; dlbuf[SKIP_SIZE] = '\0'; /* so DEBUGP can sa...
vuln
Safe
Unknown
function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) { // List of special chars for filenames in windows are defined on page https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file // Char '>' '<' '|' '$' and ';' are special chars for shells. // Char '/' and '\' are file delimiters. // -- c...
vuln
Safe
PHP
icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *bp2, int fragmented) { char *cp; const struct icmp *dp; const struct icmp_ext_t *ext_dp; const struct ip *ip; const char *str, *fmt; const struct ip *oip; const struct udphdr *ouh; const uint8_t *obj_tptr; ...
vuln
Safe
C/C++
void safe_connect(MYSQL* mysql, const char *name, const char *host, const char *user, const char *pass, const char *db, int port, const char *sock) { int failed_attempts= 0; DBUG_ENTER("safe_connect"); verbose_msg("Connecting to server %s:%d (socket %s) as '%s'" ...
vuln
Vulnerable
Unknown
static PyObject *__pyx_pf_17clickhouse_driver_6varint_write_varint(CYTHON_UNUSED PyObject *__pyx_self, unsigned PY_LONG_LONG __pyx_v_number, PyObject *__pyx_v_buf) { unsigned char __pyx_v_to_write; unsigned char __pyx_v_i; unsigned char __pyx_v_num_buf[32]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations...
vuln
Safe
C/C++
int ssl3_get_client_key_exchange(SSL *s) { int i, al, ok; long n; unsigned long alg_k; unsigned char *p; #ifndef OPENSSL_NO_RSA RSA *rsa = NULL; EVP_PKEY *pkey = NULL; #endif #ifndef OPENSSL_NO_DH BIGNUM *pub = NULL; DH *dh_srvr, *dh_clnt = NULL; #endif #ifndef OPENSSL_NO_KRB5 KSSL_E...
vuln
Vulnerable
Unknown
private boolean updateProfilePictureAndName(Profile authUser, User u) { boolean update = false; if (!StringUtils.equals(u.getPicture(), authUser.getPicture()) && !gravatarAvatarGenerator.isLink(authUser.getPicture()) && !CONF.avatarEditsEnabled()) { authUser.setPicture(u.getPicture()); update = true; ...
vuln
Vulnerable
Java
rleUncompress (int inLength, int maxLength, const signed char in[], char out[]) { char *outStart = out; while (inLength > 0) { if (*in < 0) { int count = -((int)*in++); inLength -= count + 1; if (0 > (maxLength -= count)) return 0; // check the input buffer is big enough to con...
vuln
Safe
C/C++
static uint64_t do_cvttq(CPUAlphaState *env, uint64_t a, int roundmode) { uint64_t frac, ret = 0; uint32_t exp, sign, exc = 0; int shift; sign = (a >> 63); exp = (uint32_t)(a >> 52) & 0x7ff; frac = a & 0xfffffffffffffull; if (exp == 0) { if (unlikely(frac != 0) && !env->fp_status.flu...
vuln
Safe
C/C++
static int encode_residual_ch(FlacEncodeContext *s, int ch) { int i, n; int min_order, max_order, opt_order, omethod; FlacFrame *frame; FlacSubframe *sub; int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER]; int shift[MAX_LPC_ORDER]; int32_t *res, *smp; frame = &s->frame; sub = &frame->sub...
vuln
Vulnerable
C/C++
static int btrfs_clone(struct inode *src, struct inode *inode, const u64 off, const u64 olen, const u64 olen_aligned, const u64 destoff, int no_time_update) { struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_path *path = NULL; struct extent_buffer *leaf; struct btrfs_trans_handle *tran...
vuln
Vulnerable
Unknown
static int calipso_doi_remove(u32 doi, struct netlbl_audit *audit_info) { int ret_val; struct calipso_doi *doi_def; struct audit_buffer *audit_buf; spin_lock(&calipso_doi_list_lock); doi_def = calipso_doi_search(doi); if (!doi_def) { spin_unlock(&calipso_doi_list_lock); ret_val = -ENOENT; goto doi_remove_r...
vuln
Safe
Unknown
issuerAndThisUpdateCheck( struct berval *in, struct berval *is, struct berval *tu, void *ctx ) { int numdquotes = 0; struct berval x = *in; struct berval ni = BER_BVNULL; /* Parse GSER format */ enum { HAVE_NONE = 0x0, HAVE_ISSUER = 0x1, HAVE_THISUPDATE = 0x2, HAVE_ALL = ( HAVE_ISSUER | HAVE_THISUPDAT...
vuln
Vulnerable
C/C++
static apr_status_t unschedule_slow_tasks(h2_mplx *m) { h2_stream *stream; int n; /* Try to get rid of streams that occupy workers. Look for safe requests * that are repeatable. If none found, fail the connection. */ n = (m->tasks_active - m->limit_active - (int)h2_ihash_count(m->sredo))...
vuln
Vulnerable
Unknown
@Override public void run() { var kafkaPlugin = new VulnerabilityStatementsProcessor.VulnerabilityStatementsKafkaPlugin(); try { var contexts = new HashMap<String, DSLContext>(); for(var forge : dbUrls.keySet()) { contexts.put(forge, Postgr...
vuln
Safe
Java
private function __simple_query($cmd) { if (!empty($this->__setup['resources'])) { if (is_array($this->__setup['resources'])) { foreach ($this->__setup['resources'] as $resource) { $cmd .= " '" . $resource . "'"; } } else { ...
vuln
Vulnerable
PHP
@Override boolean verify(char[] guess, Charset hashCharset) throws InvalidKeyException { if (guess.length == 0) return false; try { byte[] output = scramDigest(this.getAlgorithm(), getNormalizedPasswordBytes(guess, hashCharset), this.getSalt(), this.getIterationCount()); retu...
vuln
Vulnerable
Java
int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, struct qstr *src_name, struct inode *dst_dir, struct qstr *dst_name) { struct super_block *sb = src_dir->i_sb; struct hfs_find_data src_fd, dst_fd; hfsplus_cat_entry entry; int entry_size, type; int err; dprint(DBG_CAT_MOD, "rename_cat: %u...
vuln
Safe
C/C++
void onAodInterrupt(int screenX, int screenY, float major, float minor) { if (mIsAodInterruptActive) { return; } if (!mKeyguardUpdateMonitor.isFingerprintDetectionRunning()) { if (mFalsingManager.isFalseTouch(LOCK_ICON)) { Log.v(TAG, "aod lock icon long-p...
vuln
Vulnerable
Java
TfLiteStatus ExpandTensorDim(TfLiteContext* context, const TfLiteTensor& input, int axis, TfLiteTensor* output) { const TfLiteIntArray& input_dims = *input.dims; if (axis < 0) { axis = input_dims.size + 1 + axis; } TF_LITE_ENSURE(context, axis <= input_dims.size); TfLiteIntAr...
vuln
Vulnerable
C/C++
@Override public Future<Boolean> isConnectionDurationLimitReached( final TenantObject tenant, final SpanContext spanContext) { Objects.requireNonNull(tenant); final var span = TracingHelper.buildChildSpan(tracer, spanContext, "verify connection duration limit", getClass().g...
vuln
Safe
Java
unsigned long _copy_from_user(void *to, const void __user *from, unsigned long n) { unsigned long res = n; might_fault(); if (!should_fail_usercopy() && likely(access_ok(from, n))) { instrument_copy_from_user_before(to, from, n); res = raw_copy_from_user(to, from, n); instrument_copy_from_user_after(to, from, ...
vuln
Vulnerable
C/C++
int PrintPreviewUI::GetAvailableDraftPageCount() { return print_preview_data_service()->GetAvailableDraftPageCount( preview_ui_addr_str_); }
vuln
Vulnerable
C/C++
prepare_repo_download_targets(LrHandle *handle, LrYumRepo *repo, LrYumRepoMd *repomd, LrMetadataTarget *mdtarget, GSList **targets, GSList **cbdata_list, ...
vuln
Vulnerable
C/C++
public static Bitmap getVideoThumbnail(Context context, Uri uri) throws IllegalArgumentException, SecurityException{ try { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); if (uri == null) { return null; } retriever.setDataSource(context, uri); return retriever.getFrameAtTime()...
vuln
Safe
Java
var Utils = require("./util"); var fs = Utils.FileSystem.require(), pth = require("path"); fs.existsSync = fs.existsSync || pth.existsSync; var ZipEntry = require("./zipEntry"), ZipFile = require("./zipFile"); var isWin = /^win/.test(process.platform); module.exports = function(/*String*/input) { var ...
vuln
Safe
JavaScript
static uint32_t softfloat_mul(uint32_t x, uint64_t mantissa) { uint64_t l = x * (mantissa & 0xffffffff); uint64_t h = x * (mantissa >> 32); h += l >> 32; l &= 0xffffffff; l += 1 << av_log2(h >> 21); h += l >> 32; return h >> 20; }
vuln
Vulnerable
C/C++
static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) { HEVCLocalContext *lc = s->HEVClc; GetBitContext *gb = &lc->gb; int ctb_addr_ts, ret; *gb = nal->gb; s->nal_unit_type = nal->type; s->temporal_id = nal->temporal_id; switch (s->nal_unit_type) { case HEVC...
vuln
Vulnerable
Unknown
def get_signature_status(signable, role=None, repository_name='default', threshold=None, keyids=None): """ <Purpose> Return a dictionary representing the status of the signatures listed in 'signable'. Signatures in the returned dictionary are identified by the signature keyid and can have a status o...
vuln
Safe
Python
public static int handleCall(ServerCommandSource source, CarpetScriptHost host, Supplier<Value> call) { try { CarpetProfiler.ProfilerToken currentSection = CarpetProfiler.start_section(null, "Scarpet run", CarpetProfiler.TYPE.GENERAL); host.setChatErrorSnooper(source); ...
vuln
Safe
Java
void receive_tcppacket(connection_t *c, const char *buffer, int len) { vpn_packet_t outpkt; outpkt.len = len; if(c->options & OPTION_TCPONLY) outpkt.priority = 0; else outpkt.priority = -1; memcpy(outpkt.data, buffer, len); receive_packet(c->node, &outpkt); }
vuln
Vulnerable
C/C++
static int zpff_init(struct hid_device *hid) { struct zpff_device *zpff; struct hid_report *report; struct hid_input *hidinput; struct input_dev *dev; int i, error; if (list_empty(&hid->inputs)) { hid_err(hid, "no inputs found\n"); return -ENODEV; } hidinput = list_entry(hid->inputs.next, struct hid_input,...
vuln
Safe
C/C++
static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC) { char *line; mime_header_entry prev_entry = {0}, entry; int prev_len, cur_len; /* didn't find boundary, abort */ if (!find_boundary(self, self->boundary TSRMLS_CC)) { return 0; } /* get lines of text, or CRLF_CRLF */ ...
vuln
Vulnerable
C/C++
static uint32_t find_subframe_rice_params(FlacEncodeContext *s, FlacSubframe *sub, int pred_order) { int pmin = get_max_p_order(s->options.min_partition_order, s->frame.blocksize, pred_order); int pmax = get_max_p_order(s->options.max_part...
vuln
Vulnerable
C/C++
void helper_set_alarm(CPUAlphaState *env, uint64_t expire) { AlphaCPU *cpu = alpha_env_get_cpu(env); if (expire) { env->alarm_expire = expire; qemu_mod_timer(cpu->alarm_timer, expire); } else { qemu_del_timer(cpu->alarm_timer); } }
vuln
Safe
C/C++
static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias) { int i, shnum, nsyms, sym_idx = 0, str_idx = 0; struct elf_shdr *shdr; char *strings = NULL; struct syminfo *s = NULL; struct elf_sym *new_syms, *syms = NULL; shnum = hdr->e_shnum; i = shnum * sizeof(struct elf_shdr);...
vuln
Vulnerable
C/C++
bool DataReductionProxyConfig::IsFetchInFlight() const { DCHECK(thread_checker_.CalledOnValidThread()); return warmup_url_fetcher_->IsFetchInFlight(); }
vuln
Vulnerable
C/C++
ipv6_sanity_check(const struct ovs_16aligned_ip6_hdr *nh, size_t size) { uint16_t plen; if (OVS_UNLIKELY(size < sizeof *nh)) { return false; } plen = ntohs(nh->ip6_plen); if (OVS_UNLIKELY(plen + IPV6_HEADER_LEN > size)) { return false; } if (OVS_UNLIKELY(size - (plen + IPV...
vuln
Safe
Unknown
static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){ int y = cs->y; int mirror0 = mirror(y - 1, height - 1); int mirror1 = mirror(y + 0, height - 1); int mirror2 = mirror(y + 1, height - 1); int mirror3 = mirror(y + 2, height - 1);...
vuln
Safe
C/C++
static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp) { int idx = 0; BlockBackend *new_blk = NULL; Error *local_err = NULL; char *desc = NULL; int64_t total_size = 0, filesize; char *adapter_type = NULL; char *backing_file = NULL; char *hw_version = NULL; char *f...
vuln
Vulnerable
C/C++
Prism.languages.eiffel = { 'comment': /--.*/, 'string': [ // Aligned-verbatim-strings { pattern: /"([^[]*)\[[\s\S]*?\]\1"/, greedy: true }, // Non-aligned-verbatim-strings { pattern: /"([^{]*)\{[\s\S]*?\}\1"/, greedy: true }, // Single-line string { pattern: /"(?:%\s*\n\s*%|%.|[^%"\r\n]...
vuln
Vulnerable
JavaScript
@Subscribe public void onGameTick(GameTick event) { if (inRegion(13122, 12613)) { inNylo = true; partySize = 0; for (int i = 330; i < 335; i++) { if (client.getVarcStrValue(i) != null && !client.getVarcStrValue(i).equals("")) { partySize++; } } for (NyloQ q : nylos) { if...
vuln
Safe
Java
static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp) { uint8_t* config = qxl->pci.config; uint32_t pci_device_rev; uint32_t io_size; qxl->mode = QXL_MODE_UNDEFINED; qxl->generation = 1; qxl->num_memslots = NUM_MEMSLOTS; qemu_mutex_init(&qxl->track_lock); qemu_mutex_init(&qxl->...
vuln
Safe
C/C++
static int init_ssl_connection(SSL *con) { int i; const char *str; X509 *peer; long verify_err; char buf[BUFSIZ]; #if !defined(OPENSSL_NO_NEXTPROTONEG) const unsigned char *next_proto_neg; unsigned next_proto_neg_len; #endif unsigned char *exportedkeymat; #ifndef OPENSSL_NO_DTLS if(...
vuln
Vulnerable
Unknown
public function setRemoteUrl($name, $url, array $params = NULL) { $this->run('remote', 'set-url', $params, $name, $url); return $this; }
vuln
Vulnerable
PHP
av_cold int ff_rv34_decode_init(AVCodecContext *avctx) { RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; int ret; ff_MPV_decode_defaults(s); s->avctx = avctx; s->out_format = FMT_H263; s->codec_id = avctx->codec_id; s->width = avctx->width; s->height = avctx-...
vuln
Safe
C/C++
import codecs import errno import gzip import os import posixpath import shutil import sys import tarfile import tempfile import stat import urllib.parse import urllib.request from urllib.parse import unquote from urllib.request import pathname2url import yaml try: from yaml import CSafeLoader as YamlSafeLoader,...
vuln
Safe
Python
@Override public void setLivingAnimations(Rhino rhino, Integer uniqueID, @Nullable AnimationEvent customPredicate) { super.setLivingAnimations(rhino, uniqueID, customPredicate); if (customPredicate == null) return; List<EntityModelData> extraDataOfType = customPredicate.getExtraDataOfType(...
vuln
Vulnerable
Java
fmgr_sql_validator(PG_FUNCTION_ARGS) { Oid funcoid = PG_GETARG_OID(0); HeapTuple tuple; Form_pg_proc proc; List *raw_parsetree_list; List *querytree_list; ListCell *lc; bool isnull; Datum tmp; char *prosrc; parse_error_callback_arg callback_arg; ErrorContextCallback sqlerrcontext; bool haspo...
vuln
Vulnerable
Unknown
LazyBackgroundPageNativeHandler::LazyBackgroundPageNativeHandler( ScriptContext* context) : ObjectBackedNativeHandler(context) { RouteFunction( "IncrementKeepaliveCount", "tts", base::Bind(&LazyBackgroundPageNativeHandler::IncrementKeepaliveCount, base::Unretained(this))); ...
vuln
Safe
C/C++
get_function_line( exarg_T *eap, char_u **line_to_free, int indent, getline_opt_T getline_options) { char_u *theline; if (eap->getline == NULL) theline = getcmdline(':', 0L, indent, 0); else theline = eap->getline(':', eap->cookie, indent, getline_options); if (theline != NULL) { if (*eap...
vuln
Vulnerable
C/C++
QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func, void *opaque, int absolute, const char *name) { QEMUPutMouseEntry *s; s = g_new0(QEMUPutMouseEntry, 1); s->qemu_put_mouse_event = func; ...
vuln
Safe
C/C++
SchedulerObject::hold(std::string key, std::string &reason, std::string &text) { PROC_ID id = getProcByString(key.c_str()); if (id.cluster < 0 || id.proc < 0) { dprintf(D_FULLDEBUG, "Hold: Failed to parse id: %s\n", key.c_str()); text = "Invalid Id"; retur...
vuln
Vulnerable
C/C++
static inline int can_merge(struct ext4_system_zone *entry1, struct ext4_system_zone *entry2) { if ((entry1->start_blk + entry1->count) == entry2->start_blk && entry1->ino == entry2->ino) return 1; return 0; }
vuln
Safe
Unknown
static PCRE2_SPTR SLJIT_FUNC do_extuni_no_utf(jit_arguments *args, PCRE2_SPTR cc) { PCRE2_SPTR start_subject = args->begin; PCRE2_SPTR end_subject = args->end; int lgb, rgb, ricount; PCRE2_SPTR bptr; uint32_t c; c = *cc++; lgb = UCD_GRAPHBREAK(c); while (cc < end_subject) { c = *cc; rgb = UCD_GRAPHBREAK(c); ...
vuln
Safe
Unknown
import logging import zipfile import base64 import shutil import time from tarfile import TarFile from bz2 import BZ2File from gzip import GzipFile from lzma import LZMAFile from io import BytesIO from pathlib import Path from typing import List, Optional, Union, Tuple, Sequence, Dict, overload, Literal from dfvfs.an...
vuln
Safe
Python
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) { if (sMessage.Equals("DCC ", false, 4) && m_pUser->IsUserAttached()) { // DCC CHAT chat 2453612361 44592 CString sType = sMessage.Token(1); CString sFile = sMessage.Token(2); unsigned long uLongIP = sMessage.Token(3).ToULong(); unsigned short ...
vuln
Safe
C/C++
/** * FreeRDP: A Remote Desktop Protocol Implementation * Input Virtual Channel Extension * * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2015 Thincast Technologies GmbH * Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com> * * Licensed under the Apache Licens...
vuln
Vulnerable
C/C++
dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) { DTLS1_RECORD_DATA *rdata; pitem *item; /* Limit the size of the queue to prevent DOS attacks */ if (pqueue_size(queue->q) >= 100) return 0; rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA)); item = pitem_new(priority, rdata); if ...
vuln
Vulnerable
C/C++
private void uploadTexture(int x, int y, int width, int height) { /* Load imageBuffer with pixel data ready for transfer to OpenGL texture */ updateImageBuffer(x, y, width, height); GlStateManager._bindTexture(textureName); /* Due to changes in 1.14+, so this ensures pixels are correct...
vuln
Vulnerable
Java
print_lcp_config_options(netdissect_options *ndo, const u_char *p, int length) { int len, opt; if (length < 2) return 0; ND_TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { if ((opt >= LCPOPT_MIN) && (opt <= LCPOPT_MAX)) ND_PRINT((ndo, "\n\t %...
vuln
Vulnerable
C/C++
httpLocalRequest(ObjectPtr object, int method, int from, int to, HTTPRequestPtr requestor, void *closure) { if(object->requestor == NULL) object->requestor = requestor; if(!disableLocalInterface && urlIsSpecial(object->key, object->key_size)) return httpSpecialRequest(object, m...
vuln
Safe
Unknown
var INTERPOLATE = /{([^{]+?)}/g module.exports = function(str, data) { var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' + 'with(obj||{}){__p.push(\'' + str.replace(/\\/g, '\\\\') .replace(/'/g, "\\'") .replace(INTERPOLATE, function(match, code) { return "'," + ...
vuln
Safe
JavaScript
void udisks_log (UDisksLogLevel level, const gchar *function, const gchar *location, const gchar *format, ...) { va_list var_args; gchar *message; va_start (var_args, format); message = g_strdup_vprintf (format, var_args); va_end (var_args...
vuln
Safe
C/C++
public static StreamConnection readHttpInputStream(String urlAddress, Map<String, Object> headers, String payload) throws IOException { ApocConfig.apocConfig().checkReadAllowed(urlAddress); URLConnection con = openUrlConnection(urlAddress, headers); writePayload(con, payload); String new...
vuln
Safe
Java
selectionchange: function(rowModel, selected, eOpts ) { if (selected.length > 0) { var record = selected[0]; var groupId = record.data.id; var groupName = Ext.util.Format.htmlEncode(record.data.name); th...
vuln
Safe
JavaScript
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
vuln
Safe
C/C++
AppControllerImpl::AppControllerImpl(Profile* profile) //// static : profile_(profile), app_service_proxy_(apps::AppServiceProxy::Get(profile)), url_prefix_(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( chromeos::switches::kKioskNextHomeUrlPrefix)) { app_service_proxy_->A...
vuln
Vulnerable
C/C++
void Compute(OpKernelContext* context) override { const Tensor& input = context->input(0); const Tensor& filter_sizes = context->input(1); const Tensor& out_backprop = context->input(2); OP_REQUIRES( context, TensorShapeUtils::IsVector(filter_sizes.shape()), errors::InvalidArgument( ...
vuln
Safe
Unknown
DwaCompressor::uncompress (const char *inPtr, int inSize, int minY, const char *&outPtr) { return uncompress (inPtr, inSize, IMATH_NAMESPACE::Box2i (IMATH_NAMESPACE::V2i (_min[0], minY), IMATH_NAMESPACE::V2i (_max[0], minY + num...
vuln
Safe
Unknown
static MagickBooleanType IsWEBPImageLossless(const unsigned char *stream, const size_t length) { #define VP8_CHUNK_INDEX 15 #define LOSSLESS_FLAG 'L' #define EXTENDED_HEADER 'X' #define VP8_CHUNK_HEADER "VP8" #define VP8_CHUNK_HEADER_SIZE 3 #define RIFF_HEADER_SIZE 12 #define VP8X_CHUNK_SIZE 10 #define TAG_SIZ...
vuln
Vulnerable
Unknown
static void simple_decode_row(x3f_info_t *I, x3f_directory_entry_t *DE, int bits, int row, int row_stride) { x3f_directory_entry_header_t *DEH = &DE->header; x3f_image_data_t *ID = &DEH->data_subsection.image_data; x3f_huffman_t *HUF = ID->huffman; if (row*row_stride > ID->data_si...
vuln
Safe
Unknown
def _get_curr_info(cls, package): cmd = compose_cmd(['dpkg', '-s', package]) return cls.run_shell_command(cmd)
vuln
Vulnerable
Python
static CURLcode hsts_create(struct hsts *h, const char *hostname, bool subdomains, curl_off_t expires) { struct stsentry *sts = hsts_entry(); char *duphost; size_t hlen; if(!sts) return CURLE_OUT_OF_MEMORY; duphost = strd...
vuln
Safe
Unknown
static int load_data(AVFilterContext *ctx, int azim, int elev, float radius) { struct SOFAlizerContext *s = ctx->priv; const int n_samples = s->sofa.n_samples; int n_conv = s->n_conv; int n_fft = s->n_fft; int delay_l[16]; int delay_r[16]; int nb_input_channels = ctx->inputs[0]->channels; ...
vuln
Safe
C/C++
static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer) { struct buffer_page *reader = cpu_buffer->reader_page; struct buffer_page *head = rb_set_head_page(cpu_buffer); struct buffer_page *commit = cpu_buffer->commit_page; /* In case of error, head will be NULL */ if (unlikely(!head)) return true; ...
vuln
Vulnerable
Unknown
@Nullable @Override public BlockState setBlockState(BlockPos pos, BlockState state, boolean moved) { return this.cubeWorldGenRegion.getCube(pos).setBlockState(pos, state, moved); }
vuln
Vulnerable
Java
import logging import yaml import requests from redash import settings from redash.query_runner import * from redash.utils import json_dumps logger = logging.getLogger(__name__) try: import pandas as pd import xlrd import openpyxl import numpy as np enabled = True except ImportError: enabled ...
vuln
Vulnerable
Python
static void update_blocked_averages(int cpu) { struct rq *rq = cpu_rq(cpu); struct cfs_rq *cfs_rq, *pos; const struct sched_class *curr_class; struct rq_flags rf; bool done = true; rq_lock_irqsave(rq, &rf); update_rq_clock(rq); /* * Iterates the task_group tree in a bottom up fashion, see * list_ad...
vuln
Vulnerable
C/C++
OM_uint32 KRB5_CALLCONV gss_process_context_token (minor_status, context_handle, token_buffer) OM_uint32 * minor_status; gss_ctx_id_t context_handle; gss_buffer_t token_buffer; { OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism mech; if...
vuln
Vulnerable
C/C++
package converter import ( "bytes" "github.com/asaskevich/govalidator" "github.com/microcosm-cc/bluemonday" "github.com/segmentfault/pacman/log" "github.com/yuin/goldmark" "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/extension" "github.com/yuin/goldmark/parser" "github.com/yuin/goldmark/renderer"...
vuln
Vulnerable
Go
def authorized?(request) origin_host = request.get_header("HTTP_HOST") forwarded_host = request.x_forwarded_host&.split(/,\s?/)&.last @permissions.allows?(origin_host) && (forwarded_host.blank? || @permissions.allows?(forwarded_host)) end
vuln
Safe
Ruby
public static void typeAppend(WebDriver driver, By elementLocator, String text) { if (identifyUniqueElement(driver, elementLocator) && (text != null)) { driver.findElement(elementLocator).sendKeys(text); passAction(driver, elementLocator, text); } else { ...
vuln
Vulnerable
Java
def drop_all(self): # Release opened sessions. self.on_end_resource() # Drop all base = self.get_base() base.metadata.drop_all() self.get_session().commit()
vuln
Safe
Python
void bootp_input(struct mbuf *m) { struct bootp_t *bp = mtod_check(m, sizeof(struct bootp_t)); if (bp && bp->bp_op == BOOTP_REQUEST) { bootp_reply(m->slirp, bp, m_end(m)); } }
vuln
Safe
Unknown
'use strict'; // @ts-check // ================================================================================== // internet.js // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js // Copyright: (c) 2014 - ...
vuln
Vulnerable
JavaScript
@Override public ResponseEntity<String> getTransitiveVulnerabilities(String package_name, String version) { // TODO: move this to the plugin's arguments. var baseDir = "/mnt/fasten/vuln-paths-cache"; var split = package_name.split(Constants.mvnCoordinateSeparator); var firstLetter =...
vuln
Vulnerable
Java
static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_op_array *new_op_array=NULL; int return_value_used; zval *inc_filename = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); zval tmp_inc_filename; zend_bool failure_retval=0; i...
vuln
Vulnerable
Unknown
static unsigned long mmap_rnd(void) { unsigned long rnd = 0; if (current->flags & PF_RANDOMIZE) rnd = (long)get_random_int() & (STACK_RND_MASK >> 1); return rnd << (PAGE_SHIFT + 1); }
vuln
Vulnerable
Unknown
static int local_renameat(FsContext *ctx, V9fsPath *olddir, const char *old_name, V9fsPath *newdir, const char *new_name) { int ret; int odirfd, ndirfd; if (ctx->export_flags & V9FS_SM_MAPPED_FILE && (local_is_mapped_file_metadata(ctx, old_name) |...
vuln
Safe
Unknown
public BigInteger calculateAgreement( CipherParameters pubKey) { DHPublicKeyParameters pub = (DHPublicKeyParameters)pubKey; if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } ...
vuln
Vulnerable
Java
const log = require('../services/log'); const fileUploadService = require('./api/files'); const scriptService = require('../services/script'); const cls = require('../services/cls'); const sql = require("../services/sql"); const becca = require("../becca/becca"); function handleRequest(req, res) { // express puts ...
vuln
Safe
JavaScript
@Override public void authorizeIndexAction( RequestInfo requestInfo, AuthorizationInfo authorizationInfo, AsyncSupplier<ResolvedIndices> indicesAsyncSupplier, Map<String, IndexAbstraction> aliasOrIndexLookup, ActionListener<IndexAuthorizationResult> listener ) { f...
vuln
Vulnerable
Java
function write_cache() { global $cms_db, $cfg_cms; $action = 'insert'; if ( $this->cache_mode == 'DB_TEST_CACHE' ) { if ( count( $this->cache_test ) >= $this->cache_test_value ) { $this->cache = $this->cache_test; $this->cache_test = array(); ...
vuln
Vulnerable
PHP
static void sched_feat_enable(int i) { static_key_enable_cpuslocked(&sched_feat_keys[i]); }
vuln
Safe
C/C++
boolean getRunningBrokers(Properties connectionProperties ) { boolean found = false; try (AdminClient adminClient = KafkaAdminClient.create(connectionProperties)) { DescribeClusterResult describeClusterResult = adminClient.describeCluster(); Collecti...
vuln
Vulnerable
Java
static MagickBooleanType SkipDXTMipmaps(Image *image,DDSInfo *dds_info, int texel_size,ExceptionInfo *exception) { MagickOffsetType offset; register ssize_t i; size_t h, w; /* Only skip mipmaps for textures and cube maps */ if (EOFBlob(image) != MagickFalse) { ThrowFileE...
vuln
Safe
C/C++
@Override public void onResolve(HitResult rayTraceResult, Level world, @Nullable LivingEntity shooter, SpellStats spellStats, SpellContext spellContext, SpellResolver resolver) { if (!canSummon(shooter)) return; Vec3 vector3d = safelyGetHitPos(rayTraceResult); int ticks = (int) ...
vuln
Safe
Java
int n_ssl3_mac(SSL *ssl, unsigned char *md, int send) { SSL3_RECORD *rec; unsigned char *mac_sec,*seq; EVP_MD_CTX md_ctx; const EVP_MD_CTX *hash; unsigned char *p,rec_char; unsigned int md_size; int npad; int t; if (send) { rec= &(ssl->s3->wrec); mac_sec= &(ssl->s3->write_mac_secret[0]); seq= &(ssl->...
vuln
Vulnerable
Unknown
static int h264_field_start(H264Context *h, const H264SliceContext *sl, const H2645NAL *nal, int first_slice) { int i; const SPS *sps; int last_pic_structure, last_pic_droppable, ret; ret = h264_init_ps(h, sl, first_slice); if (ret < 0) return ret; sps = h->ps...
vuln
Vulnerable
C/C++