code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static void usb_ehci_pci_exit(PCIDevice *dev) { EHCIPCIState *i = PCI_EHCI(dev); static void usb_ehci_pci_reset(DeviceState *dev) { PCIDevice *pci_dev = PCI_DEVICE(dev); EHCIPCIState *i = PCI_EHCI(pci_dev); EHCIState *s = &i->ehci; ehci_reset(s); } static void usb_ehci_pci_write_config(PCIDevice...
vuln
Vulnerable
Unknown
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == Activity.RESULT_OK && data != null) { Uri uri = data.getData(); try { InputStream inputStream = get...
vuln
Vulnerable
Java
int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *msgf, unsigned long long *body_len) { struct ist phdr_val[H2_PHDR_NUM_ENTRIES]; uint32_t fields; /* bit mask of H2_PHDR_FND_* */ uint32_t idx; int phdr; int ret; int i; uint32_t used = htx_used_space(htx); struct htx_sl *sl = NULL; ...
vuln
Safe
Unknown
Status GetDeviceForInput(const EagerOperation& op, const EagerContext& ctx, TensorHandle* tensor_handle, Device** result) { Device* cpu_device = ctx.HostCPU(); string device_name; if (tensor_handle->Type() != TensorHandle::LOCAL) { Device* device = tensor_handle->device(); device_...
vuln
Safe
C/C++
static void object_set_link_property(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { Object **child = opaque; bool ambiguous = false; const char *type; char *path; type = object_property_get_type(obj, name, NULL); visit_type_str(v, &p...
vuln
Vulnerable
C/C++
/* * cros_ec_dev - expose the Chrome OS Embedded Controller to user-space * * Copyright (C) 2014 Google, Inc. * * 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 2 of the Lic...
vuln
Vulnerable
C/C++
bool Vp9Parser::ParseUncompressedHeader(const uint8_t* stream, bool Vp9Parser::ParseUncompressedHeader(Vp9FrameHeader* fhdr) { reader_.Initialize(stream_, size_); if (reader_.ReadLiteral(2) != 0x2) return false; fhdr->profile = ReadProfile(); if (fhdr->profile >= kVp9MaxProfile) { DVLOG(1) << "Unsup...
vuln
Safe
C/C++
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
vuln
Safe
Java
/* 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 ...
vuln
Vulnerable
C/C++
generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { struct address_space *mapping = out->f_mapping; struct inode *inode = mapping->host; ssize_t ret; int err; err = should_remove_suid(out->f_dentry); if (unlikely(err)) { mutex_lock(&ino...
vuln
Safe
Unknown
def _parse_constraint(self, element): ''' Parse csw:Constraint ''' query = {} tmp = element.find(util.nspath_eval('ogc:Filter', self.parent.context.namespaces)) if tmp is not None: LOGGER.debug('Filter constraint specified.') try: query['type'] =...
vuln
Vulnerable
Python
function j(t){h("emit readable"),t.emit("readable"),A(t)}
vuln
Vulnerable
JavaScript
void JingleSessionManager::Close() { DCHECK(CalledOnValidThread()); if (!closed_) { cricket_session_manager_->RemoveClient(kChromotingXmlNamespace); jingle_signaling_connector_.reset(); closed_ = true; } }
vuln
Safe
C/C++
public void handle(HttpServletRequest request, final HttpServletResponse response) throws Exception { // We're sending an XML response, so set the response content type to text/xml response.setContentType("text/xml"); // Parse the incoming request as XML SAXReader xmlReader = XML.getSafeSaxRead...
vuln
Safe
Java
"""Meta related things.""" from collections import namedtuple import re RE_VER = re.compile( r'''(?x) (?P<major>\d+)(?:\.(?P<minor>\d+))?(?:\.(?P<micro>\d+))? (?:(?P<type>a|b|rc)(?P<pre>\d+))? (?:\.post(?P<post>\d+))? (?:\.dev(?P<dev>\d+))? ''' ) REL_MAP = { ".dev": "", ".dev-alpha": "...
vuln
Safe
Python
public void saveFile(MainWindow mainWindow) { desktop = mainWindow.getDesktop(); File configFile = new File(SimulationFiles.getSaveDir(), FILE_NAME); // Create save directory if it doesn't exist. if (!configFile.getParentFile().exists()) { configFile.getParentFile().mkdirs(); logger.config(SimulationF...
vuln
Vulnerable
Java
void GDataDirectoryService::InitializeRootEntry(const std::string& root_id) { root_.reset(CreateGDataDirectory()); root_->set_title(kGDataRootDirectory); root_->SetBaseNameFromTitle(); root_->set_resource_id(root_id); AddEntryToResourceMap(root_.get()); }
vuln
Safe
C/C++
NotificationEntry getEntry(String key) { return mNotificationSet.get(key); }
vuln
Vulnerable
Java
public List<SystemError> getSystemErrors() { return systemErrors; }
vuln
Vulnerable
Java
static int find_start_code(const uint8_t **pbuf_ptr, const uint8_t *buf_end) { const uint8_t *buf_ptr= *pbuf_ptr; buf_ptr++; buf_end -= 2; while (buf_ptr < buf_end) { if(*buf_ptr==0){ while(buf_ptr < buf_end && buf_ptr[1]==0) buf_ptr++; if(buf_ptr[-1] ==...
vuln
Vulnerable
C/C++
@Override public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext) { AuthenticationMechanismOutcome outcome = wrapped.authenticate(exchange, securityContext); LOGGER.debug(wrapped.getMechanismName() ...
vuln
Vulnerable
Java
public void init(File sqlFile, String sqlDefsSection, Connection conn, Map<String, String> configParameters) throws Exception { // Parse the sqlFile as an XML document. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); ...
vuln
Vulnerable
Java
func (mbox *Mailbox) newClient() (*client.Client, error) { var imapClient *client.Client var err error if mbox.TLS { config := new(tls.Config) config.InsecureSkipVerify = mbox.IgnoreCertErrors imapClient, err = client.DialTLS(mbox.Host, config) } else { imapClient, err = client.Dial(mbox.Host) } if err !=...
vuln
Vulnerable
Go
void red_channel_pipes_add_empty_msg(RedChannel *channel, int msg_type) { RingItem *link, *next; RING_FOREACH_SAFE(link, next, &channel->clients) { red_channel_client_pipe_add_empty_msg( SPICE_CONTAINEROF(link, RedChannelClient, channel_link), msg_type); } }
vuln
Safe
C/C++
parsePath (rawPath, opts = {}) { let pathObj = { locale: WIKI.config.lang.code, path: 'home', private: false, privateNS: '', explicitLocale: false } // Clean Path rawPath = _.trim(qs.unescape(rawPath)) if (_.startsWith(rawPath, '/')) { rawPath = rawPath.substring(1) } ...
vuln
Vulnerable
JavaScript
static Image *ReadOneJNGImage(MngInfo *mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { Image *alpha_image, *color_image, *image, *jng_image; ImageInfo *alpha_image_info, *color_image_info; MagickBooleanType logging; int unique_filenames; ssize_t y...
vuln
Vulnerable
Unknown
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) { UINT8* ptr; int framesize; int c, chunks; int l, lines; int i, j, x = 0, y, ymax; /* If not even the chunk size is present, we'd better leave */ if (bytes < 4) return 0; /* We don't decode anything unless ...
vuln
Safe
C/C++
DidFinishNavigation(NavigationHandle* handle) {
vuln
Safe
C/C++
long AudioTrack::Parse( Segment* pSegment, const Info& info, long long element_start, long long element_size, AudioTrack*& pResult) { if (pResult) return -1; if (info.type != Track::kAudio) return -1; IMkvReader* const pReader = pSegment->m_pReader; const Settin...
vuln
Vulnerable
C/C++
bool Unpack::ProcessDecoded(UnpackThreadData &D) { UnpackDecodedItem *Item=D.Decoded,*Border=D.Decoded+D.DecodedSize; while (Item<Border) { UnpPtr&=MaxWinMask; if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr) { UnpWriteBuf(); if (WrittenFileSize>DestUnpSize) ...
vuln
Vulnerable
C/C++
void bn_rec_slw(uint8_t *win, int *len, const bn_t k, int w) { int i, j, l, s; l = bn_bits(k); if (*len < l) { *len = 0; RLC_THROW(ERR_NO_BUFFER); return; } memset(win, 0, *len); i = l - 1; j = 0; while (i >= 0) { if (!bn_get_bit(k, i)) { i--; win[j++] = 0; } else { s = RLC_MAX(i - w + 1,...
vuln
Vulnerable
C/C++
public void initializeFeatureManager() { this.getFeatures().forEach(feature -> feature.setState(false)); this.getFeatures().clear(); //TODO: better method of doing this without a library Reflections reflections = new Reflections("me.dustin.jex.feature.mod.impl"); Set<Class<? ext...
vuln
Vulnerable
Java
nv_replace(cmdarg_T *cap) { char_u *ptr; int had_ctrl_v; long n; if (checkclearop(cap->oap)) return; #ifdef FEAT_JOB_CHANNEL if (bt_prompt(curbuf) && !prompt_curpos_editable()) { clearopbeep(cap->oap); return; } #endif // get another character if (cap->nchar == Ctrl_V) { h...
vuln
Vulnerable
C/C++
static target_ulong helper_udiv_common(target_ulong a, target_ulong b, int cc) { int overflow = 0; uint64_t x0; uint32_t x1; x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32); x1 = (b & 0xffffffff); if (x1 == 0) { raise_exception(TT_DIV_ZERO); } x0 = x0 / x1; if (x0 > 0xffff...
vuln
Safe
C/C++
/** * @file * POP network mailbox * * @authors * Copyright (C) 2000-2002 Vsevolod Volkov <vvv@mutt.org.ua> * Copyright (C) 2006-2007,2009 Rocco Rutte <pdmef@gmx.net> * * @copyright * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as ...
vuln
Vulnerable
C/C++
static char *lxclock_name(const char *p, const char *n) { int ret; int len; char *dest; char *rundir; /* lockfile will be: * "/run" + "/lxc/lock/$lxcpath/$lxcname + '\0' if root * or * $XDG_RUNTIME_DIR + "/lxc/lock/$lxcpath/$lxcname + '\0' if non-root */ /* length of "/lxc/lock/" + $lxcpath + "/" ...
vuln
Safe
C/C++
static void cal_coef(errmod_t *em, double depcorr, double eta) { int k, n, q; long double sum, sum1; double *lC; // initialize ->fk em->fk = (double*)calloc(256, sizeof(double)); em->fk[0] = 1.0; for (n = 1; n < 256; ++n) em->fk[n] = pow(1. - depcorr, n) * (1.0 - eta) + eta; //...
vuln
Vulnerable
C/C++
@Override public boolean overrideStackedOnOther(ItemStack bundle, Slot slot, ClickAction clickType, Player player) { if (player.containerMenu instanceof ChestMenu && !(slot.container instanceof Inventory)) { return false; // don't allow inside ender chest inventory } else if ...
vuln
Vulnerable
Java
@Override protected void refresh() { for (LocalBluetoothProfile profile : getProfiles()) { if (profile != null && !profile.isProfileReady()) { continue; } SwitchPreference pref = mProfilesContainer.findPreference( profile.toString()); ...
vuln
Safe
Java
static int xmv_read_header(AVFormatContext *s) { XMVDemuxContext *xmv = s->priv_data; AVIOContext *pb = s->pb; AVStream *vst = NULL; uint32_t file_version; uint32_t this_packet_size; uint16_t audio_track; int ret; avio_skip(pb, 4); this_packet_size = avio_rl32(pb); a...
vuln
Vulnerable
C/C++
static void decode_abs_store(CPUTriCoreState *env, DisasContext *ctx) { int32_t op2; int32_t r1; uint32_t address; TCGv temp; r1 = MASK_OP_ABS_S1D(ctx->opcode); address = MASK_OP_ABS_OFF18(ctx->opcode); op2 = MASK_OP_ABS_OP2(ctx->opcode); temp = tcg_const_i32(EA_ABS_FORMAT(address)); ...
vuln
Vulnerable
C/C++
def _clone( cls, git: "Git", url: PathLike, path: PathLike, odb_default_type: Type[GitCmdObjectDB], progress: Union["RemoteProgress", "UpdateProgress", Callable[..., "RemoteProgress"], None] = None, multi_options: Optional[List[str]] = None, allow_unsafe_p...
vuln
Vulnerable
Python
EXTENSIONS['.' + ext] = (module, filename, dirname) => { if (vm.options.require.context !== 'sandbox') { try { module.exports = Contextify.readonly(host.require(filename)); } catch (e) { throw Contextify.value(e); } } else { let script; try { // Load module let contents = ...
vuln
Vulnerable
JavaScript
int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) { struct bonding *bond = netdev_priv(bond_dev); const struct net_device_ops *slave_ops = slave_dev->netdev_ops; struct slave *new_slave = NULL; struct netdev_hw_addr *ha; struct sockaddr addr; int link_reporting; int res = 0; if (!bond...
vuln
Vulnerable
Unknown
package com.databasir.core.domain.database.service; import com.databasir.core.domain.DomainErrors; import com.databasir.core.domain.database.converter.DatabaseTypePojoConverter; import com.databasir.core.domain.database.data.*; import com.databasir.core.infrastructure.connection.DatabaseTypes; import com.databasir.cor...
vuln
Safe
Java
get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading text-format PGM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr) sinfo; FILE * infile = source->pub.input_file; register JSAMPROW ptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col;...
vuln
Vulnerable
Unknown
static void amdvi_realize(DeviceState *dev, Error **err) { int ret = 0; AMDVIState *s = AMD_IOMMU_DEVICE(dev); X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); PCIBus *bus = PC_MACHINE(qdev_get_machine())->bus; s->iotlb = g_hash_table_new_full(amdvi_uint64_hash, ...
vuln
Vulnerable
C/C++
static int protocol_client_auth_sasl_start_len(VncState *vs, uint8_t *data, size_t len) { uint32_t startlen = read_u32(data, 0); if (startlen > SASL_DATA_MAX_LEN) { trace_vnc_auth_fail(vs, vs->auth, "SASL start len too large", ""); vnc_client_error(vs); return -1; } if (startlen ...
vuln
Safe
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
static int ieee80211_fragment(struct ieee80211_tx_data *tx, struct sk_buff *skb, int hdrlen, int frag_threshold) { struct ieee80211_local *local = tx->local; struct ieee80211_tx_info *info; struct sk_buff *tmp; int per_fragm = frag_threshold - hdrlen - FCS_LEN; int pos = hdrlen + per_fragm; int ...
vuln
Vulnerable
C/C++
@Override protected HttpProblem toProblem(UnauthorizedException exception) { return HttpUnauthorizedUtils.toProblem(currentVertxRequest().getCurrent(), exception) .await().indefinitely(); }
vuln
Safe
Java
/************************************************************************** * * Copyright (c) 2000-2003 Intel Corporation * All rights reserved. * Copyright (c) 2012 France Telecom All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provid...
vuln
Safe
C/C++
static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int rn, uint8 *do_not_decode) { int i,j,pass; Residue *r = f->residue_config + rn; int rtype = f->residue_types[rn]; int c = r->classbook; int classwords = f->codebooks[c].dimensions; unsigned int actual_size = rtype ==...
vuln
Safe
C/C++
def bootstrap_tls( config, init_system, dns_name, fs_id, mountpoint, options, state_file_dir=STATE_FILE_DIR, fallback_ip_address=None, ): tls_port_sock = choose_tls_port_and_get_bind_sock(config, options, state_file_dir) tls_port = get_tls_port_from_sock(tls_port_sock) try: ...
vuln
Safe
Python
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #define DEBUG_TYPE "vm" #include "hermes/VM/Interpreter.h" #include "hermes/VM/Runtime.h" #include "hermes/Inst/InstDecode.h" #inc...
vuln
Vulnerable
JavaScript
protected void compressFile(final FileCacheEntry entry) { try { final File tmpCompressedFile = File.createTempFile(String.valueOf(entry.plainFile.hashCode()), ".tmpzip", compressedFilesFolder); tmpCompressedFile.deleteOnExit(); InputStream in = null; OutputStream...
vuln
Vulnerable
Java
// Copyright 2014 Manu Martinez-Almeida. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package gin import ( "fmt" "html/template" "net" "net/http" "net/url" "os" "path" "strings" "sync" "github.com/gin-gonic/gin/internal/bytesco...
vuln
Vulnerable
Go
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2017-2020 * All rights reserved * * This file is part of GPAC / NHML stream to file filter * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser G...
vuln
Safe
C/C++
set_routerstatus_from_routerinfo(routerstatus_t *rs, routerinfo_t *ri, time_t now, int naming, int listbadexits, int listbaddirs, int vote_on_hsdirs) { const or_options_t *options = get_options(); int unstable_version...
vuln
Safe
C/C++
@Path("/{group-id}/schemas/{schema-id}") @POST @Produces({"application/json;format=avro", "application/json;format=protobuf"}) @Consumes("application/json;format=avro") @Authorized CompletionStage<SchemaId> createSchema(@PathParam("group-id") String groupId, @PathParam("schema-id") String schemaId, Inpu...
vuln
Safe
Java
void fp12_exp_cyc_sps(fp12_t c, const fp12_t a, const int *b, size_t len, int sign) { size_t i, j, k, w = len; fp12_t t, *u = RLC_ALLOCA(fp12_t, w); if (len == 0) { RLC_FREE(u); fp12_set_dig(c, 1); return; } fp12_null(t); RLC_TRY { if (u == NULL) { RLC_THROW(ERR_NO_MEMORY); } for (i = 0; i ...
vuln
Safe
C/C++
function defaultsDeep(target, objects) { target = target || {}; function copy(target, current) { lazy.forOwn(current, function (value, key) { var val = target[key]; // add the missing property, or allow a null property to be updated if (val == null) { target[key] = value; } else...
vuln
Vulnerable
JavaScript
static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER) { const unsigned char *cursor, *limit, *marker, *start; zval *rval_ref; limit = max; cursor = *p; if (YYCURSOR >= YYLIMIT) { return 0; } if (var_hash && (*p)[0] != 'R') { var_push(var_hash, rval); } start = cursor; #line 576 "ext/standard...
vuln
Safe
Unknown
int dd_exist(const struct dump_dir *dd, const char *path) { char *full_path = concat_path_file(dd->dd_dirname, path); int ret = exist_file_dir(full_path); free(full_path); return ret; }
vuln
Vulnerable
C/C++
void cJSON_AddItemToObject( cJSON *object, const char *string, cJSON *item ) { if ( ! item ) return; if ( item->string ) cJSON_free( item->string ); item->string = cJSON_strdup( string ); cJSON_AddItemToArray( object, item ); }
vuln
Vulnerable
C/C++
cmsPipeline* BlackPreservingKOnlyIntents(cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number TheIntents[], cmsHPROFILE hProfiles[], ...
vuln
Safe
Unknown
static int service_serialize(Unit *u, FILE *f, FDSet *fds) { Service *s = SERVICE(u); ServiceFDStore *fs; int r; assert(u); assert(f); assert(fds); unit_serialize_item(u, f, "state", service_state_to_string(s->state)); unit_serialize_item(u, f, "result",...
vuln
Vulnerable
C/C++
int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey) { EVP_MD_CTX ctx; const EVP_MD *type; unsigned char *p,*buf_in=NULL; int ret= -1,i,inl; EVP_MD_CTX_init(&ctx); i=OBJ_obj2nid(a->algorithm); type=EVP_get_digestbyname(OBJ_nid2sn(i)); if (type == NULL) {...
vuln
Safe
Unknown
QStringList JlCompress::extractDir(QuaZip &zip, const QString &dir) { if(!zip.open(QuaZip::mdUnzip)) { return QStringList(); } QDir directory(dir); QStringList extracted; if (!zip.goToFirstFile()) { return QStringList(); } do { QString name = zip.getCurrentFileName()...
vuln
Vulnerable
C/C++
default boolean sameAs(Notification.MessagingStyle.Message message) { Notification.MessagingStyle.Message ownMessage = getMessage(); // We have to make sure both messages are not null to go further comparison if (message == null || ownMessage == null) { return message == ownMessage; ...
vuln
Safe
Java
static pyc_object *get_set_object(RBuffer *buffer) { pyc_object *ret = NULL; bool error = false; ut32 n = get_ut32 (buffer, &error); if (n > ST32_MAX) { eprintf ("bad marshal data (set size out of range)\n"); return NULL; } if (error) { return NULL; } ret = get_array_object_generic (buffer, n); if (!ret)...
vuln
Vulnerable
C/C++
IHEVCD_ERROR_T ihevcd_parse_pps(codec_t *ps_codec) { IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; WORD32 value; WORD32 pps_id; pps_t *ps_pps; sps_t *ps_sps; bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm; if(0 == ps_codec->i4_sps_done) return IHEVCD_INVALID_HEADER; UEV_PARSE("pic_...
vuln
Safe
C/C++
public void renderTooltip(PoseStack matrices, int mouseX, int mouseY) { int checkX = mouseX - screen.leftPos; int checkY = mouseY - screen.topPos; if (isHovered(checkX, checkY)) { FluidStack fluid = tank.getFluidInTank(TANK_INDEX); int amount = fluid.getAmount(); int capacity = tank.getTa...
vuln
Vulnerable
Java
def request_password_change(email, is_secure): """Email a single-use link for performing a password reset. Users must confirm the password change before we update their information. Args: email (str): An email address orig_host (str): An originating host, extracted from a request with get_...
vuln
Safe
Python
list_fields(MYSQL *mysql,const char *db,const char *table, const char *wild) { char query[NAME_LEN + 100]; int len; MYSQL_RES *result; MYSQL_ROW row; ulong UNINIT_VAR(rows); if (mysql_select_db(mysql,db)) { fprintf(stderr,"%s: Cannot connect to db: %s: %s\n",my_progname,db, mysql_error(mysq...
vuln
Safe
C/C++
int SuspendThreadAndRecordStack(HANDLE thread_handle, int max_stack_size, const void* instruction_pointers[]) { Win32StackFrameUnwinder frame_unwinder; //// ScopedSuspendThread -------------------------------------------------------- //// Suspends a thread for the lifetime of the objec...
vuln
Vulnerable
C/C++
public boolean queue(@Nullable ByteBuffer buffer) { UsbDeviceConnection connection = mConnection; if (connection == null) { // The expected exception by CTS Verifier - USB Device test throw new IllegalStateException("invalid connection"); } // Calling into the un...
vuln
Safe
Java
cmsPipeline* DefaultICCintents(cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number TheIntents[], cmsHPROFILE hProfiles[], cmsBool BPC[], ...
vuln
Vulnerable
C/C++
int _pam_parse(int argc, const char **argv) { int ctrl = 0; const char *current_secret = NULL; /* otherwise the list will grow with each call */ memset(tac_srv, 0, sizeof(tacplus_server_t) * TAC_PLUS_MAXSERVERS); memset(&tac_srv_addr, 0, sizeof(struct addrinfo) * TAC_PLUS_MAXSERVERS); memset(&t...
vuln
Vulnerable
C/C++
# -*- coding: utf-8 -*- import hashlib import os from ..utils.struct.style import style # TODO: rewrite using scrypt or argon2_cffi def _salted_password(password, salt): dk = hashlib.pbkdf2_hmac("sha256", password.encode(), bytes.fromhex(salt), 100000) return salt + dk.hex() def _gensalt(): return os....
vuln
Vulnerable
Python
static void pointer_event(VncState *vs, int button_mask, int x, int y) { static uint32_t bmap[INPUT_BUTTON_MAX] = { [INPUT_BUTTON_LEFT] = 0x01, [INPUT_BUTTON_MIDDLE] = 0x02, [INPUT_BUTTON_RIGHT] = 0x04, [INPUT_BUTTON_WHEEL_UP] = 0x08, [INPUT_BUTTON_WHEEL_DOWN...
vuln
Vulnerable
Unknown
add_mtab(char *devname, char *mountpoint, unsigned long flags) { int rc = 0; uid_t uid; char *mount_user = NULL; struct mntent mountent; FILE *pmntfile; sigset_t mask, oldmask; uid = getuid(); if (uid != 0) mount_user = getusername(uid); /* * Set the real uid to the effective uid. This prevents unprivile...
vuln
Safe
Unknown
test func() }{ { "params disabled", func() { params := suite.app.ClaimsKeeper.GetParams(suite.ctx) params.EnableClaims = false suite.app.ClaimsKeeper.SetParams(suite.ctx, params) resAck := suite.app.ClaimsKeeper.OnRecvPacket(suite.ctx, mockpacket, ack) suite.Require().Equal(ack, resAck) ...
vuln
Vulnerable
Go
/* * * Copyright 2019 Asylo 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 agree...
vuln
Safe
C/C++
static int generate_key(DH *dh) { int ok = 0; int generate_new_key = 0; unsigned l; BN_CTX *ctx; BN_MONT_CTX *mont = NULL; BIGNUM *pub_key = NULL, *priv_key = NULL; ctx = BN_CTX_new(); if (ctx == NULL) goto err; if (dh->priv_key == NULL) { priv_key = BN_new(); ...
vuln
Vulnerable
Unknown
__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
vuln
Safe
C/C++
GF_Err trak_box_size(GF_Box *s) { u32 pos=0; GF_TrackBox *ptr = (GF_TrackBox *)s; if (ptr->sample_encryption && ptr->sample_encryption->load_needed) { if (!ptr->moov || !!ptr->moov->mov || !ptr->moov->mov->movieFileMap) return GF_ISOM_INVALID_FILE; GF_Err e = senc_Parse(ptr->moov->mov->movieFileMap->bs, ptr,...
vuln
Safe
C/C++
public function delete($fileName = null) { $this->validateFileName(); list($name, $extension) = $this->model->getFileNameParts(); return $this->datasource->delete( $this->model->getObjectTypeDirName(), $name, $extension ); }
vuln
Vulnerable
PHP
public void onUpdate() { if (mc.player.ridingEntity != null && boatFix.getValue()){ mc.player.ridingEntity.rotationYaw = mc.player.rotationYaw; } if (guiMove.getValue() && mc.currentScreen != null) { if (!(mc.currentScreen instanceof GuiChat)) { ...
vuln
Vulnerable
Java
@Override protected void renew() { setList(); if (editable && svp != null) { Replay r = getSelection(); Stage ns = svp.getStage(); if (r != null && ns != null) { if (r.st != null) { if (ns != r.st.get() && Opts.conf("are you sure to change stage?")) { r.st = ns.id; r.marked = true; ...
vuln
Safe
Java
const bootbox = require('bootbox'); require('./Requisitions'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; angular.module('onms-requisitions') /** * @ngdoc service * @name SynchronizeService * @module onms-requisitions *...
vuln
Vulnerable
Java
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; TXDContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; unsigned int version, w, h, d3d_format, d...
vuln
Vulnerable
C/C++
void SpatialMaxPool(OpKernelContext* context, Tensor* output, const Tensor& tensor_in, const PoolParameters& params, const Padding& padding) { // On GPU, use Eigen's Spatial Max Pooling. On CPU, use an // EigenMatrix version that is currently faster than Eigen's ...
vuln
Vulnerable
Unknown
static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2, TCGv addr, int size) { TCGv tmp; int done_label; int fail_label; fail_label = gen_new_label(); done_label = gen_new_label(); tcg_gen_brcond_i32(TCG_COND_NE, addr, cpu_exclusive_addr, fa...
vuln
Vulnerable
C/C++
protected void stopScanningAndPopErrorDialog(ERROR_DIALOG_TYPE type) { dismissDialogs(); // Throws error dialog. final NetworkRequestErrorDialogFragment dialogFragment = NetworkRequestErrorDialogFragment.newInstance(); dialogFragment.setRejectCallback(mUserSelectionCallb...
vuln
Vulnerable
Java
IW_IMPL(unsigned int) iw_get_ui32be(const iw_byte *b) { return ((unsigned int)b[0]<<24) | ((unsigned int)b[1]<<16) | ((unsigned int)b[2]<<8) | (unsigned int)b[3]; }
vuln
Safe
C/C++
int apparmor_bprm_set_creds(struct linux_binprm *bprm) { struct aa_task_cxt *cxt; struct aa_profile *profile, *new_profile = NULL; struct aa_namespace *ns; char *buffer = NULL; unsigned int state; struct file_perms perms = {}; struct path_cond cond = { bprm->file->f_path.dentry->d_inode->i_uid, bprm->file->f...
vuln
Safe
Unknown
tty_open(struct tty *tty, char **cause) { tty->term = tty_term_find(tty->term_name, tty->fd, cause); if (tty->term == NULL) { tty_close(tty); return (-1); } tty->flags |= TTY_OPENED; tty->flags &= ~(TTY_NOCURSOR|TTY_FREEZE|TTY_BLOCK|TTY_TIMER); event_set(&tty->event_in, tty->fd, EV_PERSIST|EV_READ, tty...
vuln
Vulnerable
Unknown
static ecma_value_t ecma_builtin_json_internalize_property (ecma_object_t *reviver_p, /**< reviver function */ ecma_object_t *holder_p, /**< holder object */ ecma_string_t *name_p) /**< property name */ { JERRY_ASSERT (reviver_p); JERRY...
vuln
Safe
C/C++
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
vuln
Vulnerable
Java