code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
void read_authfile(const char *path) { size_t n; FILE *fp; char token[MAXAUTHTOKENLEN]; if ((amqp_username = malloc(MAXAUTHTOKENLEN)) == NULL || (amqp_password = malloc(MAXAUTHTOKENLEN)) == NULL) { die("Out of memory"); } else if ((fp = fopen(path, "r")) == NULL) { die("Could not read auth data...
vuln
Vulnerable
C/C++
static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx) { AVBPrint pbuf; char val_str[128]; const char *s; int i; av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); writer_print_section_header(w, SECTION_ID_FRAME); s = a...
vuln
Safe
Unknown
deliver_message(uschar *id, BOOL forced, BOOL give_up) { int i, rc; int final_yield = DELIVER_ATTEMPTED_NORMAL; time_t now = time(NULL); address_item *addr_last = NULL; uschar *filter_message = NULL; int process_recipients = RECIP_ACCEPT; open_db dbblock; open_db *dbm_file; extern int acl_where; uschar *info = queue_r...
vuln
Vulnerable
C/C++
@Override public void setMolangQueries(IAnimatable animatable, double currentTick) { MolangParser parser = GeckoLibCache.getInstance().parser; MinecraftClient minecraftInstance = MinecraftClient.getInstance(); parser.setValue("query.actor_count", minecraftInstance.world.getRegularEntityCount()); parser.setVal...
vuln
Vulnerable
Java
public static GearItemStack decodeItem(String encoded) { Matcher m = ENCODED_PATTERN.matcher(encoded); if (!m.matches()) return null; String name = ENCODE_NAME ? decodeString(m.group("Name")) : m.group("Name"); int[] ids = decodeNumbers(m.group("Ids")); int[] powders = m.group("...
vuln
Safe
Java
static int rm_read_header_old(AVFormatContext *s, AVFormatParameters *ap) { RMContext *rm = s->priv_data; AVStream *st; rm->old_format = 1; st = av_new_stream(s, 0); if (!st) goto fail; rm_read_audio_stream_info(s, st, 1); return 0; fail: return -1; }
vuln
Vulnerable
C/C++
Tine.Addressbook.ContactGridPanel.countryRenderer = function(data) { data = Locale.getTranslationData('CountryList', data); return data; };
vuln
Vulnerable
JavaScript
static int net_slirp_init(VLANState *vlan) { if (!slirp_inited) { slirp_inited = 1; slirp_init(); } slirp_vc = qemu_new_vlan_client(vlan, slirp_receive, NULL, NULL); snprintf(slirp_vc->info_str, sizeof(slirp_vc->info_str), "user redirector"); retu...
vuln
Safe
C/C++
@Override public void calculate(@NonNull Player target, @NonNull ContextConsumer consumer) { ClaimCache claimCache = HuskTowns.getClaimCache(); if (claimCache.hasLoaded()) { final Location location = target.getLocation(); ClaimedChunk chunk = claimCache.getChunkAt(LuckPermsIn...
vuln
Safe
Java
@Override public void draw(MatrixStack matrixStack) { if (!Radar.INSTANCE.getState()) return; super.draw(matrixStack); if (!isOpen()) return; Render2DHelper.INSTANCE.fillAndBorder(matrixStack, this.getX(), this.getY() + this.getHeight(), this.getX() + this.get...
vuln
Vulnerable
Java
private void setupTextWatchers() { mActionView.addTextChangedListener(new IntentUpdateTextWatcher(mActionView) { @Override protected void onUpdateIntent(String modifiedContent) { if (mMutableIntent != null) { mMutableIntent.setAction(modifiedContent); ...
vuln
Vulnerable
Java
@Method(0x801030d8L) public static void FUN_801030d8(final int index, final ScriptState<EffectManagerData6c> state, final EffectManagerData6c data) { final BttlScriptData6cSub38 s6 = (BttlScriptData6cSub38)data.effect_44; if(s6._04.get() + 1 == s6._0c.get()) { return; } final ShortRef sp0x20 =...
vuln
Vulnerable
Java
/* MIT License Copyright (c) 2021 Yansong Li 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, modify, merge, publ...
vuln
Safe
C/C++
@Override public void onReceive(Context context, Intent intent) { if(U.isExternalAccessDisabled(context)) return; if(lastbundle.equals(intent.getBundleExtra(com.twofortyfouram.locale.api.Intent.EXTRA_BUNDLE))) { // bundle hasn't changed: we can safely return return; ...
vuln
Vulnerable
Java
static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const MagickBooleanType separate,ExceptionInfo *exception) { size_t channels, packet_size; unsigned char *compact_pixels; /* Write uncompressed pixels as separate ...
vuln
Safe
Unknown
static bool __io_worker_unuse(struct io_wqe *wqe, struct io_worker *worker) { bool dropped_lock = false; if (worker->creds) { revert_creds(worker->creds); worker->creds = NULL; } if (current->files != worker->restore_files) { __acquire(&wqe->lock); spin_unlock_irq(&wqe->lock); dropped_lock = true; ta...
vuln
Safe
Unknown
BOOL update_recv(rdpUpdate* update, wStream* s) { BOOL rc = FALSE; UINT16 updateType; rdpContext* context = update->context; if (Stream_GetRemainingLength(s) < 2) { WLog_ERR(TAG, "Stream_GetRemainingLength(s) < 2"); return FALSE; } Stream_Read_UINT16(s, updateType); /* updateType (2 bytes) */ WLog_Print(u...
vuln
Vulnerable
C/C++
from django.apps import AppConfig from django.core import checks from .checks import check_deprecated_settings class AnymailBaseConfig(AppConfig): name = 'anymail' verbose_name = "Anymail" def ready(self): checks.register(check_deprecated_settings)
vuln
Safe
Python
getDownloadUrl() { Shopware.Utils.debug.error('The method getDownloadUrl has been replaced with openDownload.'); return ''; },
vuln
Safe
JavaScript
spnego_gss_inquire_sec_context_by_oid( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_OID desired_object, gss_buffer_set_t *data_set) { OM_uint32 ret; ret = gss_inquire_sec_context_by_oid(minor_status, context_handle, desired_object, data_set); return (ret); }
vuln
Vulnerable
C/C++
static void qmp_input_type_str(Visitor *v, char **obj, const char *name, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QString *qstr = qobject_to_qstring(qmp_input_get_object(qiv, name, true)); if (!qstr) { error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name ...
vuln
Safe
C/C++
static void kvm_update_msi_routes_all(void *private, bool global, uint32_t index, uint32_t mask) { int cnt = 0; MSIRouteEntry *entry; MSIMessage msg; QLIST_FOREACH(entry, &msi_route_list, list) { cnt++; msg = pci_get_msi_message(entry->dev, entr...
vuln
Vulnerable
C/C++
@Override public T read(final InputStream stdOut) { byte[] bytes = new byte[BUFFER_SIZE]; int read = 0; long total = 0; long lastReport = 0; try { do { total += read; if (total - lastReport > REPORT_EVERY_BYTES) { ...
vuln
Safe
Java
s32 vvc_parse_picture_header(GF_BitStream *bs, VVCState *vvc, VVCSliceInfo *si) { u32 pps_id; si->irap_or_gdr_pic = gf_bs_read_int_log(bs, 1, "irap_or_gdr_pic"); si->non_ref_pic = gf_bs_read_int_log(bs, 1, "non_ref_pic"); if (si->irap_or_gdr_pic) si->gdr_pic = gf_bs_read_int_log(bs, 1, "gdr_pic"); if ((si->inte...
vuln
Vulnerable
C/C++
function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}z={div:F,comment:H,saveCallback:J,deleteOnCancel:R};var O=F.querySelector(".geCommentTxt"),V=F.querySelector(".geCommentActionsList"),U=document.createElement("textarea");U.className= "geCommentEditTxtArea...
vuln
Vulnerable
JavaScript
int read_escaped_char( yyscan_t yyscanner, uint8_t* escaped_char) { char text[4] = {0, 0, 0, 0}; text[0] = '\\'; text[1] = RE_YY_INPUT(yyscanner); if (text[1] == EOF) return 0; if (text[1] == 'x') { text[2] = RE_YY_INPUT(yyscanner); if (text[2] == EOF) return 0; text[3] = ...
vuln
Vulnerable
C/C++
void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) { void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *); AVFilterPad *dst = link->dstpad; FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1); if (!(filter_samples = dst->filter_samples)) filter_sampl...
vuln
Safe
C/C++
final Value collection(final QueryContext qc) throws QueryException { // return default collection or parse specified collection QueryInput qi = queryInput; if(qi == null) { final Item item = exprs.length == 0 ? Empty.VALUE : exprs[0].atomItem(qc, info); if(item != Empty.VALUE) { qi = qu...
vuln
Safe
Java
static ssize_t _hostfs_read(oe_fd_t* desc, void* buf, size_t count) { ssize_t ret = -1; file_t* file = _cast_file(desc); if (!file) OE_RAISE_ERRNO(OE_EINVAL); /* Call the host to perform the read(). */ if (oe_syscall_read_ocall(&ret, file->host_fd, buf, count) != OE_OK) OE_RAISE_ER...
vuln
Vulnerable
Unknown
def _dynarray_make_setter(dst, src): assert isinstance(src.typ, DArrayType) assert isinstance(dst.typ, DArrayType) if src.value == "~empty": return IRnode.from_list(STORE(dst, 0)) if src.value == "multi": ret = ["seq"] # handle literals # write the length word ...
vuln
Safe
Python
static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6) { TraceRecord *rec = &trace_buf[trace_idx]; if (!trace_list[event].state) { return; } rec->event = event; rec->timestamp_ns = get_clock(); rec->x1 = x1; ...
vuln
Vulnerable
C/C++
static int parallels_open(BlockDriverState *bs, int flags) { BDRVParallelsState *s = bs->opaque; int i; struct parallels_header ph; bs->read_only = 1; if (bdrv_pread(bs->file, 0, &ph, sizeof(ph)) != sizeof(ph)) goto fail; if (memcmp(ph.magic, HEADER_MAGIC, 16) || (le32_to_cpu(ph.versio...
vuln
Vulnerable
C/C++
""" Defines a calendar extension that overrides code block rendering if the language type is calendar """ import datetime import calendar import urwid from lookatme.exceptions import IgnoredByContrib def render_code(token, body, stack, loop): lang = token["lang"] or "" if lang != "calendar": raise...
vuln
Vulnerable
Python
/* Copyright 2022 The Fluid Authors. 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 in writing, softw...
vuln
Vulnerable
Go
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import binascii import hashlib import os import re import sys import tempfile import threading import time import typing import zlib import codecs from distutils.version import StrictVersion from cryptograp...
vuln
Safe
Python
static unsigned char asn1_length_decode(struct asn1_ctx *ctx, unsigned int *def, unsigned int *len) { unsigned char ch, cnt; if (!asn1_octet_decode(ctx, &ch)) return 0; if (ch == 0x80) *def = 0; else { *def = 1; if (ch < 0x80) *len = ch; else { cnt = ch & 0x7F; *len = 0; while (c...
vuln
Safe
Unknown
function peg$parsefloat() { var s0, s1, s2, s3; peg$silentFails++; s0 = peg$currPos; s1 = peg$parseinteger(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s2 = peg$c50; peg$currPos++; } else { s2 = peg$FAILED; ...
vuln
Vulnerable
JavaScript
public Loader<Cursor> getSearchCursorForGroupsLoader(final String searchString) { return new CursorLoader(context, null, null, null, null, MobiComDatabaseHelper.CHANNEL_DISPLAY_NAME + " asc") { @Override public Cursor loadInBackground() { SQLiteDatabase db = dbHelper.ge...
vuln
Safe
Java
/* * The MIT License * * Copyright (c) 2004-2009, Sun Microsystems, Inc. * * 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 ...
vuln
Safe
Java
static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp) { uint64_t magic; uint32_t opt; uint32_t type; uint32_t len; uint32_t namelen; *name = NULL; if (read_sync(ioc, &magic, sizeof(magic)) != sizeof(magic)) { error_setg(errp, "failed to read list option magic"); ...
vuln
Vulnerable
C/C++
static void do_sendkey(const char *string) { uint8_t keycodes[16]; int nb_keycodes = 0; char keyname_buf[16]; char *separator; int keyname_len, keycode, i; while (1) { separator = strchr(string, '-'); keyname_len = separator ? separator - string : strlen(string); if (keyn...
vuln
Safe
C/C++
import logging from contextlib import ExitStack from dateutil import parser from functools import wraps import socket import ipaddress from urllib.parse import urlparse from six import text_type from sshtunnel import open_tunnel from redash import settings, utils from redash.utils import json_loads, query_is_select_n...
vuln
Vulnerable
Python
isis_print_id(const uint8_t *cp, int id_len) { int i; static char id[sizeof("xxxx.xxxx.xxxx.yy-zz")]; char *pos = id; for (i = 1; i <= SYSTEM_ID_LEN; i++) { snprintf(pos, sizeof(id) - (pos - id), "%02x", *cp++); pos += strlen(pos); if (i == 2 || i == 4) *pos++ = '.'; } if (id_len >=...
vuln
Vulnerable
C/C++
void cJSON_ReplaceItemInObject( cJSON *object, const char *string, cJSON *newitem )
vuln
Safe
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
Safe
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import './projectAccessRights.html' import { t, i18nReady } from '../../utils/i18n.js' import { validateEmail, getGlobalSetting, showToast, } from '../../utils/frontend_helpers' import Projects from '../../api/projects/projects.js' Template.projectAccessRi...
vuln
Vulnerable
JavaScript
mp_sint32 LoaderS3M::load(XMFileBase& f, XModule* module) { module->cleanUp(); // this will make code much easier to read TXMHeader* header = &module->header; TXMInstrument* instr = module->instr; TXMSample* smp = module->smp; TXMPattern* phead = module->phead; // we're already out of memory here if...
vuln
Vulnerable
C/C++
public void configure(ICourse course, CourseNode newNode, ModuleConfiguration moduleConfig) { if(displayType != null && (STCourseNodeEditController.CONFIG_VALUE_DISPLAY_TOC.equals(displayType) || STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW.equals(displayType) || STCourseNodeEditController....
vuln
Safe
Java
void AES::encrypt(const byte* inBlock, const byte* xorBlock, byte* outBlock) const { word32 s0, s1, s2, s3; word32 t0, t1, t2, t3; const word32 *rk = key_; /* * map byte array block to cipher state * and add initial round key: */ gpBlock::Get(inBlock)(s0)(s1)(s2)(s3...
vuln
Vulnerable
Unknown
@Redirect(method = "renderInventoryOverlay", at = @At(value = "INVOKE", target = "Lfi/dy/masa/malilib/util/InventoryUtils;getInventory(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/Container;", ordinal = 0, remap = true)) priv...
vuln
Safe
Java
function cellClicked(cell) { // Forces focusout in IE if (!ui.editor.isChromelessView()) { graph.container.focus(); } // Gets the selection cell if (cell == null) { highlight.highlight(null); div.innerHTML = '<p><i>' + mxResources.get('nothingIsSelected') + '</i></p>'; } else { var att...
vuln
Safe
JavaScript
WOURLError WOParseApplicationName(WOURLComponents *wc, const char *url) { int len; const char *s; const char *webobjects, *extension, *version, *start, *end; int i; len = strlen(url); webobjects = NULL; /* * spot our marker in the URL. It'll look like "/WebObjects-n.ext/" */ ...
vuln
Safe
C/C++
@Override public void handle(final RoutingContext routingContext) { final String path = routingContext.normalisedPath(); if (KSQL_AUTHENTICATION_SKIP_PATHS.contains(path)) { routingContext.next(); return; } workerExecutor.<Void>executeBlocking( promise -> authorize(promise, rout...
vuln
Vulnerable
Java
public String submitImport(String inputFormat, String inputSource, List<Input> inputs, StorageDetail storageDetail) throws Exception { JobInstanceRequest.Builder builder = JobInstanceRequest.builder(); builder.applicationName(adapter.getApplicationName()); builder.moduleName(adapter.getModuleNam...
vuln
Vulnerable
Java
void CreateNgrams(const tstring* data, tstring* output, int num_ngrams, int ngram_width) const { for (int ngram_index = 0; ngram_index < num_ngrams; ++ngram_index) { int pad_width = get_pad_width(ngram_width); int left_padding = std::max(0, pad_width - ngram_index); int right_p...
vuln
Safe
Unknown
static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size) { DynBuffer *d = opaque; int new_size, new_allocated_size; new_size = d->pos + buf_size; new_allocated_size = d->allocated_size; if(new_size < d->pos || new_size > INT_MAX/2) return -1; while (new_size > new_allocate...
vuln
Vulnerable
C/C++
static function sendXML($items_id, $itemtype) { if (call_user_func([$itemtype, 'canView'])) { $xml = file_get_contents(GLPI_PLUGIN_DOC_DIR."/fusioninventory/xml/".$items_id); echo $xml; } else { Html::displayRightError(); } }
vuln
Vulnerable
PHP
public function ExpandHash($project, $abbrevHash) { if (!$project) return $abbrevHash; if (!(preg_match('/[0-9A-Fa-f]{4,39}/', $abbrevHash))) { return $abbrevHash; } $args = array(); $args[] = '-1'; $args[] = '--format=format:%H'; $args[] = escapeshellarg($abbrevHash); $fullData = explode("\n"...
vuln
Safe
PHP
@ModifyArg( method = "getOccupiedSlotWithRoomForStack", at = @At( value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;canStackAddMore(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z", ordinal = 0 ), index = 0 ) ...
vuln
Safe
Java
/* 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
@Inject(method = "tick", at = @At("HEAD")) public void tick(CallbackInfo info) { if (this instanceof PhysicsElement) { PhysicsElement element = (PhysicsElement) this; ElementRigidBody body = element.getRigidBody(); Frame prevFrame = body.getFrame(); /* Update...
vuln
Safe
Java
eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; JSStringRef js_result_string; size_t js_result_size; js_init(); ...
vuln
Vulnerable
C/C++
virtual Status explain(OperationContext* opCtx, const std::string& dbname, const BSONObj& cmdObj, ExplainOptions::Verbosity verbosity, BSONObjBuilder* out) const { const bool isExplain = true; Loc...
vuln
Safe
Unknown
@Override public boolean isChecked() { int state = mUwbManager.getAdapterState(); return state == STATE_ENABLED_ACTIVE || state == STATE_ENABLED_INACTIVE; }
vuln
Vulnerable
Java
cdp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { struct lldpd_chassis *chassis; struct lldpd_port *port; struct lldpd_mgmt *mgmt; struct in_addr addr; #if 0 u_int16_t cksum; #endif u_int8_t *software = NULL...
vuln
Vulnerable
C/C++
private void visitProtoInitFunction(FunctionNode node) { SoyType soyType = node.getNameExpr().getType(); if (soyType.getKind() != Kind.PROTO_TYPE) { errorReporter.report(node.getNameExpr().getSourceLocation(), NOT_PROTO_MESSAGE); node.setType(UnknownType.getInstance()); return; ...
vuln
Vulnerable
Java
public void updateSummaryWithPivotConfig(final CurrencyData currency, final SavingsAccountTransactionSummaryWrapper wrapper, final SavingsAccountTransaction transaction, final List<SavingsAccountTransactionData> savingsAccountTransactions) { if (transaction != null) { if (transaction.is...
vuln
Safe
Java
static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node, int threshold) { Jpeg2000TgtNode *stack[30]; int sp = -1, curval = 0; if (!node) return AVERROR_INVALIDDATA; while (node && !node->vis) { stack[++sp] = node; node = node...
vuln
Safe
C/C++
private String getLocalePrefix(FacesContext context) { String localePrefix = null; localePrefix = context.getExternalContext().getRequestParameterMap().get("loc"); if(localePrefix != null && !nameContainsForbiddenSequence(localePrefix)){ return localePrefix; ...
vuln
Safe
Java
package com.zrlog.web.interceptor; import com.hibegin.common.util.BeanUtil; import com.hibegin.common.util.StringUtils; import com.jfinal.core.Controller; import com.jfinal.core.JFinal; import com.jfinal.kit.PathKit; import com.zrlog.common.Constants; import com.zrlog.common.vo.OutlineVO; import com.zrlog.model.Log; i...
vuln
Vulnerable
Java
static const ut8 *r_bin_dwarf_parse_attr_value(const ut8 *obuf, int obuf_len, RBinDwarfAttrSpec *spec, RBinDwarfAttrValue *value, const RBinDwarfCompUnitHdr *hdr, const ut8 *debug_str, size_t debug_str_len) { const ut8 *buf = obuf; const ut8 *buf_end = obuf + obuf_len; size_t j; if (!spec || !value || !hdr |...
vuln
Vulnerable
C/C++
static int webm_dash_manifest_cues(AVFormatContext *s) { MatroskaDemuxContext *matroska = s->priv_data; EbmlList *seekhead_list = &matroska->seekhead; MatroskaSeekhead *seekhead = seekhead_list->elem; char *buf; int64_t cues_start = -1, cues_end = -1, before_pos, bandwidth; int i; for (...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2016 Southern Storm Software, Pty Ltd. * * 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
void hmp_info_local_apic(Monitor *mon, const QDict *qdict) { x86_cpu_dump_local_apic_state(mon_get_cpu(), (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); }
vuln
Vulnerable
C/C++
int spapr_tce_dma_read(VIOsPAPRDevice *dev, uint64_t taddr, void *buf, uint32_t size) { #ifdef DEBUG_TCE fprintf(stderr, "spapr_tce_dma_write taddr=0x%llx size=0x%x\n", (unsigned long long)taddr, size); #endif while (size) { uint64_t tce; uint32_t lsize; ...
vuln
Vulnerable
C/C++
void aio_set_fd_handler(AioContext *ctx, int fd, bool is_external, IOHandler *io_read, IOHandler *io_write, void *opaque) { AioHandler *node; bool is_new = false; node = find_aio_handler(c...
vuln
Vulnerable
C/C++
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "ScpFileSystem.h" #include "Terminal.h" #include "Common.h" #include "Exceptions.h" #include "Interface.h" #include "TextsCore.h" #include "HelpCore.h" #include "SecureShell.h" #include...
vuln
Safe
C/C++
$scope.clone = function(foreignSource) { var availableForeignSources = []; angular.forEach($scope.requisitionsData.requisitions, function(r) { if (r.foreignSource !== foreignSource) { availableForeignSources.push(r.foreignSource); } }); var modalInstance = $uibModal.ope...
vuln
Vulnerable
JavaScript
static int read_public_key(RSA *rsa) { int r; sc_path_t path; sc_file_t *file; u8 buf[2048], *p = buf; size_t bufsize, keysize; r = select_app_df(); if (r) return 1; sc_format_path("I1012", &path); r = sc_select_file(card, &path, &file); if (r) { fprintf(stderr, "Unable to select public key file: %s\n", ...
vuln
Safe
Unknown
// Copyright 2019 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library 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 3 of the License...
vuln
Vulnerable
Go
static Document createNewXfdfDocument() { try { DocumentBuilder db = XmlProcessorCreator.createSafeDocumentBuilder(false, false); return db.newDocument(); } catch (Exception e) { throw new PdfException(e.getMessage(), e); } }
vuln
Safe
Java
int wolfSSH_SFTP_RecvSTAT(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) { WS_SFTP_FILEATRB atr; char* name = NULL; int ret = WS_SUCCESS; word32 sz; word32 idx = 0; byte* out = NULL; word32 outSz = 0; if (ssh == NULL) { return WS_BAD_ARGUMENT; } WLOG(WS_LOG_SFT...
vuln
Vulnerable
C/C++
func TimestampFileMetaEqual(actual data.TimestampFileMeta, expected data.TimestampFileMeta) error { // TUF no longer considers the length and hashes to be a required // member of Timestamp. if expected.Length != 0 && actual.Length != expected.Length { return ErrWrongLength{expected.Length, actual.Length} } // 5....
vuln
Safe
Go
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * 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.apach...
vuln
Vulnerable
Java
VTermState *vterm_obtain_state(VTerm *vt) { VTermState *state; if(vt->state) return vt->state; state = vterm_state_new(vt); vt->state = state; state->combine_chars_size = 16; state->combine_chars = vterm_allocator_malloc(state->vt, state->combine_chars_size * sizeof(state->combine_chars[0])); state...
vuln
Vulnerable
Unknown
libvirt_vmessage(xentoollog_logger *logger_in, xentoollog_level level, int errnoval, const char *context, const char *format, va_list args) { xentoollog_logger_libvirt *lg = (xentoollog_logger_libvirt *)logger_in; FILE *logFile...
vuln
Safe
Unknown
static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * posts, int samples) { int range = 255 / fc->multiplier + 1; int i; for (i = 0; i < fc->values; i++) { int position = fc->list[fc->list[i].sort].x; int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x; in...
vuln
Vulnerable
C/C++
private static MinecraftProfileResponse getMinecraftProfile(String tokenType, String accessToken) throws IOException, AuthenticationException { HttpURLConnection conn = HttpRequest.GET("https://api.minecraftservices.com/minecraft/profile") .contentType("application/json").authorizati...
vuln
Safe
Java
void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) { int i, rc; xen_pfn_t ioreq_pfn; xen_pfn_t bufioreq_pfn; evtchn_port_t bufioreq_evtchn; XenIOState *state; state = g_malloc0(sizeof (XenIOState)); state->xce_handle = xenevtchn_open(NULL, 0); if (state->xce_handle == NUL...
vuln
Safe
C/C++
@Override protected void read(CompoundTag compound, boolean clientPacket) { int prevBeltLength = beltLength; super.read(compound, clientPacket); if (compound.getBoolean("IsController")) controller = worldPosition; color = compound.contains("Dye") ? Optional.of(NBTHelper.readEnum(compound, "Dye", DyeColor....
vuln
Safe
Java
public void setMusicStateListenerListener(@NonNull MusicStateListener status) { mMusicStateListener.add(status); }
vuln
Safe
Java
public void deleteMessage(Context context, long messageID) { //Getting the database SQLiteDatabase database = getWritableDatabase(); //Deleting the message entries database.delete(Contract.MessageEntry.TABLE_NAME, Contract.MessageEntry._ID + " = ?", new String[]{Long.toString(messageID)}); //Deleting as...
vuln
Safe
Java
package common import ( "os" "path/filepath" "strconv" "time" "github.com/sirupsen/logrus" ) // Default service addresses and URLS of Argo CD internal services const ( // DefaultRepoServerAddr is the gRPC address of the Argo CD repo server DefaultRepoServerAddr = "argocd-repo-server:8081" // DefaultDexServer...
vuln
Vulnerable
Go
private function updateModificationDate() { try { $modif_date = date('Y-m-d'); $update = $this->zdb->update(self::TABLE); $update->set( array('date_modif_adh' => $modif_date) )->where([self::PK => $this->_id]); $edit = $this->zdb->...
vuln
Safe
PHP
'use strict'; var required = require('requires-port') , qs = require('querystringify') , CRHTLF = /[\n\r\t]/g , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\// , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i , windowsDriveLetter = /^[a-zA-Z]:/ , whitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200...
vuln
Safe
JavaScript
import hashlib import math import operator from decimal import Decimal from vyper import ast as vy_ast from vyper.abi_types import ABI_Tuple from vyper.address_space import MEMORY, STORAGE from vyper.ast.validation import validate_call_args from vyper.codegen.abi_encoder import abi_encode from vyper.codegen.context im...
vuln
Safe
Python
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) { char buf1[32], tuple_type[32]; int h, w, depth, maxval; pnm_get(s, buf1, sizeof(buf1)); s->type= buf1[1]-'0'; if(buf1[0] != 'P') return -1; if (s->type==1 || s->type==4) { avctx->pix_fmt = PIX_FMT_MONOWHITE; ...
vuln
Safe
C/C++
public static void generateStructures(ISeedReader reader, PairXZ<Integer, Integer> islandCenter, Random random) { int outerRadius = 330; //Gen Chaos Cavern int shardY = 80 + DEOldConfig.chaosIslandYOffset; int coreHeight = 10; int coreWidth = 20; for (int y = shardY - ...
vuln
Vulnerable
Java
/* 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
Safe
Python