code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
long fuse_ioctl_common(struct file *file, unsigned int cmd, unsigned long arg, unsigned int flags) { struct inode *inode = file_inode(file); struct fuse_conn *fc = get_fuse_conn(inode); if (!fuse_allow_current_process(fc)) return -EACCES; if (fuse_is_bad(inode)) return -EIO; return fuse_do_ioctl(fi...
vuln
Safe
Unknown
public StatBonus getDefenseStatBonus() { StatBonus bonus = new StatBonus(); if (fleet != null && isFleetInRange()) { bonus.applyMods(fleet.getStats().getDynamic().getStat(Stats.PLANETARY_OPERATIONS_CASUALTIES_MULT)); } if (isPlayer) { substituteLocalXPBonus(bonus, false); } else if (isAttacker) { ...
vuln
Safe
Java
new FileReader;m.onload=mxUtils.bind(this,function(q){try{this.openFileHandle(q.target.result,k.name,k,e)}catch(v){this.handleError(v)}});m.onerror=mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q);window.openFile=null});"image"!==k.type.substring(0,5)&&"application/pdf"!==k.type||"image/svg"===k.ty...
vuln
Safe
JavaScript
import { sanitizeUrl } from '@braintree/sanitize-url'; import { curveBasis, curveBasisClosed, curveBasisOpen, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, select, } from 'd3'; import common from './diagrams/common/commo...
vuln
Vulnerable
JavaScript
static int sched_read_attr(struct sched_attr __user *uattr, struct sched_attr *attr, unsigned int usize) { int ret; if (!access_ok(VERIFY_WRITE, uattr, usize)) return -EFAULT; /* * If we're handed a smaller struct than we know of, * ensure all the unknown bits are 0 - i.e. old * user-space does...
vuln
Safe
C/C++
void __drm_atomic_state_free(struct kref *ref) { struct drm_atomic_state *state = container_of(ref, typeof(*state), ref); struct drm_mode_config *config = &state->dev->mode_config; drm_atomic_state_clear(state); drm_dbg_atomic(state->dev, "Freeing atomic state %p\n", state); if (config->funcs->atomic_state_free...
vuln
Vulnerable
C/C++
struct clock_source *dce80_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); if (!clk_src) return NULL; if (dce110_clk_s...
vuln
Safe
Unknown
function generateAutoLoginLink($params){ $dataRequest = array(); $dataRequestAppend = array(); // Destination ID if (isset($params['r'])){ $dataRequest['r'] = $params['r']; $dataRequestAppend[] = '/(r)/'.rawurlencode(base64_encode($params['r'])); } ...
vuln
Safe
PHP
@Override public void close() throws IOException { if (grabTask != null) grabTask.cancel(false); if (backend != null) { backend.stop(); backend = null; } }
vuln
Vulnerable
Java
/* BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> Copyright (C) 2010 Google Inc. Copyright (C) 2011 ProFUSION Embedded Systems Copyright (c) 2012 Code Aurora Forum. All rights reserved. Writ...
vuln
Vulnerable
C/C++
public void runGC() { glBindBuffer(GL_ARRAY_BUFFER, VBO); int deletedNum = 0; int deletedRAM = 0; long t0 = System.nanoTime(); int moved = 0; int checksLeft = sentMeshes.size(); Mesh startMesh = null; while(...
vuln
Safe
Java
static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int job, int self_id) { HEVCContext *s1 = avctxt->priv_data, *s; HEVCLocalContext *lc; int ctb_size = 1<< s1->ps.sps->log2_ctb_size; int more_data = 1; int *ctb_row_p = input_ctb_row; int ctb_row = ctb_row_p[jo...
vuln
Vulnerable
C/C++
@Override public int onStartCommand(@Nullable Intent intent, int flags, int startId) { if (isWorking()) return super.onStartCommand(intent, flags, startId); notificationManager = NotificationUtils.getNewNotificationManager(this, CHANNEL_ID, "Install Progress", NotificationManagerComp...
vuln
Vulnerable
Java
static void add_job_stats_by_job_type(JsonbParseState *parse_state) { StringInfo command; int res; MemoryContext old_context = CurrentMemoryContext, spi_context; SPITupleTable *tuptable = NULL; const char *command_string = "SELECT (" " CASE " " WHEN j.proc_schema = \'_timescaledb_internal\' AND j.proc_name...
vuln
Vulnerable
C/C++
int m_authenticate(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { struct Client* acptr; int first = 0; char realhost[HOSTLEN + 3]; char *hoststr = (cli_sockhost(cptr) ? cli_sockhost(cptr) : cli_sock_ip(cptr)); if (!CapActive(cptr, CAP_SASL)) return 0; if (parc < 2) /* have enough ...
vuln
Vulnerable
C/C++
xsltNumberFormatGetAnyLevel(xsltTransformContextPtr context, xmlNodePtr node, xsltCompMatchPtr countPat, xsltCompMatchPtr fromPat, double *array) { int amount = 0; int cnt = 0; xmlNodePtr cur; /* select the starting node */ switch (node->type) { case XML_ELEMENT_NODE: ...
vuln
Vulnerable
Unknown
@SubscribeEvent(priority = EventPriority.LOWEST) public void playerMoveEvent(PlayerMoveEvent event) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return; playerActive((EntityPlayerMP) event.entityPlayer); }
vuln
Vulnerable
Java
private void handleJwr(AuthzRequest authzRequest, Client client, RedirectUriResponse redirectUriResponse, JsonWebResponse jwr) { if (jwr == null) { return; } String checkForAlg = jwr.getClaims().getClaimAsString("alg"); // to handle Jans Issue#310 if ("none".equals(checkForA...
vuln
Vulnerable
Java
int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, int max_size) { uint32_t mrk; int i, tmp; const uint16_t *ssrc = (const uint16_t *) src; uint16_t *sdst = (uint16_t *) dst; PutBitContext pb; if ((unsigned) src_size > (unsigned) max_siz...
vuln
Vulnerable
C/C++
int jpc_enc_enccblk(jpc_enc_t *enc, jas_stream_t *out, jpc_enc_tcmpt_t *tcmpt, jpc_enc_band_t *band, jpc_enc_cblk_t *cblk) { jpc_enc_pass_t *pass; jpc_enc_pass_t *endpasses; int bitpos; int n; int adjust; int ret; int passtype; int t; jpc_bitstream_t *bout; jpc_enc_pass_t *termpass; jpc_enc_rlvl_t *rlvl; in...
vuln
Safe
Unknown
private void internalDeleteSubscriptionForNonPartitionedTopicForcefully(AsyncResponse asyncResponse, String subName, boolean authoritative) { validateTopicOwnershipAsync(topicName, authoritative) .thenRun(() -> validateT...
vuln
Safe
Java
xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) { const xmlChar *name = NULL; xmlChar *ExternalID = NULL; xmlChar *URI = NULL; /* * We know that '<!DOCTYPE' has been detected. */ SKIP(9); SKIP_BLANKS; /* * Parse the DOCTYPE name. */ name = xmlParseName(ctxt); if (na...
vuln
Safe
C/C++
static int parse_hex64(DeviceState *dev, Property *prop, const char *str) { uint64_t *ptr = qdev_get_prop_ptr(dev, prop); char *end; *ptr = strtoull(str, &end, 16); if ((*end != '\0') || (end == str)) { return -EINVAL; } return 0; }
vuln
Safe
C/C++
static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c, uint8_t *properties) { int compno; if (s->buf_end - s->buf < 2) return AVERROR_INVALIDDATA; compno = bytestream_get_byte(&s->buf); c += compno; c->csty = bytestream_get_byte(&s->buf); get_cox(s,...
vuln
Vulnerable
C/C++
public function getParent() { }
vuln
Vulnerable
JavaScript
static void setProperty(SchemaFactory schemaFactory, String propertyName) throws SAXException { try { schemaFactory.setProperty(propertyName, ""); } catch (SAXException e) { if (Boolean.getBoolean(SYSTEM_PROPERTY_IGNORE_XXE_PROTECTION_FAILURES)) { LOGGER.warning("...
vuln
Vulnerable
Java
void ZRtp::storeMsgTemp(ZrtpPacketBase* pkt) { uint32_t length = pkt->getLength() * ZRTP_WORD_SIZE; length = (length > sizeof(tempMsgBuffer)) ? sizeof(tempMsgBuffer) : length; memset(tempMsgBuffer, 0, sizeof(tempMsgBuffer)); memcpy(tempMsgBuffer, (uint8_t*)pkt->getHeaderBase(), length); lengthOfMsgD...
vuln
Safe
C/C++
#include "source/common/http/conn_manager_impl.h" #include <cstdint> #include <functional> #include <list> #include <memory> #include <string> #include <vector> #include "envoy/buffer/buffer.h" #include "envoy/common/time.h" #include "envoy/event/dispatcher.h" #include "envoy/event/scaled_range_timer_manager.h" #incl...
vuln
Vulnerable
C/C++
void qmp_drive_mirror(DriveMirror *arg, Error **errp) { BlockDriverState *bs; BlockDriverState *source, *target_bs; AioContext *aio_context; BlockMirrorBackingMode backing_mode; Error *local_err = NULL; QDict *options = NULL; int flags; int64_t size; const char *format = arg->format;...
vuln
Vulnerable
C/C++
uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg) { uint32_t mask; unsigned el = arm_current_el(env); switch (reg) { case 0 ... 7: mask = 0; if ((reg & 1) && el) { mask |= 0x000001ff; } if (!(reg & 4)) { mask |= 0xf8000000; }...
vuln
Safe
C/C++
def GetActionAllowAnyone(f: GetRequest => Result): Action[Unit] = PlainApiAction(cc.parsers.empty, NoRateLimits, MinAuthnStrength.EmbeddingStorageSid12,
vuln
Safe
Scala
static int cleanup_bundling_task(ncInstance * instance, struct bundling_params_t *params, bundling_progress result) { int rc = 0; char cmd[MAX_PATH] = { 0 }; char buf[MAX_PATH] = { 0 }; LOGINFO("[%s] bundling task result=%s\n", instance->instanceId, bundling_progress_names[result]); sem_p(inst_sem...
vuln
Vulnerable
Unknown
static int jpegxl_anim_read_packet(AVFormatContext *s, AVPacket *pkt) { JXLAnimDemuxContext *ctx = s->priv_data; AVIOContext *pb = s->pb; int ret; int64_t size; size_t offset = 0; size = avio_size(pb); if (size < 0) return size; if (size > INT_MAX) return AVERROR(EDOM); ...
vuln
Safe
C/C++
X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) { X509_REQ *ret; X509_REQ_INFO *ri; int i; EVP_PKEY *pktmp; ret = X509_REQ_new(); if (ret == NULL) { X509err(X509_F_X509_TO_X509_REQ, ERR_R_MALLOC_FAILURE); goto err; } ri = ret->req_info; ri->ve...
vuln
Safe
C/C++
static void ptrace_siblings(pid_t pid, pid_t main_tid, std::set<pid_t>& tids) { char task_path[64]; //// Attach to a thread, and verify that it's still a member of the given process snprintf(task_path, sizeof(task_path), "/proc/%d/task", pid); std::unique_ptr<DIR, int (*)(DIR*)> d(opendir(task_path), closedi...
vuln
Vulnerable
C/C++
x[C].apply(this,arguments);null!=G&&B.push(G)}b.sidebar.showEntries(0<B.length?B.join(";"):"",A.checked);b.hideDialog()});g.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(n),f.appendChild(g)):(f.appendChild(g),f.appen...
vuln
Vulnerable
JavaScript
@Override public int getSlotLimit(int slot) { return call(i -> Math.min(i.getSlotLimit(slot), getMaxCountPerStack()), i -> true, 0); }
vuln
Safe
Java
int ff_wma_end(AVCodecContext *avctx) { WMACodecContext *s = avctx->priv_data; int i; for(i = 0; i < s->nb_block_sizes; i++) ff_mdct_end(&s->mdct_ctx[i]); for(i = 0; i < s->nb_block_sizes; i++) av_free(s->windows[i]); if (s->use_exp_vlc) { free_vlc(&s->exp_vlc); } if ...
vuln
Safe
C/C++
static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, int len) { struct igmphdr *ih = igmp_hdr(skb); struct igmpv3_query *ih3 = igmpv3_query_hdr(skb); struct ip_mc_list *im; __be32 group = ih->group; int max_delay; int mark = 0; if (len == 8) { if (ih->code == 0) { /* Alas, ...
vuln
Vulnerable
C/C++
static int adis_update_scan_mode_burst(struct iio_dev *indio_dev, const unsigned long *scan_mask) { struct adis *adis = iio_device_get_drvdata(indio_dev); unsigned int burst_length; u8 *tx; /* All but the timestamp channel */ burst_length = (indio_dev->num_channels - 1) * sizeof(u16); burst_length += adis->burs...
vuln
Safe
C/C++
TransformPaintPropertyNode* TransformPaintPropertyNode::Root() { const TransformPaintPropertyNode& TransformPaintPropertyNode::Root() { DEFINE_STATIC_LOCAL( TransformPaintPropertyNode, root, (nullptr, State{TransformationMatrix(), FloatPoint3D(), false, BackfaceVisibility::kVisible, 0...
vuln
Safe
C/C++
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) { struct file_list *flist = NULL; int exit_code = 0, exit_code2 = 0; char *local_name = NULL; cleanup_child_pid = pid; if (!read_batch) { set_nonblocking(f_in); set_nonblocking(f_out); } io_set_sock_fds(f_in, f_out); setup_protocol(f_o...
vuln
Vulnerable
Unknown
@Nullable @Override public NotificationEntry getEntry(@NonNull String key) { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return getPendingOrActiveNotif(key); }
vuln
Safe
Java
av_cold int avcodec_close(AVCodecContext *avctx) { if (ff_lockmgr_cb) { if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN)) return -1; } entangled_thread_counter++; if (entangled_thread_counter != 1) { av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcod...
vuln
Vulnerable
C/C++
static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) { struct svcxprt_rdma *listen_rdma; struct svcxprt_rdma *newxprt = NULL; struct rdma_conn_param conn_param; struct rpcrdma_connect_private pmsg; struct ib_qp_init_attr qp_attr; struct ib_device *dev; struct sockaddr *sap; unsigned int i; int ret = ...
vuln
Safe
C/C++
static int flashsv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { int buf_size = avpkt->size; FlashSVContext *s = avctx->priv_data; int h_blocks, v_blocks, h_part, v_part, i, j; GetBitContext gb; if (buf_size == 0) ...
vuln
Safe
C/C++
private double getBreakDamage(Entity entity, boolean checkCrystalAge) { if (!(entity instanceof EndCrystalEntity)) return 0; // Check only break own if (onlyBreakOwn.get() && !placedCrystals.contains(entity.getId())) return 0; // Check if it should already be removed if (remove...
vuln
Safe
Java
def call(env) return @app.call(env) unless env['PATH_INFO'].start_with? "#{@bus.base_route}message-bus/_diagnostics" route = env['PATH_INFO'].split("#{@bus.base_route}message-bus/_diagnostics")[1] if @bus.is_admin_lookup.nil? || !@bus.is_admin_lookup.call(env) return [403, {}, ['not allowed']] e...
vuln
Safe
Ruby
static ssize_t WritePSDChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, MagickOffsetType size_offset,const MagickBooleanType separate) { Image *mask; MagickOffsetType rows_offset; size_t channels, count, length, offset_length; unsigned ...
vuln
Vulnerable
C/C++
public static void appendSurfaceRule(WorldData worldData, ResourceKey<LevelStem> levelStemKey, SurfaceRules.RuleSource ruleSource) { if (worldData == null) { // For some reason mods can make world data null as seen in some user crash logs, this makes that issue clearer for us. throw new NullPointerE...
vuln
Safe
Java
@Override public void renderItem(MinecraftClient mc, MatrixStack matrices, Item item, int x, int y, int w, int h) { if (item == Items.AIR) { super.renderItem(mc, matrices, item, x, y, w, h); } else { RenderSystem.getModelViewStack().push(); float scale = (h - 2) / 16f; float offset = 1f / scale; R...
vuln
Vulnerable
Java
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) /* * libfdt - Flat Device Tree manipulation * Copyright (C) 2006 David Gibson, IBM Corporation. */ #include "libfdt_env.h" #include <fdt.h> #include <libfdt.h> #include "libfdt_internal.h" static int fdt_nodename_eq_(const void *fdt, int offset, ...
vuln
Safe
C/C++
protected void defaultValueChangeListener() { final NullableOptionGroup samplePurposeField = (NullableOptionGroup) getField(SampleDto.SAMPLE_PURPOSE); final Field<?> receivedField = getField(SampleDto.RECEIVED); final Field<?> shippedField = getField(SampleDto.SHIPPED); samplePurposeField.setRequired(true); ...
vuln
Vulnerable
Java
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
vuln
Safe
Python
grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, void (*read_hook) (grub_disk_addr_t sector, unsigned offset, unsigned length, void *closure), void *closure, int flags, grub_off_t pos, grub_size_t len, char *buf, grub_disk_addr_t (*get_block) (gr...
vuln
Vulnerable
C/C++
protected void retrieveActivitiesWithoutVLV( ActivityDatabase database, String filter, Integer start, Integer size, ActivityCollection response) throws Exception { String method = "ActivityService.retrieveActivitiesWithoutVLV: "; // search wit...
vuln
Safe
Java
add_account (GoaProvider *provider, GoaClient *client, GtkDialog *dialog, GtkBox *vbox, GError **error) { AddAccountData data; GVariantBuilder credentials; GVariantBuilder details; GoaEwsClient *ews_client; GoaObject *ret; const...
vuln
Vulnerable
Unknown
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Editor constructor executed on page load. */ Editor = function(chromeless, themes, model, graph, editable) { mxEventSource.call(this); this.chromeless = (chromeless != null) ? chromeless : this.chromeless; this.initStencilRegistry(); this.graph = graph || this....
vuln
Safe
JavaScript
static int fsmVerify(const char *path, rpmfi fi) static int fsmVerify(const char *path, rpmfi fi, const struct stat *fsb) { int rc; int saveerrno = errno; struct stat dsb; mode_t mode = rpmfiFMode(fi); rc = fsmStat(path, 1, &dsb); if (rc) return rc; if (S_ISREG(mode)) { /* HP-UX (and ...
vuln
Safe
C/C++
validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) { /* ** Check if screen exists. */ if (screen < 0 || screen >= screenInfo.numScreens) { client->errorValue = screen; *err = BadValue; return FALSE; } *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); ...
vuln
Safe
C/C++
public ResultSet getResultSet() throws SQLException { checkOpen(); if (rs.isOpen()) { throw new SQLException("ResultSet already requested"); } DB db = conn.getDatabase(); if (db.column_count(pointer) == 0) { return null; } if (rs.colsMet...
vuln
Vulnerable
Java
xls_error_t xls_parseWorkBook(xlsWorkBook* pWB) { if(!pWB) return LIBXLS_ERROR_NULL_ARGUMENT; BOF bof1 = { .id = 0, .size = 0 }; BOF bof2 = { .id = 0, .size = 0 }; BYTE* buf = NULL; BYTE once = 0; xls_error_t retval = LIBXLS_OK; verbose ("xls_parseWorkBook"); do { if(xls_debug > 10) { ...
vuln
Safe
C/C++
void delete_run_files(pid_t pid) { delete_sandbox_run_file(pid); delete_bandwidth_run_file(pid); delete_network_run_file(pid); delete_name_run_file(pid); delete_x11_run_file(pid); delete_profile_run_file(pid); }
vuln
Safe
Unknown
static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) { struct elo_priv *priv; int ret; struct usb_device *udev; if (!hid_is_usb(hdev)) return -EINVAL; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; INIT_DELAYED_WORK(&priv->work, elo_work); udev = interface_...
vuln
Vulnerable
C/C++
static int get_client_hello(SSL *s) { int i, n; unsigned long len; unsigned char *p; STACK_OF(SSL_CIPHER) *cs; /* a stack of SSL_CIPHERS */ STACK_OF(SSL_CIPHER) *cl; /* the ones we want to use */ STACK_OF(SSL_CIPHER) *prio, *allow; int z; /* * This is a bit of a hack to check f...
vuln
Vulnerable
Unknown
static TEE_Result do_alloc_publickey(struct rsa_public_key *s, size_t key_size_bits __unused) { memset(s, 0, sizeof(*s)); if (!bn_alloc_max(&s->e)) return TEE_ERROR_OUT_OF_MEMORY; if (!bn_alloc_max(&s->n)) { crypto_bignum_free(&s->e); return TEE_ERROR_OUT_OF_MEMORY; } return TEE_SUCCESS; }
vuln
Safe
C/C++
/* * 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++
public void list() throws ArgumentsMissMatchException { if(args.size() == 1){ String type = args.get(0); switch(type){ case "exploits": Printer.printExploitsInfo(exploits.values()); return; case "payloads": ...
vuln
Vulnerable
Java
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
vuln
Vulnerable
C/C++
static int __ext4_expand_extra_isize(struct inode *inode, unsigned int new_extra_isize, struct ext4_iloc *iloc, handle_t *handle, int *no_expand) { struct ext4_inode *raw_inode; struct ext4_xattr_ibody_header *header; int error; raw_inode = ext4_raw_inode(iloc); header = IHDR(inode, ra...
vuln
Vulnerable
C/C++
query: codemirror_editor ? codemirror_editor.getValue() : $('#sqlquery').val(), database: db }, function (data) { var i; if (typeof data !== 'undefined' && data.success === true) { data = data.message; } if (data.error) { ...
vuln
Safe
JavaScript
protected function get_remote_contents( &$url, $timeout = 30, $redirect_max = 5, $ua = 'Mozilla/5.0', $fp = null ) { $method = (function_exists('curl_exec') && !ini_get('safe_mode') && !ini_get('open_basedir'))? 'curl_get_contents' : 'fsock_get_contents'; return $this->$method( $url, $timeout, $redirect_max, $ua, ...
vuln
Safe
JavaScript
static bool GetUpdateFile( update_t *p_update ) { stream_t *p_stream = NULL; char *psz_version_line = NULL; char *psz_update_data = NULL; p_stream = stream_UrlNew( p_update->p_libvlc, UPDATE_VLC_STATUS_URL ); if( !p_stream ) { msg_Err( p_update->p_libvlc, "Failed to open %s for reading"...
vuln
Safe
C/C++
static int alac_decode_frame(AVCodecContext *avctx, void *outbuffer, int *outputsize, AVPacket *avpkt) { const uint8_t *inbuffer = avpkt->data; int input_buffer_size = avpkt->size; ALACContext *alac = avctx->priv_data; int channels; unsigned ...
vuln
Safe
C/C++
void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, IVITile *tile, int32_t mv_scale) { int x, y, need_mc, mbn, blk, num_blocks, mv_x, mv_y, mc_type; int offs, mb_offset, row_offset; IVIMbInfo *mb, *ref_mb; const int16_t ...
vuln
Safe
C/C++
$comments->records[$key]->avatar = $db->selectObject('user_avatar',"user_id='".$record->poster."'"); } if (empty($this->params['config']['disable_nested_comments'])) $comments->records = self::arrangecomments($comments->records); // eDebug($sql, true); // count the unapproved comments ...
vuln
Safe
PHP
/* $Id: upnpreplyparse.c,v 1.19 2015/07/15 10:29:11 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006-2017 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within t...
vuln
Safe
C/C++
// mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. // +build mips,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go package unix import "syscall" const ( B1000000 ...
vuln
Vulnerable
Go
static void vfio_unmap_bar(VFIODevice *vdev, int nr) { VFIOBAR *bar = &vdev->bars[nr]; if (!bar->size) { return; } vfio_bar_quirk_teardown(vdev, nr); memory_region_del_subregion(&bar->mem, &bar->mmap_mem); munmap(bar->mmap, memory_region_size(&bar->mmap_mem)); if (vdev->msix && vdev-...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2004-2020 ZNC, see the NOTICE file for details. * * 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 requi...
vuln
Vulnerable
C/C++
exsltFuncRegisterImportFunc (exsltFuncFunctionData *data, exsltFuncImportRegData *ch, const xmlChar *URI, const xmlChar *name, ATTRIBUTE_UNUSED const xmlChar *ignored) { exsltFuncFunctionData *func=NULL; if ((data == NULL) || (ch == NULL) || (URI == NULL) || (name == NULL)) ...
vuln
Safe
C/C++
ImageInverter::provideStreamData(int objid, int generation, Pipeline* pipeline) { // Use the object and generation number supplied to look up the // image data. Then invert the image data and write the inverted // data to the pipeline. PointerHolder<Buffer> data = this->image_data[QPDFObjG...
vuln
Safe
Unknown
private static void verifyPeerName(PGStream stream, Properties info, SSLSocket newConnection) throws PSQLException { HostnameVerifier hvn; String sslhostnameverifier = PGProperty.SSL_HOSTNAME_VERIFIER.get(info); if (sslhostnameverifier == null) { hvn = PGjdbcHostnameVerifier.INSTANCE; sslh...
vuln
Safe
Java
/* * 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
Safe
Java
static void gen_tlbre_440(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) GEN_PRIV; #else CHK_SV; switch (rB(ctx->opcode)) { case 0: case 1: case 2: { TCGv_i32 t0 = tcg_const_i32(rB(ctx->opcode)); gen_helper_440_tlbre(cpu_gpr[rD(ctx->opcode)], cpu_env, ...
vuln
Safe
C/C++
@Override public void cancel() { Slogf.i(TAG, "Cancel"); if (!RadioServiceUserController.isCurrentOrSystemUser()) { Slogf.w(TAG, "Cannot cancel on AIDL HAL client from non-current user"); return; } synchronized (mLock) { checkNotClosedLocked(); ...
vuln
Safe
Java
bgp_handle_message(struct bgp_proto *p, byte *data, uint len, byte **bp) { byte *msg = data + 1; uint msg_len = data[0]; uint i; /* Handle zero length message */ if (msg_len == 0) return 1; /* Handle proper message */ if (msg_len + 1 > len) return 0; /* Some elementary cleanup */ for (i = 0...
vuln
Safe
Unknown
void cpu_ppc_reset (void *opaque) { CPUPPCState *env; target_ulong msr; env = opaque; msr = (target_ulong)0; #if defined(TARGET_PPC64) msr |= (target_ulong)0 << MSR_HV; #endif msr |= (target_ulong)0 << MSR_AP; msr |= (target_ulong)0 << MSR_SA; msr |= (target_ulong)1 << MSR_EP; #if def...
vuln
Safe
C/C++
'use strict' const path = require('path') const statSync = require('fs').statSync const { PassThrough } = require('readable-stream') const glob = require('glob') const send = require('send') const contentDisposition = require('content-disposition') const fp = require('fastify-plugin') const util = require('util') cons...
vuln
Safe
JavaScript
static int neightbl_fill_param_info(struct neigh_table *tbl, struct neigh_parms *parms, struct sk_buff *skb, struct netlink_callback *cb) { struct ndtmsg *ndtmsg; struct nlmsghdr *nlh; nlh = NLMSG_NEW_ANSWER(skb, cb, RTM_NEWNEIGHTBL, sizeof(struct ndtmsg), NLM_F_MULTI); ndtmsg = ...
vuln
Safe
Unknown
static int check_ptr_alignment(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, int off, int size) { bool strict = env->strict_alignment; const char *pointer_desc = ""; switch (reg->type) { case PTR_TO_PACKET: case PTR_TO_PACKET_META: /* Special case, because of NET_IP_ALIGN. G...
vuln
Safe
C/C++
static VTermScreen *screen_new(VTerm *vt) { VTermState *state = vterm_obtain_state(vt); VTermScreen *screen; int rows, cols; if(!state) return NULL; screen = vterm_allocator_malloc(vt, sizeof(VTermScreen)); vterm_get_size(vt, &rows, &cols); screen->vt = vt; screen->state = state; screen->dama...
vuln
Vulnerable
C/C++
/* Copyright 2020 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
C/C++
static int decode_block(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) { EXRContext *s = avctx->priv_data; AVFrame *const p = s->picture; EXRThreadData *td = &s->thread_data[threadnr]; const uint8_t *channel_buffer[4] = { 0 }; const uint8_t *buf = s->buf; ui...
vuln
Vulnerable
C/C++
wl_map_insert_at(struct wl_map *map, uint32_t flags, uint32_t i, void *data) { union map_entry *start; uint32_t count; struct wl_array *entries; if (i < WL_SERVER_ID_START) { entries = &map->client_entries; } else { entries = &map->server_entries; i -= WL_SERVER_ID_START; } if (i > WL_MAP_MAX_OBJECTS) ...
vuln
Safe
Unknown
@Override public CharPosition getCharPosition(int line, int column) { throwIfHas(); if(!mContent.checkLineAndColumn(line, column, true)) return new CharPosition().zero(); CharPosition pos = findNearestByLine(line); CharPosition res; if (pos.line == line) { ...
vuln
Safe
Java
static int qcow2_cache_entry_flush(BlockDriverState *bs, Qcow2Cache *c, int i) { BDRVQcowState *s = bs->opaque; int ret = 0; if (!c->entries[i].dirty || !c->entries[i].offset) { return 0; } trace_qcow2_cache_entry_flush(qemu_coroutine_self(), c == s->l2_tabl...
vuln
Safe
C/C++
(function($) { "use strict"; var Autocompleter = function(element, options) { this.initialize(element, options); }; Autocompleter.prototype = { constructor: Autocompleter, initialize: function(element, options) { this.$element = $(element); this.options...
vuln
Vulnerable
Python
void stl_update_connects_remove_1(stl_file *stl, int facet_num) { int j; if (stl->error) return; /* Update list of connected edges */ j = ((stl->neighbors_start[facet_num].neighbor[0] == -1) + (stl->neighbors_start[facet_num].neighbor[1] == -1) + (stl->neighbors_start[facet_num].neighbor[2] == -1...
vuln
Vulnerable
C/C++
void color_cmyk_to_rgb(opj_image_t *image) { float C, M, Y, K; float sC, sM, sY, sK; unsigned int w, h, max, i; w = image->comps[0].w; h = image->comps[0].h; if(image->numcomps < 4) return; max = w * h; sC = 1.0F / (float)((1 << image->comps[0].prec) - 1); sM = 1.0F / (float)((1 << image->comps[1].p...
vuln
Vulnerable
C/C++