code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
future<fragmented_temporary_buffer> cql_server::connection::read_and_decompress_frame(size_t length, uint8_t flags) { using namespace compression_buffers; if (flags & cql_frame_flags::compression) { if (_compression == cql_compression::lz4) { if (length < 4) { throw std::runt...
vuln
Safe
Unknown
0<fa.length&&b.pickFolder(b.mode,function(sa){b.createFile(fa,Q,null!=T&&0<T.length?T:null,null,function(){b.hideDialog()},null,sa,null,null!=P&&0<P.length?P:null)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}function u(fa,sa,xa,wa,ua,va,ia){null!=S&&(S.style.backgroundColor="transparent",S.s...
vuln
Vulnerable
JavaScript
@Override public List<IWrapperEntity> attackEntities(Damage damage, Point3D motion, boolean generateList) { AxisAlignedBB mcBox = damage.box.convert(); List<Entity> collidedEntities; //Get collided entities. if (motion != null) { mcBox = mcBox.expand(motion.x, motion.y, ...
vuln
Safe
Java
GACommandState *ga_command_state_new(void) { GACommandState *cs = g_new0(GACommandState, 1); cs->groups = NULL; return cs; }
vuln
Safe
C/C++
@Override protected void onResume() { super.onResume(); progressIndicator.show(); new Thread(() -> model.loadProfiles()).start(); }
vuln
Vulnerable
Java
public List<Message> getMessages(Long createdAt, String searchText, Integer parentGroupKey) { if (parentGroupKey != null && parentGroupKey != 0) { return getLatestGroupMessages(createdAt, searchText, parentGroupKey); } else { Cursor cursor = null; SQLiteDatabase db =...
vuln
Vulnerable
Java
function w(e,t,n){var r=e.name;if(C.$empty[r]||!e.children.length)r=="hr"&&t=="br"?e.replaceWith(y()):(e.parent&&n.push({check:"it",el:e.parent}),e.remove());else if(C.$block[r]||r=="tr")if(t=="br")e.previous&&!b(e.previous)&&(t=y(),t.insertBefore(e)),e.next&&!b(e.next)&&(t=y(),t.insertAfter(e)),e.replaceWithChildren()...
vuln
Safe
JavaScript
package com.salesmanager.shop.admin.model.orders; import java.io.Serializable; public class Refund implements Serializable { /** * */ private static final long serialVersionUID = 2392736671094915447L; private Long orderId; private String amount; public Long getOrderId() { return orderId; } public void...
vuln
Vulnerable
Java
@Override public void onCreate() { super.onCreate(); appRecorder = ARApplication.getInjector().provideAppRecorder(); colorMap = ARApplication.getInjector().provideColorMap(); fileRepository = ARApplication.getInjector().provideFileRepository(); appRecorderCallback = new AppRecorderCallback() { // int prev...
vuln
Vulnerable
Java
public static boolean isLocal(String url){ return url != null && !url.startsWith("http://") && !url.startsWith("https://"); }
vuln
Safe
Java
# Copyright 2014-2016 OpenMarket Ltd # # 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 w...
vuln
Safe
Python
def _get_conn_config_mysql_client(self, conn: Connection) -> dict: conn_config = { "user": conn.login, "passwd": conn.password or "", "host": conn.host or "localhost", "db": self.schema or conn.schema or "", } # check for authentication via AWS IA...
vuln
Vulnerable
Python
private Collection<String> getRoles(UserDetails user) { return user.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.toUnmodifiableSet()); }
vuln
Safe
Java
static netdev_features_t bnx2x_features_check(struct sk_buff *skb, struct net_device *dev, netdev_features_t features) { /* * A skb with gso_size + header length > 9700 will cause a * firmware panic. Drop GSO support. * * Eventually the upper layer should not pass these packets down. * ...
vuln
Safe
Unknown
dwg_free_object (Dwg_Object *obj) { int error = 0; long unsigned int j; Dwg_Data *dwg; Bit_Chain *dat = &pdat; if (obj && obj->parent) { dwg = obj->parent; dat->version = dwg->header.version; } else return; if (obj->type == DWG_TYPE_FREED || obj->tio.object == NULL) return; ...
vuln
Vulnerable
Unknown
# -*- coding: utf-8 -*- # # Subscription manager command line utility. # # Copyright (c) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or...
vuln
Vulnerable
Python
private static void unloadWorld(World world) { persistentEntities.values().removeIf(simplePersistentEntity -> simplePersistentEntity.location.getWorld().equals(world)); }
vuln
Vulnerable
Java
void jswrap_serial_unsetup(JsVar *parent) { if (!jsvIsObject(parent)) return; IOEventFlags device = jsiGetDeviceFromClass(parent); // Populate JshUSARTInfo from serial - if it exists JsVar *options = jsvObjectGetChild(parent, DEVICE_OPTIONS_NAME, 0); JsVar *baud = jsvObjectGetChild(parent, USART_BAUDRATE_NAM...
vuln
Safe
C/C++
/* * Copyright (C) 2012,2013 - ARM Ltd * Author: Marc Zyngier <marc.zyngier@arm.com> * * Derived from arch/arm/kvm/coproc.c: * Copyright (C) 2012 - Virtual Open Systems and Columbia University * Authors: Rusty Russell <rusty@rustcorp.com.au> * Christoffer Dall <c.dall@virtualopensystems.com> * * This ...
vuln
Vulnerable
C/C++
public SerializedInfoflowResults readResults(String fileName) throws XMLStreamException, IOException { SerializedInfoflowResults results = new SerializedInfoflowResults(); InfoflowPerformanceData perfData = null; XMLStreamReader reader = null; try (InputStream in = new FileInputStream(fileName)) { XMLInputF...
vuln
Safe
Java
long vnc_client_read_ws(VncState *vs) { int ret, err; uint8_t *payload; size_t payload_size, header_size; VNC_DEBUG("Read websocket %p size %zd offset %zd\n", vs->ws_input.buffer, vs->ws_input.capacity, vs->ws_input.offset); buffer_reserve(&vs->ws_input, 4096); ret = vnc_client_read_...
vuln
Safe
C/C++
/* * MXF demuxer. * Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com> * * This file is part of FFmpeg. * * FFmpeg 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 Softw...
vuln
Safe
C/C++
rsvg_new_filter_primitive_merge (void) { RsvgFilterPrimitiveMerge *filter; filter = g_new (RsvgFilterPrimitiveMerge, 1); _rsvg_node_init (&filter->super.super, RSVG_NODE_TYPE_FILTER_PRIMITIVE_MERGE); filter->super.result = g_string_new ("none"); filter->super.x.factor = filter->super.y.factor = filt...
vuln
Safe
Unknown
@Override protected void onCreateView (Context context, CustomRecyclerView recyclerView) { this.adapter = new SettingsAdapter(this) { @Override protected void setValuedSetting (ListItem item, SettingView view, boolean isUpdate) { if (item.getId() == R.id.btn_deleteAllRevokedLinks) { ...
vuln
Safe
Java
static void v9fs_write(void *opaque) { ssize_t err; int32_t fid; int64_t off; int32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; offset += p...
vuln
Safe
C/C++
status_t OMXNodeInstance::getParameter( OMX_INDEXTYPE index, void *params, size_t /* size */) { Mutex::Autolock autoLock(mLock); OMX_ERRORTYPE err = OMX_GetParameter(mHandle, index, params); OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index; if (err != OMX_ErrorNoMore) { CLOG_IF_ERR...
vuln
Vulnerable
C/C++
/* * DBD::mysql - DBI driver for the mysql database * * Copyright (c) 2004-2014 Patrick Galbraith * Copyright (c) 2013-2014 Michiel Beijen * Copyright (c) 2004-2007 Alexey Stroganov * Copyright (c) 2003-2005 Rudolf Lippan * Copyright (c) 1997-2003 Jochen Wiedmann * * You may distribute this under th...
vuln
Safe
C/C++
@Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) { if(handIn != InteractionHand.MAIN_HAND) return InteractionResult.PASS; if(!world.isClientSide && world.getBlockEntity(pos) instanceof ArcanePed...
vuln
Safe
Java
static int get_stats(AVCodecContext *avctx, int eos) { #ifdef TH_ENCCTL_2PASS_OUT TheoraContext *h = avctx->priv_data; uint8_t *buf; int bytes; bytes = th_encode_ctl(h->t_state, TH_ENCCTL_2PASS_OUT, &buf, sizeof(buf)); if (bytes < 0) { av_log(avctx, AV_LOG_ERROR, "Error getting first pass st...
vuln
Vulnerable
C/C++
@Override public void onListenerDisconnected() { super.onListenerDisconnected(); sIsConnected = false; mNotificationDotsObserver.unregister(); onNotificationFullRefresh(); }
vuln
Vulnerable
Java
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2008 Semihalf * * (C) Copyright 2000-2004 * DENX Software Engineering * Wolfgang Denk, wd@denx.de * * Updated-by: Prafulla Wadaskar <prafulla@marvell.com> * FIT image specific code abstracted from mkimage.c * some functions added to address abstraction ...
vuln
Vulnerable
C/C++
static int ioreq_parse(struct ioreq *ioreq) { struct XenBlkDev *blkdev = ioreq->blkdev; uintptr_t mem; size_t len; int i; xen_be_printf(&blkdev->xendev, 3, "op %d, nr %d, handle %d, id %" PRId64 ", sector %" PRId64 "\n", ioreq->req.operation, ioreq->req.nr_segments, ioreq->req.handle, io...
vuln
Vulnerable
C/C++
PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf) { const HashSet<Page*>& pages = page->group().pages(); HashSet<Page*>::const_iterator end = pages.end(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { Page* otherPage = *it; if ((deferSelf ...
vuln
Safe
C/C++
public void assignValues(@Nullable List<DataEntry<?>> entries) { if (entries == null) { return; } for (DataEntry<?> entry : entries) { DataEntry<?> currentEntry = this.entries.get(entry.getKey().getId()); if (currentEntry != null) { this.assignValue(currentEntry, entry); } ...
vuln
Safe
Java
static int ax25_release(struct socket *sock) { struct sock *sk = sock->sk; ax25_cb *ax25; ax25_dev *ax25_dev; if (sk == NULL) return 0; sock_hold(sk); lock_sock(sk); sock_orphan(sk); ax25 = sk_to_ax25(sk); ax25_dev = ax25->ax25_dev; if (sk->sk_type == SOCK_SEQPACKET) { switch (ax25->state) { case AX2...
vuln
Safe
C/C++
header_put_be_int (SF_PRIVATE *psf, int x) { if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) { psf->header [psf->headindex++] = (x >> 24) ; psf->header [psf->headindex++] = (x >> 16) ; psf->header [psf->headindex++] = (x >> 8) ; psf->header [psf->headindex++] = x ; } ; } /* header_put_be_int */
vuln
Vulnerable
Unknown
mainloop_destroy_trigger(crm_trigger_t * source) { source->trigger = FALSE; if (source->id > 0) { g_source_remove(source->id); } return TRUE; }
vuln
Vulnerable
C/C++
// +build linux /* Copyright The containerd 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...
vuln
Vulnerable
Go
gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; leftLimit = (-1); if (border < 0) { /* Refuse to fill to a non-solid border */ return; } for (i = x; (i >= 0); i--) { if (gdImageGetPix...
vuln
Vulnerable
Unknown
static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) { BOOL rc = FALSE; rdpContext* context = update->context; rdpPrimaryUpdate* primary = update->primary; ORDER_INFO* orderInfo = &(primary->order_info); rdpSettings* settings = context->settings; const char* orderName; if (flags & OR...
vuln
Vulnerable
C/C++
static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { TTAContext *c = s->priv_data; AVStream *st = s->streams[stream_index]; int index = av_index_search_timestamp(st, timestamp, flags); if (index < 0) return -1; if (avio_seek(s->pb, st->index_entries[...
vuln
Safe
C/C++
static int dirac_unpack_prediction_parameters(DiracContext *s) { static const uint8_t default_blen[] = { 4, 12, 16, 24 }; static const uint8_t default_bsep[] = { 4, 8, 12, 16 }; GetBitContext *gb = &s->gb; unsigned idx, ref; align_get_bits(gb); idx = svq3_get_ue_golomb(gb); if (i...
vuln
Safe
C/C++
package io.swagger.codegen.languages; import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.regex.Pattern; import io.swagger.codegen.languages.features.No...
vuln
Vulnerable
Java
int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC) { zval **login, **password; if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS && Z_TYPE_PP(login) == IS_STRING) { unsigned char* buf; ...
vuln
Safe
C/C++
static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) { struct route4_head *head = rtnl_dereference(tp->root); struct route4_filter __rcu **fp; struct route4_filte...
vuln
Vulnerable
Unknown
int ff_rm_read_mdpr_codecdata(AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *rst, unsigned int codec_data_size, const uint8_t *mime) { unsigned int v; int size; int64_t codec_pos; int ret; if (codec_data_size > INT_MAX) ...
vuln
Vulnerable
C/C++
void ConnectionImpl::onHeaderValue(const char* data, size_t length) { if (header_parsing_state_ == HeaderParsingState::Done && !enable_trailers_) { // Ignore trailers. return; } absl::string_view header_value{data, length}; if (strict_header_validation_) { if (!Http::HeaderUtility::headerValueIsVal...
vuln
Safe
Unknown
inline void skip(size_t bytes) { while (bytes > 0) { size_t n = check(1, bytes); ptr += n; bytes -= n; } }
vuln
Safe
C/C++
/* $Id$ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * 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; eith...
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 int init_muxer(AVFormatContext *s, AVDictionary **options) { int ret = 0, i; AVStream *st; AVDictionary *tmp = NULL; AVCodecParameters *par = NULL; AVOutputFormat *of = s->oformat; const AVCodecDescriptor *desc; AVDictionaryEntry *e; if (options) av_dict_copy(&tmp, *option...
vuln
Vulnerable
C/C++
func (c *Client) Update() (data.TargetFiles, error) { if err := c.UpdateRoots(); err != nil { if _, ok := err.(verify.ErrExpired); ok { // For backward compatibility, we wrap the ErrExpired inside // ErrDecodeFailed. return nil, ErrDecodeFailed{"root.json", err} } return nil, err } // Get timestamp.j...
vuln
Vulnerable
Go
static int icccomponents(i_ctx_t * i_ctx_p, ref *space, int *n) { int code = 0; ref *tempref, ICCdict; code = array_get(imemory, space, 1, &ICCdict); if (code < 0) return code; code = dict_find_string(&ICCdict, "N", &tempref); if (code < 0) return code; if (code == 0) ...
vuln
Vulnerable
Unknown
OMX_ERRORTYPE omx_video::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr) { unsigned int index = 0; OMX_U8 *temp_buff ; if (bufferHdr == NULL || m_inp_mem_ptr == NULL) { DEBUG_PRINT_ERROR("ERROR: free_input: Invalid bufferHdr[%p] or m_inp_mem_ptr[%p]", bufferHdr, m_inp_mem_ptr); return...
vuln
Safe
C/C++
void CharToWideMap(const char *Src,wchar *Dest,size_t DestSize,bool &Success) { // Map inconvertible characters to private use Unicode area 0xE000. // Mark such string by placing special non-character code before // first inconvertible character. Success=false; bool MarkAdded=false; uint SrcPos=0,DestPos=0;...
vuln
Vulnerable
C/C++
void removeStartingWindow(Task task, boolean prepareAnimation) { final Task rootTask = task.getRootTask(); if (rootTask == null) { return; } final ITaskOrganizer lastOrganizer = mTaskOrganizers.peekLast(); if (lastOrganizer == null) { return; } ...
vuln
Vulnerable
Java
void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque) { SaveStateEntry *se, *new_se; char id[256] = ""; if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) { char *path = dev->parent_bus->info->get_dev_path(dev); if (path) { pstrcpy(id, sizeof(i...
vuln
Safe
C/C++
private void showContent(ServerConfig config ) { if (!checkSystemSettings(config)) { // Here we go when the settings window is opened; // Next time we're here after we returned from the Android settings through onResume() return; } sendDeviceInfoAfterReconfig...
vuln
Vulnerable
Java
public void checkNewBeatmaps() { GlobalManager.getInstance().setInfo("Checking for new maps..."); final File mainDir = new File(Config.getCorePath()); if (beatmapToAdd != null) { File file = new File(beatmapToAdd); if (file.getName().toLowerCase().endsWith(".osz")) { ...
vuln
Safe
Java
static inline const unsigned char *ReadResourceLong(const unsigned char *p, unsigned int *quantum) { *quantum=(unsigned int) (*p++) << 24; *quantum|=(unsigned int) (*p++) << 16; *quantum|=(unsigned int) (*p++) << 8; *quantum|=(unsigned int) (*p++) << 0; return(p); }
vuln
Safe
C/C++
read_packet(int fd, gss_buffer_t buf, int timeout, int first) { int ret; static uint32_t len = 0; static char len_buf[4]; static int len_buf_pos = 0; static char * tmpbuf = 0; static int tmpbuf_pos = 0; if (first) { len_buf_pos = 0; return -2; } if (len_buf_pos < 4) { ret = timed_read(fd, &len_...
vuln
Safe
C/C++
def autocomplete_phrases(query): query_string = ur""" with s as (SELECT id, lower(title) as lower_title FROM pub_2018 WHERE title iLIKE '%{query}%') select match, count(*) as score from ( SELECT regexp_matches(lower_title, '({query}\w*?\M)', 'g') as match FROM s union all ...
vuln
Vulnerable
Python
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2020 - Raw Material Software Limited JUCE is an open source library subject to commercial or open-source licensing. The code included in this file is provided under ...
vuln
Vulnerable
C/C++
function openExternalLink(link) { let u; try { u = url.parse(link); } catch (e) { return; } if (protocolRegex.test(u.protocol)) { shell.openExternal(link); } }
vuln
Vulnerable
JavaScript
public ModelAndView recover(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); String usernameOrEmail = StringUtils.trimToNull(request.getParameter("usernameOrEmail")); if (usernameOrEmail != null) { ...
vuln
Vulnerable
Java
@Override public void onDisable() { mc.options.gamma = gamma; mc.chunkCullingEnabled = true; try { mc.worldRenderer.reload(); } catch (Exception ignored) { } super.onDisable(); }
vuln
Safe
Java
void WebPluginDelegateStub::OnGetPluginScriptableObject( void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id) { NPObject* object = delegate_->GetPluginScriptableObject(); if (!object) { *route_id = MSG_ROUTING_NONE; return; } *route_id = channel_->GenerateRouteID(); new NPOb...
vuln
Safe
C/C++
@SuppressLint("CheckResult") private void change(Bundle assets) { BottomArea.input(getContext(), getString(R.string.assert_change_name), assets.getString("name"), getString(R.string.set_sure), getString(R.string.set_cancle), new BottomArea.InputCallback() { @Override public void inpu...
vuln
Vulnerable
Java
public void set(RenderType layer, BufferBuilder buffer) { synchronized (this) { if (buffer == null && additional == null) uploaded.remove(layer); if (buffer == null) queue.remove(layer); else queue.put(layer, new Bu...
vuln
Safe
Java
const std::array<unsigned char, 16> uuid() const { int len = 0; const char* data = nullptr; if (isBinData(BinDataType::newUUID)) { data = binData(len); } uassert(ErrorCodes::InvalidUUID, "uuid must be a 16-byte binary field with UUID (4) subtype", ...
vuln
Safe
Unknown
void skip(Protocol_& prot, TType arg_type) { switch (arg_type) { case TType::T_BOOL: { bool boolv; prot.readBool(boolv); return; } case TType::T_BYTE: { int8_t bytev; prot.readByte(bytev); return; } case TType::T_I16: { int16_t i16; prot.readI16(i16)...
vuln
Safe
Python
pullf_read_max(PullFilter *pf, int len, uint8 **data_p, uint8 *tmpbuf) { int res, total; uint8 *tmp; res = pullf_read(pf, len, data_p); if (res <= 0 || res == len) return res; /* read was shorter, use tmpbuf */ memcpy(tmpbuf, *data_p, res); *data_p = tmpbuf; len -= res; total = res; while (len >...
vuln
Vulnerable
Unknown
/* * Android ownCloud News * * @author David Luhmer * @copyright 2013 David Luhmer david-dev@live.de * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the Li...
vuln
Vulnerable
Java
int redirect_handler (void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) { gchar *location; const char *host; char name[MAX_HOST_LEN + 1]; ...
vuln
Vulnerable
C/C++
void vtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) { int type, len, tlv_len, tlv_value, mgmtd_len; const u_char *tptr; const struct vtp_vlan_ *vtp_vlan; if (length < VTP_HEADER_LEN) goto trunc; tptr = pptr; ND_TCHECK2(*tptr, VTP_HEADER_LEN); typ...
vuln
Vulnerable
C/C++
static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *segment) { int i, length; segment->nb_index_entries = avio_rb32(pb); length = avio_rb32(pb); if(segment->nb_index_entries && length < 11) return AVERROR_INVALIDDATA; if (!(segment->temporal_offset_entries=av...
vuln
Safe
C/C++
@SuppressLint("MissingPermission") public List<MeshtasticDevice> getMeshtasticDevices() { List<MeshtasticDevice> meshtasticDevices = new ArrayList<>(); BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); Set<BluetoothDevice> bluetoothDevices = bluetoothAdapter.getBond...
vuln
Vulnerable
Java
function PMA_secureSession() { // prevent session fixation and XSS // (better to use session_status() if available) if ((PMA_PHP_INT_VERSION >= 50400 && session_status() === PHP_SESSION_ACTIVE) || (PMA_PHP_INT_VERSION < 50400 && session_id() !== '') ) { session_regenerate_id(true); }...
vuln
Safe
PHP
@Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { Cursor cursor = (Cursor) adapterView.getAdapter().getItem(position); int colEmail = cursor.getColumnIndex("email"); selectIdentityForEmail(colEmail < 0 ? null : c...
vuln
Vulnerable
Java
int _our_safe_pcap_next_ex(pcap_t *pcap, struct pcap_pkthdr **pkthdr, const u_char **pktdata, const char *funcname, const int line, const char *file) { int res = pcap_next_ex(pcap, pkthdr, pktdata); if (*pktdata && *pkthdr) { if ((*pkthdr)->len > MAXPACKET) { fprintf(stderr,...
vuln
Safe
C/C++
@Override public int onStartCommand(Intent intent, int flags, int startId) { // Update widget WidgetHelper.updateWidgets(getApplicationContext()); CharSequence tickerText = getText(R.string.notification_ticker); Intent stopRecordingIntent = new Intent(); stopRecordingIntent.s...
vuln
Safe
Java
public void setView(View view, WindowManager.LayoutParams attrs, View panelParentView, int userId) { synchronized (this) { if (mView == null) { mView = view; mAttachInfo.mDisplayState = mDisplay.getState(); mDisplayInstallOrientation = mDi...
vuln
Vulnerable
Java
static int b_unpack (lua_State *L) { Header h; const char *fmt = luaL_checkstring(L, 1); size_t ld; const char *data = luaL_checklstring(L, 2, &ld); size_t pos = luaL_optinteger(L, 3, 1); luaL_argcheck(L, pos > 0, 3, "offset must be 1 or greater"); pos--; /* Lua indexes are 1-based, but here we want 0-bas...
vuln
Safe
C/C++
/* * (c) Copyright Ascensio System SIA 2010-2019 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its ...
vuln
Vulnerable
C/C++
@Nonnull @Override public ItemStack getCraftingResult(@Nonnull CraftingInventory inv) { ItemStack[] components = getComponents(inv); ItemStack newContainer = ItemHandlerHelper.copyStackWithSize(components[containerIndex], 1); IFluidHandlerItem handler = FluidUtil.getFluidHandler(newContainer).orElseThrow(Runti...
vuln
Safe
Java
load_image (GFile *file, GError **error) { GInputStream *input; gchar *name; BrushHeader bh; guchar *brush_buf = NULL; gint32 image_ID; gint32 layer_ID; GimpParasite *parasite; GeglBuffer *buffer; const Babl *f...
vuln
Safe
C/C++
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) { int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); if (!sample_size ||...
vuln
Safe
C/C++
TfLiteStatus LogicalImpl(TfLiteContext* context, TfLiteNode* node, bool (*func)(bool, bool)) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor1, &input1)); con...
vuln
Safe
C/C++
@Override public void run(){ //We need to use side-specific getters here to avoid side-specific classes from trying to be loaded //by the JVM when this method is created. Failure to do this will result in network faults. //For this, we use abstract methods that are extended in our sub-classes. ...
vuln
Vulnerable
Java
void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, unsigned int *size) { const struct xt_match *match = m->u.kernel.match; struct compat_xt_entry_match *cm = (struct compat_xt_entry_match *)m; int pad, off = xt_compat_match_offset(match); u_int16_t msize = cm->u.user.match_size; char...
vuln
Vulnerable
Unknown
xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) { int i, j, initNr, skip; xmlNodePtr n1, n2; if (val2 == NULL) return(val1); if (val1 == NULL) { val1 = xmlXPathNodeSetCreate(NULL); if (val1 == NULL) return (NULL); #if 0 /* * TODO: The optimization won't work in every case, s...
vuln
Safe
Unknown
public List<AbstractConfigListEntry> filteredEntries() { return new AbstractList<AbstractConfigListEntry>() { @Override public Iterator<AbstractConfigListEntry> iterator() { return Iterators.filter(entries.iterator(), entry -> { return getConfigScreen(...
vuln
Safe
Java
package net import ( "fmt" "io/ioutil" "net" "path/filepath" "syscall" "github.com/coreos/go-iptables/iptables" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" "k8s.io/apimachinery/pkg/types" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/common/od...
vuln
Vulnerable
Go
CAMLprim value caml_bitvect_test(value bv, value n) { intnat pos = Long_val(n); return Val_int(Byte_u(bv, pos >> 3) & (1 << (pos & 7))); }
vuln
Safe
C/C++
@Override public void checkParameters(Command command, ExecutionHandlerContext context) { if (command.getProcessedCommand().size() == 3) { try { bytesToInt(command.getProcessedCommand().get(2)); } catch (NumberFormatException nex) { throw new RedisParametersMismatchException(ERROR_NOT_...
vuln
Vulnerable
Java
def activate_identity(self, keyblob): owner_pw = self.get_tpm_metadata("owner_pw") aik_keyhandle = self.get_tpm_metadata("aik_handle") ek_keyhandle = self.get_tpm_metadata("ek_handle") keyblobFile = None secpath = None secfd = -1 sesspath = None sesspathf...
vuln
Safe
Python
@Override public boolean collideBurst(IManaBurst burst, HitResult pos, boolean isManaBlock, boolean shouldKill, ItemStack stack) { BlockPos sourcePos = burst.getBurstSourceBlockPos(); Entity entity = burst.entity(); if (!entity.level.isClientSide && pos instanceof BlockHitResult result && sourcePos.getY() !=...
vuln
Safe
Java
/* * Ultra Wide Band * Neighborhood Management Daemon * * Copyright (C) 2005-2006 Intel Corporation * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 as published by...
vuln
Safe
C/C++
# encoding: utf-8 """ An application for managing IPython profiles. To be invoked as the `ipython profile` subcommand. Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2008 The IPython Development Team # # Distributed under the terms of the BSD...
vuln
Vulnerable
Python
function doSearch(searchStr) { if (lastSearchStr == searchStr && isGetAll == lastGetAll) return; deselectTempCat(); tempDlgContent.scrollTop = 0; diagramsTiles.innerText = ''; diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('searchResults')) + ' "' + mxUtils.htmlEntities(sear...
vuln
Safe
JavaScript