code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@Override public <T> T getCapability(Capability<T> capability, T defaultValue) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { if (defaultValue == null) { return null; } IItemHandler delegate = (IItemHandler) defaultValue; ...
vuln
Safe
Java
static void acquire_privilege(const char *name, Error **errp) { HANDLE token = NULL; TOKEN_PRIVILEGES priv; Error *local_err = NULL; if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token)) { if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Lui...
vuln
Safe
C/C++
function merge(source, target) { for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { var value = source[key]; if (Object.prototype.hasOwnProperty.call(target, key) && typeof value === 'object' && !Array.isArray(value)) { target[key] = merge(value, target[key] ||...
vuln
Safe
JavaScript
private void completeRecipe() { assert level != null; if (cachedRecipe != null) { final ItemStack result = cachedRecipe.assemble(inventory); final FluidStack inputFluid = inventory.getFluid(); if (!catalystStacks.isEmpty() && !inputFluid.isEmpty()) ...
vuln
Vulnerable
Java
static uint64_t atol10(const char *p, size_t char_cnt) { uint64_t l; int digit; if (char_cnt == 0) return (0); l = 0; digit = *p - '0'; while (digit >= 0 && digit < 10 && char_cnt-- > 0) { l = (l * 10) + digit; digit = *++p - '0'; } return (l); }
vuln
Safe
C/C++
/* bson.c */ /* Copyright 2009, 2010 10gen 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 b...
vuln
Safe
C/C++
@Override public Object pack(Object obj) throws Exception { ReflectionHelper.setFieldValue(obj, "iMatchColumns", null); ReflectionHelper.setFieldValue(obj, "strMatchColumns", null); Class<?> cls = Class.forName("com.sun.rowset.JdbcRowSetImpl"); Method method = cls.getDeclaredMethod(...
vuln
Vulnerable
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
auth_request_want_skip_passdb(struct auth_request *request, struct auth_passdb *passdb) { /* if mechanism is not supported, skip */ const char *const *mechs = passdb->passdb->mechanisms; const char *const *username_filter = passdb->passdb->username_filter; const char *username; username = request->fields...
vuln
Vulnerable
Unknown
static void ov511_mode_init_regs(struct sd *sd) { struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; int hsegs, vsegs, packet_size, fps, needed; int interlaced = 0; struct usb_host_interface *alt; struct usb_interface *intf; intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); alt = usb_altnum_to_...
vuln
Vulnerable
C/C++
private Map<String, String> getEnvVars() { String versionName = Optional.ofNullable(options.getVersionName()).orElse(version.getId()); Map<String, String> env = new HashMap<>(); env.put("FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS", "true"); env.put("INST_NAME", versionName); env.put...
vuln
Safe
Java
STATIC ptr_t GC_unix_mmap_get_mem(size_t bytes) { void *result; static ptr_t last_addr = HEAP_START; # ifndef USE_MMAP_ANON static GC_bool initialized = FALSE; if (!initialized) { zero_fd = open("/dev/zero", O_RDONLY); if (zero_fd == -1) ABORT("Could not open /dev...
vuln
Safe
C/C++
exif_data_load_data (ExifData *data, const unsigned char *d_orig, unsigned int ds) { unsigned int l; ExifLong offset; ExifShort n; const unsigned char *d = d_orig; unsigned int len, fullds; if (!data || !data->priv || !d || !ds) return; exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "...
vuln
Vulnerable
C/C++
package ops import ( "bytes" "fmt" "io" "os" "strconv" "text/template" "io/ioutil" "os/exec" "path" "path/filepath" "strings" "syscall" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/openshift/assisted-installer/src/config" "github.com/openshift/assisted-installer/src/inventory_cli...
vuln
Vulnerable
Go
public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { if (event.getPlayer() instanceof ServerPlayer) { TFCFoodData.replaceFoodStats(event.getPlayer()); final ServerLevel overworld = ServerLifecycleHooks.getCurrentServer().overworld(); if (o...
vuln
Vulnerable
Java
LRESULT wmSysKeyDown (long hwnd, long wParam, long lParam) { /* * Feature in Windows. When WM_SYSKEYDOWN is sent, * the user pressed ALT+<key> or F10 to get to the * menu bar. In order to issue events for F10 but * ignore other key presses when the ALT is not down, * make sure that either F10 was pressed or tha...
vuln
Vulnerable
Java
on_connection_attempt_timeout (gpointer data) { ConnectionAttempt *attempt = data; enumerator_next_async (attempt->data); g_clear_pointer (&attempt->timeout_source, g_source_unref); return G_SOURCE_REMOVE; }
vuln
Vulnerable
Unknown
void smp_proc_id_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { uint8_t* p = p_data->p_data; SMP_TRACE_DEBUG("%s", __func__); STREAM_TO_ARRAY(p_cb->tk, p, BT_OCTET16_LEN); /* reuse TK for IRK */ smp_key_distribution_by_transport(p_cb, NULL); }
vuln
Vulnerable
C/C++
void setIntent(ActivityRecord r) { boolean updateIdentity = false; if (this.intent == null) { updateIdentity = true; } else if (!mNeverRelinquishIdentity) { updateIdentity = (effectiveUid == Process.SYSTEM_UID || mIsEffectivelySystemApp || effectiveUid...
vuln
Safe
Java
PHP_FUNCTION(sqlite_factory) { long mode = 0666; char *filename, *fullpath = NULL; int filename_len; zval *errmsg = NULL; zend_error_handling error_handling; zend_replace_error_handling(EH_THROW, sqlite_ce_exception, &error_handling TSRMLS_CC); if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|...
vuln
Safe
Unknown
static void noise_scale(int *coefs, int scale, int band_energy, int len) { int ssign = scale < 0 ? -1 : 1; int s = FFABS(scale); unsigned int round; int i, out, c = exp2tab[s & 3]; int nlz = 0; while (band_energy > 0x7fff) { band_energy >>= 1; nlz++; } c /= band_energy; ...
vuln
Vulnerable
C/C++
@Override public void registerAuthenticationHandlerWithPrincipalResolvers(final Collection<AuthenticationHandler> handlers, final PrincipalResolver principalResolver) { handlers.stream().filter(BeanSupplier::isNotProxy).forEach(h -> registe...
vuln
Safe
Java
def _resolve_jdbc_connection(self) -> dict[str, Any]: conn_data = {"url": "", "schema": "", "conn_prefix": "", "user": "", "password": ""} try: conn = self.get_connection(self._jdbc_conn_id) if conn.port: conn_data["url"] = f"{conn.host}:{conn.port}" e...
vuln
Vulnerable
Python
plperl_validator(PG_FUNCTION_ARGS) { Oid funcoid = PG_GETARG_OID(0); HeapTuple tuple; Form_pg_proc proc; char functyptype; int numargs; Oid *argtypes; char **argnames; char *argmodes; bool is_trigger = false; bool is_event_trigger = false; int i; /* Get the new function's pg_proc entry */...
vuln
Vulnerable
Unknown
int ff_h264_pred_weight_table(GetBitContext *gb, const SPS *sps, const int *ref_count, int slice_type_nos, H264PredWeightTable *pwt, void *logctx) { int list, i, j; int luma_def, chroma_def; pwt->use_weight = 0; pwt->use_weight_chro...
vuln
Vulnerable
C/C++
long Tracks::ParseTrackEntry(
vuln
Safe
C/C++
int pcie_cap_init(PCIDevice *dev, uint8_t offset, uint8_t type, uint8_t port) { int pos; uint8_t *exp_cap; assert(pci_is_express(dev)); pos = pci_add_capability(dev, PCI_CAP_ID_EXP, offset, PCI_EXP_VER2_SIZEOF); if (pos < 0) { return pos; } dev->exp.exp_cap = pos; exp_cap = ...
vuln
Safe
C/C++
@Override public void close() { synchronized (lock) { if (isClosed) { return; } LOG.info("Shutting down the network environment and its components."); // terminate all network connections try { LOG.debug("Shutting ...
vuln
Vulnerable
Java
void GLSurfaceOzoneSurfacelessSurfaceImpl::Destroy() { if (!context_) return; scoped_refptr<gfx::GLContext> previous_context = gfx::GLContext::GetCurrent(); scoped_refptr<gfx::GLSurface> previous_surface; bool was_current = previous_context && previous_context->IsCurrent(nullptr) && gf...
vuln
Safe
C/C++
status_t ACodec::setupAACCodec( bool encoder, int32_t numChannels, int32_t sampleRate, int32_t bitRate, int32_t aacProfile, bool isADTS, int32_t sbrMode, int32_t maxOutputChannelCount, const drcParams_t& drc, int32_t pcmLimiterEnable) { if (encoder && isADTS) { return -EINVAL; } status_t err = setupRawAudioFor...
vuln
Safe
C/C++
static int jas_icctxtdesc_input(jas_iccattrval_t *attrval, jas_stream_t *in, int cnt) { int n; int c; jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc; txtdesc->ascdata = 0; txtdesc->ucdata = 0; if (jas_iccgetuint32(in, &txtdesc->asclen)) goto error; if (!(txtdesc->ascdata = jas_malloc(txtdesc->asclen))) ...
vuln
Safe
Unknown
_XimEncodingNegotiation( Xim im) { char *name_ptr = 0; int name_len = 0; char *detail_ptr = 0; int detail_len = 0; CARD8 *buf; CARD16 *buf_s; INT16 len; CARD32 reply32[BUFSIZE/4]; char *reply = (char *)reply32; XPointer preply; int buf_size; int ret_code;...
vuln
Safe
Unknown
int nntp_add_group(char *line, void *data) { struct NntpServer *nserv = data; struct NntpData *nntp_data = NULL; char group[LONG_STRING] = ""; char desc[HUGE_STRING] = ""; char mod; anum_t first, last; if (!nserv || !line) return 0; /* These sscanf limits must match the sizes of the group and desc...
vuln
Safe
Unknown
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gene...
vuln
Vulnerable
C/C++
SetRunner( ReferenceHandle& that, Local<Value> key_handle, Local<Value> val_handle, MaybeLocal<Object> maybe_options ) : key{ExternalCopy::CopyIfPrimitive(key_handle)}, val{TransferOut(val_handle, TransferOptions{maybe_options})}, context{that.context}, reference{that.reference} { that....
vuln
Vulnerable
Unknown
private void onSignPayloadComplete(@NonNull NotifyOnCompleteFuture<SignedPayloadResult> future) { final SignPayloadRequest request = (SignPayloadRequest) future; try { final SignedPayloadResult result; try { result = request.get(); } catch (ExecutionE...
vuln
Vulnerable
Java
private int mget(struct magic_set *ms, const unsigned char *s, struct magic *m, size_t nbytes, size_t o, unsigned int cont_level, int mode, int text, int flip, int recursion_level, int *printed_something, int *need_separator, int *returnval) { uint32_t offset = ms->offset; uint32_t lhs; file_pushbuf_t *p...
vuln
Vulnerable
Unknown
static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, struct hid_usage *usage) { struct input_dev *input = hidinput->input; struct hid_device *device = input_get_drvdata(input); int max = 0, code; unsigned long *bit = NULL; field->hidinput = hidinput; if (field->flag...
vuln
Safe
Unknown
final void requestMinimized() { performLocked(() -> nativeRequestMinimized(nativePtr)); }
vuln
Safe
Java
/*! * defaults-deep <https://github.com/jonschlinkert/defaults-deep> * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; var lazy = require('lazy-cache')(require); lazy('is-extendable', 'isObject'); lazy('for-own', 'forOwn'); function defaultsDeep(target, objects) { ...
vuln
Safe
JavaScript
gboolean textview_uri_security_check(TextView *textview, ClickableText *uri) { gchar *visible_str; gboolean retval = TRUE; if (is_uri_string(uri->uri) == FALSE) return TRUE; visible_str = textview_get_visible_uri(textview, uri); if (visible_str == NULL) return TRUE; g_strstrip(visible_str); if (strcmp(vi...
vuln
Vulnerable
C/C++
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowDCMException(exception,message) \ { \ if (data != (unsigned char *) NULL) \ data=(unsigned char *) RelinquishMagickMemory(data); \ if (stream_info != (DCMStreamInfo *) NULL) \ stream_info=(DCMStreamInfo *) Relinq...
vuln
Vulnerable
Unknown
package server import ( "context" "errors" "fmt" "sort" "sync" "time" "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" "github.com/ipfs/go-libipfs/bitswap/internal/defaults" "github.com/ipfs/go-libipfs/bitswap/message" pb "github.com/ipfs/go-libipfs/bitswap/message/pb" bmetrics "gi...
vuln
Safe
Go
void startDrag() { performLocked(() -> nativeStartDrag(nativePtr)); }
vuln
Safe
Java
def _delete_3par_host(self, hostname): self._cli_run('removehost %s' % hostname, None)
vuln
Vulnerable
Python
unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) { const unsigned long *p = addr + BITOP_WORD(offset); unsigned long result = offset & ~(BITS_PER_LONG-1); unsigned long tmp; if (offset >= size) { return size; } size -= result; of...
vuln
Vulnerable
C/C++
@Override public void run() { Log.i("开始分析页面"); boolean v3; a v0_6; d v0_5; d v0_4; f v15 = null; int v10; boolean alipayRedPackage; int receivedType; boolean paySuccess; try { if (h.findWechatPayUi(packageName, class...
vuln
Safe
Java
static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image) { #define CFormat "/Filter [ /%s ]\n" #define ObjectsPerImage 14 DisableMSCWarning(4310) static const char XMPProfile[]= { "<?xpacket begin=\"%s\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n" "<x:xmpmeta xmlns:x=\"adobe:ns...
vuln
Vulnerable
Unknown
static inline int vmsvga_fifo_length(struct vmsvga_state_s *s) { int num; if (!s->config || !s->enable) { return 0; } if ((CMD(min) | CMD(max) | CMD(next_cmd) | CMD(stop)) & 3) { return 0; } if (CMD(min) < (uint8_t *) s->cmd->fifo - (uint8_t *) s->fifo) { return 0; ...
vuln
Vulnerable
C/C++
def _add_auth_parsers_arguments(parser): class VaultEndpointVerifyAction(argparse.Action): def __call__(self, parser, args, values, option_string=None): if values in ['true', 'false']: setattr(args, self.dest, values == 'true') else: setattr(args, self...
vuln
Safe
Python
static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone) { int i; int nr = pagevec_count(pvec); int delta_munlocked = -nr; struct pagevec pvec_putback; int pgrescued = 0; pagevec_init(&pvec_putback, 0); /* Phase 1: page isolation */ spin_lock_irq(zone_lru_lock(zone)); for (i = 0; i < nr; i++) {...
vuln
Safe
Unknown
/** * Copyright (c) 2006-2017, JGraph Ltd * Copyright (c) 2006-2017, Gaudenz Alder */ (function() { if (typeof html4 !== 'undefined') { /** * Enables paste from Lucidchart */ html4.ATTRIBS['span::data-lucid-content'] = 0; html4.ATTRIBS['span::data-lucid-type'] = 0; /** * Enables custom fonts in...
vuln
Vulnerable
JavaScript
bool Greeter::start() { // check flag if (m_started) return false; if (daemonApp->testing()) { // create process m_process = new QProcess(this); // delete process on finish connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus))...
vuln
Vulnerable
C/C++
@Override public void registerAuthenticationMetadataPopulators(final Collection<AuthenticationMetaDataPopulator> populators) { populators.stream().filter(BeanSupplier::isNotProxy).forEach(this::registerAuthenticationMetadataPopulator); }
vuln
Safe
Java
rsvg_new_symbol (void) { RsvgNodeSymbol *symbol; symbol = g_new (RsvgNodeSymbol, 1); _rsvg_node_init (&symbol->super, RSVG_NODE_TYPE_SYMBOL); symbol->vbox.active = FALSE; symbol->preserve_aspect_ratio = RSVG_ASPECT_RATIO_XMID_YMID; symbol->super.draw = _rsvg_node_draw_nothing; symbol->super....
vuln
Safe
Unknown
DECLAREcpFunc(cpContig2SeparateByRow) { tsize_t scanlinesizein = TIFFScanlineSize(in); tsize_t scanlinesizeout = TIFFScanlineSize(out); tdata_t inbuf; tdata_t outbuf; register uint8 *inp, *outp; register uint32 n; uint32 row; tsample_t s; inbuf = _TIFFmalloc(scanlinesizein); outbuf = _TIFFmalloc(scanli...
vuln
Vulnerable
C/C++
private void record() { android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO); //Adjust recording length should numOfiNferences increase int maxRecordingLength = recordingLength * numOfInferences; short[] recordingFrame = new short[bufferSize / 2]; //de...
vuln
Safe
Java
- (id <WOActionResults>) viewAction { WOResponse *result; NSDictionary *data; NSCalendarDate *eventStartDate, *eventEndDate; NSTimeZone *timeZone; SOGoUserDefaults *ud; SOGoCalendarComponent *co; NSString *created_by; BOOL resetAlarm; unsigned int snoozeAlarm; [self event]; result = [self respo...
vuln
Vulnerable
JavaScript
/* * Copyright (c) 2007 The University of Aberdeen, Scotland, UK * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> * * An implementation of the DCCP protocol * * This code has been developed by the University of Waikato ...
vuln
Vulnerable
C/C++
public void onMockedRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == CaptureManager.getCameraPermissionReqCode()) { showCameraPermissionMissingText(grantResults[0] != PackageManager.PERMISSION_GRANTED); } else if (requ...
vuln
Vulnerable
Java
# encoding: utf-8 import os import cgi import datetime import logging import magic import mimetypes from urllib.parse import urlparse from werkzeug.datastructures import FileStorage as FlaskFileStorage import ckan.lib.munge as munge import ckan.logic as logic import ckan.plugins as plugins from ckan.common import co...
vuln
Vulnerable
Python
text += `${c.amount(value, a.currency)}<br>`; });
vuln
Vulnerable
JavaScript
/* * Copyright 2017-2019 original 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 agre...
vuln
Safe
Java
public void delete() { atlasMaterials.values().forEach(InstanceMaterial::delete); materials.values().stream().flatMap(m -> m.values().stream()).forEach(InstanceMaterial::delete); }
vuln
Vulnerable
Java
static int flic_decode_frame_8BPP(AVCodecContext *avctx, void *data, int *got_frame, const uint8_t *buf, int buf_size) { FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; int pixel_ptr; int palette_ptr; unsigned char palet...
vuln
Vulnerable
C/C++
raptor_libxml_getEntity(void* user_data, const xmlChar *name) { raptor_libxml_getEntity(void* user_data, const xmlChar *name) { raptor_sax2* sax2 = (raptor_sax2*)user_data; xmlParserCtxtPtr xc = sax2->xc; xmlEntityPtr ret = NULL; if(!xc) return NULL; if(!xc->inSubset) { /* looks for hardcoded set o...
vuln
Safe
C/C++
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 License, or # (at your option) an...
vuln
Safe
Python
static void kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int w, int h) { BitBuf bb; int res, val; int i, j; int bx, by; int l0x, l1x, l0y, l1y; int mx, my; kmvc_init_getbits(bb, src); for (by = 0; by < h; by += 8) for (bx = 0; bx < w; bx += 8) { kmvc_...
vuln
Vulnerable
C/C++
public boolean canRegisterService(@NonNull ServiceInfo serviceInfo) { if (!android.Manifest.permission.BIND_ACCESSIBILITY_SERVICE.equals( serviceInfo.permission)) { Slog.w(LOG_TAG, "Skipping accessibility service " + new ComponentName( serviceInfo.packageName, ser...
vuln
Safe
Java
initialize(container) { this.chatService = container.lookup("service:chat"); if (!this.chatService.userCanChat) { return; } withPluginApi("1.3.0", (api) => { const currentUser = api.getCurrentUser(); const hasPublicChannels = currentUser?.chat_channels?.public_channels?.lengt...
vuln
Safe
JavaScript
TiledInputFile::TiledInputFile (const Header &header, OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is, int version, int numThreads) : _data (new Data (numThreads)) { _data->_deleteStream=false; _data->_streamData = n...
vuln
Vulnerable
Unknown
static void sysContact_handler(snmp_varbind_t *varbind, uint32_t *oid) { snmp_api_set_string(varbind, oid, "Contiki-NG, https://github.com/contiki-ng/contiki-ng"); }
vuln
Vulnerable
C/C++
void CompactProtocolReader::readStringBody(StrType& str, int32_t size) { if (static_cast<int32_t>(in_.length()) < size) { if (!in_.canAdvance(size)) { protocol::TProtocolException::throwTruncatedData(); } str.reserve(size); // only reserve for multi iter case below } str.clear(); size_t size_l...
vuln
Safe
Unknown
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * Copyright (c) 2009-2012, Pieter Noordhuis <pcnoordhuis at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condition...
vuln
Vulnerable
C/C++
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) { int i, j; BIO *out = NULL, *btmp = NULL, *etmp = NULL, *bio = NULL; X509_ALGOR *xa; ASN1_OCTET_STRING *data_body = NULL; const EVP_MD *evp_md; const EVP_CIPHER *evp_cipher = NULL; EVP_CIPHER_CTX *evp_ctx = NULL; ...
vuln
Vulnerable
Unknown
static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) { int ret; const char* arg; va_list args; DYNAMIC_STRING ds_cmdline; DBUG_ENTER("run_tool"); DBUG_PRINT("enter", ("tool_path: %s", tool_path)); if (init_dynamic_string(&ds_cmdline, IF_WIN("\"", ""), FN_REFLEN, FN_REFLEN)) die("Out of ...
vuln
Vulnerable
Unknown
static inline void ModulateLCHuv(const double percent_luma, const double percent_chroma,const double percent_hue,double *red, double *green,double *blue) { double hue, luma, chroma; /* Increase or decrease color luma, chroma, or hue. */ ConvertRGBToLCHuv(*red,*green,*blue,&luma,&chroma,&hue...
vuln
Vulnerable
Unknown
public String authenticateImpl(HttpServletRequest servletRequest, boolean interactive, boolean skipPassword, boolean service) { String result = Constants.RESULT_FAILURE; try { logger.trace("Authenticating ... (interactive: {}, skipPassword: {}, credentials....
vuln
Vulnerable
Java
@EventHandler public void onArmorManipulate(PlayerArmorStandManipulateEvent e) { if (e == null) return; if (e.isCancelled()) return; //prevent from breaking generators if (Arena.getArenaByPlayer(e.getPlayer()) != null) { e.setCancelled(true); } //prevent ...
vuln
Safe
Java
static MagickBooleanType ReadDXT1(Image *image, DDSInfo *dds_info, ExceptionInfo *exception) { DDSColors colors; PixelPacket *q; register ssize_t i, x; size_t bits; ssize_t j, y; unsigned char code; unsigned short c0, c1; for (y = 0; y < (ssize_t) dds_inf...
vuln
Vulnerable
C/C++
static Image *ReadTIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define ThrowTIFFException(severity,message) \ { \ if (tiff_pixels != (unsigned char *) NULL) \ tiff_pixels=(unsigned char *) RelinquishMagickMemory(tiff_pixels); \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info...
vuln
Safe
C/C++
long keyctl_join_session_keyring(const char __user *_name) { char *name; long ret; /* fetch the name from userspace */ name = NULL; if (_name) { name = strndup_user(_name, KEY_MAX_DESC_SIZE); if (IS_ERR(name)) { ret = PTR_ERR(name); goto error; } } /* join the session */ ret = join_session_keyring...
vuln
Vulnerable
Unknown
void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { variableLength *vl; variableLength *filename; gint index; gchar *ifilename; gchar *absfilename, *file; gchar *charptr, *charptr2; dtr thedate; FILE *fptr; DWORD *dword_ptr; DWORD dword_val; vl = MAPIFindProperty (&(tn...
vuln
Safe
Unknown
static int fuse_rmdir(struct inode *dir, struct dentry *entry) { int err; struct fuse_mount *fm = get_fuse_mount(dir); FUSE_ARGS(args); args.opcode = FUSE_RMDIR; args.nodeid = get_node_id(dir); args.in_numargs = 1; args.in_args[0].size = entry->d_name.len + 1; args.in_args[0].value = entry->d_name.name; err =...
vuln
Vulnerable
Unknown
dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, size_t size, off_t fsize, int *flags) { Elf32_Phdr ph32; Elf64_Phdr ph64; size_t offset, len; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; if (size != xph_sizeof) { if (file_printf(ms, ", corrupted program header size") == -1...
vuln
Safe
C/C++
static void rxrpc_unbundle_conn(struct rxrpc_connection *conn) { struct rxrpc_bundle *bundle = conn->bundle; struct rxrpc_local *local = bundle->params.local; unsigned int bindex; bool need_drop = false, need_put = false; int i; _enter("C=%x", conn->debug_id); if (conn->flags & RXRPC_CONN_FINAL_ACK_MASK) rxr...
vuln
Vulnerable
C/C++
CPUState *mon_get_cpu(void) { if (!cur_mon->mon_cpu) { monitor_set_cpu(0); } cpu_synchronize_state(cur_mon->mon_cpu); return cur_mon->mon_cpu; }
vuln
Vulnerable
C/C++
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size) { int ret = 0; uint8_t *p = *buf; int64_t len = 0; while (bytestream2_get_bytes_left(gb) > 2) { uint8_t s = bytestream2_get_byte(gb); if (s < LZF_LITERAL_MAX) { s++; if (s > *size - len) ...
vuln
Vulnerable
C/C++
import base64 import simplejson import cgi from twisted.web import server, resource from twisted.application import internet from twisted.web.server import Site, GzipEncoderFactory import twisted.web.resource from twisted.web.resource import Resource, EncodingResourceWrapper, \ Forbidd...
vuln
Vulnerable
Python
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #ifndef WIN32 #include <arpa/inet.h> #include <netinet/in.h> #include <signal.h> #endif #include <errno.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/sta...
vuln
Safe
C/C++
e_ews_autodiscover_ws_url (ESource *source, CamelEwsSettings *settings, const gchar *email_address, const gchar *password, GCancellable *cancellable, GAsyncReadyCallback callback, ...
vuln
Vulnerable
Unknown
public function testOnKernelResponseListenerRemovesItself() { $session = $this->createMock(SessionInterface::class); $session->expects($this->any())->method('getName')->willReturn('SESSIONNAME'); $tokenStorage = $this->createMock(TokenStorageInterface::class); $dispatcher = $this->cr...
vuln
Safe
PHP
public static ItemType fromString(String typeStr) { try { return ItemType.valueOf(typeStr.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException e) { return null; } }
vuln
Vulnerable
Java
public void obtainCertificates() { HttpUriRequest request = RequestBuilder.post() .setUri(MOJANG_ENDPOINT + "/player/certificates") .setHeader(HttpHeaders.CONTENT_TYPE, "application/json") .setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + authData.getAccessToken()...
vuln
Vulnerable
Java
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert, BIO *dcont, BIO *out, unsigned int flags) { int r; BIO *cont; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_enveloped) { CMSerr(CMS_F_CMS_DECRYPT, CMS_R_TYPE_NOT_ENVELOPED_DATA); return 0; } if (!dcont...
vuln
Safe
Unknown
static int output_packet(AVInputStream *ist, int ist_index, AVOutputStream **ost_table, int nb_ostreams, const AVPacket *pkt) { AVFormatContext *os; AVOutputStream *ost; uint8_t *ptr; int len, ret, i; uint8_t *data_buf; int data_size, got_picture...
vuln
Vulnerable
C/C++
/* GStreamer ASF/WMV/WMA demuxer * Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu> * Copyright (C) 2006-2009 Tim-Philipp Müller <tim centricular net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the...
vuln
Vulnerable
C/C++
static void cmd_anal_esil(RCore *core, const char *input) { RAnalEsil *esil = core->anal->esil; ut64 addr = core->offset; ut64 adr ; char *n, *n1; int off; int stacksize = r_config_get_i (core->config, "esil.stack.depth"); int iotrap = r_config_get_i (core->config, "esil.iotrap"); int romem = r_config_get_i (co...
vuln
Vulnerable
Unknown
int dtls1_accept(SSL *s) { BUF_MEM *buf; unsigned long l,Time=(unsigned long)time(NULL); void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state,skip=0; int listen; RAND_add(&Time,sizeof(Time),0); ERR_clear_error(); clear_sys_error(); if (s->info_callback != NULL) cb=s->info_ca...
vuln
Vulnerable
Unknown
@EventHandler public void onPlayerMove(PlayerMoveEvent e) { // Check when a player changes chunk if (!e.getFrom().getChunk().equals(e.getTo().getChunk())) { ClaimCache claims = HuskTowns.getClaimCache(); if (claims.isUpdating()) { return; } ...
vuln
Safe
Java