code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Constructs a new graph editor */ EditorUi = function(editor, container, lightbox) { mxEventSource.call(this); this.destroyFunctions = []; this.editor = editor || new Editor(); this.container = container || document.body; var graph = this.editor.graph; gra...
vuln
Safe
JavaScript
void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst2, ThreadFrame *ref, const VP56mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, ptrdiff_t linesize, vp8_mc_func mc_func[3][3]) { uint8_t *src1 = ref-...
vuln
Safe
C/C++
int diskutil_ch(const char *path, const char *user, const char *group, const int perms) { char *output = NULL; LOGDEBUG("ch(own|mod) '%s' %s.%s %o\n", SP(path), ((user != NULL) ? user : "*"), ((group != NULL) ? group : "*"), perms); if (path) { if (user) { output = pruntf(TRUE, "%s %s ...
vuln
Vulnerable
Unknown
def get(self): """ Returns a list organizations --- description: >- Get a list of organizations based on filters and user permissions\n ### Permission Table\n |Rule name|Scope|Operation|Assigned to node|Assigned to container| Description|\n ...
vuln
Vulnerable
Python
public static String xmlToJson(JsonXMLConfig config, String xmlStr, boolean normalizeNamespaces, boolean alwaysArray, boolean alwaysExpandObjects) throws IOException, XMLStreamException, FactoryConfigurationError, TransformerConfigurationException, TransformerException, TransformerFactoryConfigurationError { tr...
vuln
Safe
Java
AvahiDnsPacket *avahi_recv_dns_packet_ipv6( int fd, AvahiIPv6Address *ret_src_address, uint16_t *ret_src_port, AvahiIPv6Address *ret_dst_address, AvahiIfIndex *ret_iface, uint8_t *ret_ttl) { AvahiDnsPacket *p = NULL; struct msghdr msg; struct iovec io; si...
vuln
Vulnerable
Unknown
from __future__ import print_function import argparse import json from oauthlib.oauth2 import LegacyApplicationClient import logging import logging.handlers from requests_oauthlib import OAuth2Session import os import requests import six import sys import traceback from six.moves.urllib.parse import quote as urlquote...
vuln
Safe
Python
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
vuln
Vulnerable
Java
static int runas_userlist_matches(const struct sudoers_parse_tree *parse_tree, const struct member_list *user_list, struct member **matching_user) { const struct sudoers_context *ctx = parse_tree->ctx; const char *lhost = parse_tree->lhost ? parse_tree->lhost : ctx->runas.host; const char *shost = parse...
vuln
Vulnerable
C/C++
setTimeout(function(){Ia.style.display="none"},4E3)}function z(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",p=X,X=null)}function L(fa,ca,ba,ja,ia,ma,qa){if(-1<fa.className.indexOf("geTempDlgRadioBtnActive"))return!1;fa.className+=" geTempDlgRadioBtnActive";Q.querySelector(".geTempDlgRadioBtn[da...
vuln
Vulnerable
JavaScript
export function fetchRemote(remote: string, cwd: string) { const results = git(["fetch", "--", remote], { cwd }); if (!results.success) { throw gitError(`Cannot fetch remote: ${remote}`); } }
vuln
Safe
JavaScript
static Jsi_RC NumberToStringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { char buf[500]; int radix = 10, skip = 0, argc = Jsi_ValueGetLength(interp, args); Jsi_Number num; Jsi_Value *v; ChkStringN(_this, funcPtr, v); Jsi_GetDoubleFromValue(i...
vuln
Vulnerable
C/C++
static inline ut8 r_read_ble8(const void *src) { if (!src) { return UT8_MAX; } return *(ut8 *)src; }
vuln
Safe
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Safe
C/C++
static int nbd_negotiate_handle_info(NBDClient *client, uint32_t length, uint32_t opt, uint16_t myflags, Error **errp) { int rc; char name[NBD_MAX_NAME_SIZE + 1]; NBDExport *exp; uint16_t requests; uint16_t request; uint32...
vuln
Safe
C/C++
// This file is part of Deark. // Copyright (C) 2016 Jason Summers // See the file COPYING for terms of use. // This file is for format-specific functions that are used by multiple modules. #define DE_NOT_IN_MODULE #include "deark-config.h" #include "deark-private.h" #include "deark-fmtutil.h" void fmtutil_get_bmp_c...
vuln
Safe
C/C++
yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum PixelFormat target) { const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; ...
vuln
Safe
C/C++
int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie) { static const char *const names[] = { [WMI_FRAME_BEACON] = "BEACON", [WMI_FRAME_PROBE_REQ] = "PROBE_REQ", [WMI_FRAME_PROBE_RESP] = "WMI_FRAME_PROBE_RESP", [WMI_FRAME_ASSOC_REQ] = "WMI_FRAME_ASSOC_REQ", [WMI_FRAME_ASSOC_RESP] = "WM...
vuln
Vulnerable
Unknown
pci_emul_capwrite(struct pci_vdev *dev, int offset, int bytes, uint32_t val) { int capid; uint8_t capoff, nextoff; /* Do not allow un-aligned writes */ if ((offset & (bytes - 1)) != 0) return; /* Find the capability that we want to update */ capoff = CAP_START_OFFSET; while (1) { nextoff = pci_get_cfgdata8...
vuln
Safe
Unknown
SPL_METHOD(SplObjectStorage, serialize) { spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_SplObjectStorageElement *element; zval members, *pmembers, *flags; HashPosition pos; php_serialize_data_t var_hash; smart_str buf = {0}; if (zend_parse_par...
vuln
Vulnerable
Unknown
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Safe
C/C++
static int rsi_send_beacon(struct rsi_common *common) { struct sk_buff *skb = NULL; u8 dword_align_bytes = 0; skb = dev_alloc_skb(MAX_MGMT_PKT_SIZE); if (!skb) return -ENOMEM; memset(skb->data, 0, MAX_MGMT_PKT_SIZE); dword_align_bytes = ((unsigned long)skb->data & 0x3f); if (dword_align_bytes) skb_pull(sk...
vuln
Vulnerable
C/C++
generate_target_query(struct module_qstate* qstate, struct iter_qstate* iq, int id, uint8_t* name, size_t namelen, uint16_t qtype, uint16_t qclass) { struct module_qstate* subq; if(!generate_sub_request(name, namelen, qtype, qclass, qstate, id, iq, INIT_REQUEST_STATE, FINISHED_STATE, &subq, 0)) return 0;...
vuln
Vulnerable
Unknown
func TimestampFileMetaEqual(actual data.TimestampFileMeta, expected data.TimestampFileMeta) error { // As opposed to snapshots, the length and hashes are still required in // TUF-1.0. See: // https://github.com/theupdateframework/specification/issues/38 if err := FileMetaEqual(actual.FileMeta, expected.FileMeta); e...
vuln
Vulnerable
Go
void OPPROTO op_store_msr (void) { do_store_msr(env, T0); RETURN(); }
vuln
Vulnerable
C/C++
ec_verify(krb5_context context, krb5_data *req_pkt, krb5_kdc_req *request, krb5_enc_tkt_part *enc_tkt_reply, krb5_pa_data *data, krb5_kdcpreauth_callbacks cb, krb5_kdcpreauth_rock rock, krb5_kdcpreauth_moddata moddata, krb5_kdcpreauth_verify_respond_fn respond, void *arg) { k...
vuln
Vulnerable
C/C++
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.fullscreen; import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; import static android.view.View.SYSTEM_UI_FLAG...
vuln
Vulnerable
C/C++
int dlt_hdlc_encode(tcpeditdlt_t *ctx, u_char *packet, int pktlen, _U_ tcpr_dir_t dir) { cisco_hdlc_t *hdlc; hdlc_config_t *config = NULL; hdlc_extra_t *extra = NULL; tcpeditdlt_plugin_t *plugin = NULL; u_char tmpbuff[MAXPACKET]; int newpktlen; assert(ctx); assert(packet); if (pkt...
vuln
Vulnerable
C/C++
BOOL transport_connect_nla(rdpTransport* transport) { freerdp* instance; rdpSettings* settings; if (transport->layer == TRANSPORT_LAYER_TSG) return TRUE; if (!transport_connect_tls(transport)) return FALSE; /* Network Level Authentication */ if (transport->settings->Authentication != TRUE) return TRUE; ...
vuln
Vulnerable
C/C++
private List<InjectedInterface> getSourceInjectedInterface(SourceSet sourceSet) { final FabricModJson fabricModJson; try { fabricModJson = FabricModJsonFactory.createFromSourceSetNullable(sourceSet); } catch (IOException e) { throw new UncheckedIOException(e); } return InjectedInterface.fromFabricModJ...
vuln
Vulnerable
Java
render() { const { children, entityKey, contentState } = this.props; const { url, targetOption } = contentState.getEntity(entityKey).getData(); const { showPopOver } = this.state; return ( <span className="rdw-link-decorator-wrapper" onMouseEnter={this.toggleShowPopOv...
vuln
Vulnerable
JavaScript
static void set_pixel_format(VncState *vs, int bits_per_pixel, int depth, int big_endian_flag, int true_color_flag, int red_max, int green_max, int blue_max, int red_shift, int green_shift, int blue_shift...
vuln
Safe
Unknown
R_API void r_core_anal_esil(RCore *core, const char *str, const char *target) { bool cfg_anal_strings = r_config_get_i (core->config, "anal.strings"); bool emu_lazy = r_config_get_i (core->config, "emu.lazy"); bool gp_fixed = r_config_get_i (core->config, "anal.gpfixed"); RAnalEsil *ESIL = core->anal->esil; ut64 r...
vuln
Safe
Unknown
static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image) { MagickBooleanType status; MagickOffsetType offset, *page_table, scene; MemoryInfo *pixel_info; PCXInfo pcx_info; register const IndexPacket *indexes; register const PixelPacket *p; regi...
vuln
Safe
C/C++
check_uuid(const char *uuid) { const char *p; for (p = uuid; p[0]; p++) { if ((!check_is_alpha_num(*p)) && (*p != '-')) return EINA_FALSE; } return EINA_TRUE; }
vuln
Safe
Unknown
static void setup(CuTest *tc) { char *lensdir; if (asprintf(&root, "%s/build/test-save/%s", abs_top_builddir, tc->name) < 0) { CuFail(tc, "failed to set root"); } if (asprintf(&lensdir, "%s/lenses", abs_top_srcdir) < 0) CuFail(tc, "asprintf lensdir failed"); run(t...
vuln
Vulnerable
Unknown
public function __construct(?string $message = null) { if ($message === null) { $message = _('Invalid email/password combination.'); } parent::__construct($message, 0); }
vuln
Vulnerable
PHP
@Override public void processStarted(int port, String host) { containerHost = host; containerPort = port; LOGGER.info("Interpreter container created {}:{}", containerHost, containerPort); synchronized (dockerStarted) { dockerStarted.set(true); dockerStarted.notify(); } }
vuln
Vulnerable
Java
AccessControlStatus ScriptResource::CalculateAccessControlStatus() const { AccessControlStatus ScriptResource::CalculateAccessControlStatus( const SecurityOrigin* security_origin) const { if (GetResponse().WasFetchedViaServiceWorker()) { if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque) return kO...
vuln
Safe
C/C++
private void ensureCapacityFor(@NotNull final DoubleBuffer valuesToAdd) { if(!valuesToAdd.hasRemaining()) { return; } final int currentCapacity = targetBuffer.capacity(); final int currentPosition = targetBuffer.position(); final int requiredCapacity = currentPositio...
vuln
Vulnerable
Java
gdk_pixbuf__gif_image_begin_load (ModulePreparedNotifyFunc prepare_func, ModuleUpdatedNotifyFunc update_func, gpointer user_data, GError **error) { GifContext *context; #ifdef IO_GIFDEBUG count = 0; #endif context = new_context (); if (context == NULL) { ...
vuln
Safe
Unknown
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
Vulnerable
C/C++
int h1_parse_cont_len_header(struct h1m *h1m, struct ist *value) { char *e, *n; long long cl; int not_first = !!(h1m->flags & H1_MF_CLEN); struct ist word; word.ptr = value->ptr; e = value->ptr + value->len; while (1) { if (word.ptr >= e) { /* empty header or empty value */ goto fail; } /* skip le...
vuln
Safe
C/C++
} actionItems() { let composing = new PrivateComposing(this.user); const items = new ItemList(); if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) { items.add('start_private', composing.component()); }
vuln
Vulnerable
JavaScript
int dwarf_global_formref_b(Dwarf_Attribute attr, Dwarf_Off * ret_offset, Dwarf_Bool * offset_is_info, Dwarf_Error * error) { Dwarf_Debug dbg = 0; Dwarf_Unsigned offset = 0; Dwarf_CU_Context cu_context = 0; Dwarf_Half context_version = 0; Dwarf_Byte_Ptr section_end = 0; Dwarf_Bool is_...
vuln
Vulnerable
C/C++
@Override public void validateReaderContext(ReaderContext readerContext, TransportRequest request) { if (readerContext.scrollContext() != null) { final Authentication originalAuth = readerContext.getFromContext(AuthenticationField.AUTHENTICATION_KEY); final Authentication current = s...
vuln
Vulnerable
Java
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2002-2020 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
vuln
Safe
Java
int clusterLoadConfig(char *filename) { FILE *fp = fopen(filename,"r"); struct stat sb; char *line; int maxline, j; if (fp == NULL) { if (errno == ENOENT) { return C_ERR; } else { serverLog(LL_WARNING, "Loading the cluster node config from %s:...
vuln
Vulnerable
C/C++
static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data, unsigned size) { SuperIOConfig *superio_conf = opaque; DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data); if (addr == 0x3f0) { superio_conf->index = data & 0xff; } e...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.tax; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.tax.TaxClassService; import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse; import com.salesmanager.core.business.utils.ajax....
vuln
Safe
Java
@Override protected void initListeners() { super.initListeners(); binding.queueButton.setOnClickListener(v -> onQueueClicked()); binding.segmentsButton.setOnClickListener(v -> onSegmentsClicked()); binding.addToPlaylistButton.setOnClickListener(v -> getParentActivit...
vuln
Safe
Java
static void v9fs_read(void *opaque) { int32_t fid; uint64_t off; ssize_t err = 0; int32_t count = 0; size_t offset = 7; uint32_t max_count; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &max_count); if (...
vuln
Vulnerable
Unknown
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define SkipLinesOp 0x01 #define SetColorOp 0x02 #define SkipPixelsOp 0x03 #define ByteDataOp 0x05 #define RunDataOp 0x06 #define EOFOp 0x07 #define ThrowRLEException(exception,message) \ { \ if (colormap != (unsigned char *) NUL...
vuln
Vulnerable
C/C++
rsock_init_unixsock(VALUE sock, VALUE path, int server) { struct sockaddr_un sockaddr; socklen_t sockaddrlen; int fd, status; rb_io_t *fptr; FilePathValue(path); INIT_SOCKADDR_UN(&sockaddr, sizeof(struct sockaddr_un)); if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) { rb...
vuln
Vulnerable
C/C++
private void global(AdminPerformer performer, CommandParser.Arguments arguments) { performer.success("<b>Admin console usage</b>"); performer.info("For execute a command, simply type the command name, and add arguments separated by a single space."); performer.error("<i>(!) The command and argum...
vuln
Vulnerable
Java
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
vuln
Vulnerable
Python
def _flush_outbufs_below_high_watermark(self): # check first to avoid locking if possible if self.total_outbufs_len > self.adj.outbuf_high_watermark: with self.outbuf_lock: (_, exception) = self._flush_exception(self._flush_some) if exception: ...
vuln
Vulnerable
Python
function openExternal(url) { //Only open http(s), mailto, tel, and callto links if (allowedUrls.test(url)) { shell.openExternal(url); } }
vuln
Safe
JavaScript
public PtNotice updateNotice(final PtNotice notice, final InputStream fileStream) { final String fileName = notice.getNoticeNo().replace("/", "-") + ".pdf"; final FileStoreMapper fileStore = fileStoreService.store(fileStream, fileName, "application/pdf", FILESTORE_MODULE_NAME); n...
vuln
Safe
Java
e1000e_write_lgcy_rx_descr(E1000ECore *core, uint8_t *desc, struct NetRxPkt *pkt, const E1000E_RSSInfo *rss_info, uint16_t length) { uint32_t status_flags, rss, mrq; uint16_t ip_id; struct e1000_rx_desc *d = (struct e1000_rx_de...
vuln
Vulnerable
C/C++
bool Item::cache_const_expr_analyzer(uchar **arg) { bool *cache_flag= (bool*)*arg; if (!*cache_flag) { Item *item= real_item(); /* Cache constant items unless it's a basic constant, constant field or a subselect (they use their own cache). */ if (const_item() && !(basic_const_i...
vuln
Vulnerable
Unknown
yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target, int hasAlpha) { con...
vuln
Safe
C/C++
PHP_FUNCTION(move_uploaded_file) { char *path, *new_path; int path_len, new_path_len; zend_bool successful = 0; #ifndef PHP_WIN32 int oldmask; int ret; #endif if (!SG(rfc1867_uploaded_files)) { RETURN_FALSE; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &pat...
vuln
Vulnerable
Unknown
void isis_notif_lsp_error(const struct isis_circuit *circuit, const uint8_t *lsp_id, const char *raw_pdu, size_t raw_pdu_len, __attribute__((unused)) uint32_t offset, __attribute__((unused)) uint8_t tlv_type) { const char *xpath = "/frr-isisd:lsp-error-detected"; struct list *arguments = yang_data...
vuln
Vulnerable
Unknown
private static void startLottieAnimationWith(LottieAnimationView illustrationView, Uri imageUri) { final InputStream inputStream = getInputStreamFromUri(illustrationView.getContext(), imageUri); illustrationView.setFailureListener( result -> Log.w(TAG, "Invali...
vuln
Safe
Java
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ldap import ( "errors" "gopkg.in/asn1-ber.v1" ) // SimpleBindRequest represents a username/password bind operation type SimpleBindRequest struct { ...
vuln
Vulnerable
Go
void PrintWebViewHelper::PrintNode(const WebKit::WebNode& node) { if (node.isNull() || !node.document().frame()) { return; } if (is_preview_enabled_) { print_preview_context_.InitWithNode(node); RequestPrintPreview(PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE); } else { WebKit::WebNode duplic...
vuln
Vulnerable
C/C++
static void setup_frame(int sig, struct target_sigaction *ka, target_sigset_t *set, CPUMBState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; int err = 0; int i; frame_addr = get_sigframe(ka, env, sizeof *frame); if (!lock_user_struct(VERIFY_WRITE, frame...
vuln
Vulnerable
C/C++
@Override public void detectAndSendChanges() { lastTickIndexToFlow.clear(); BatchedCrystalUpdate update = new BatchedCrystalUpdate(tile.getIDHash(), tile.getEnergyStored()); for (byte i = 0; i < tile.getFlowRates().size(); i++) { byte flow = tile.getFlowRates().get(i); ...
vuln
Safe
Java
public ResultSet getResultSet() throws SQLException { checkOpen(); if (rs.isOpen()) { throw new SQLException("ResultSet already requested"); } if (pointer.safeRunInt(DB::column_count) == 0) { return null; } if (rs.colsMeta == null) { ...
vuln
Safe
Java
private Runnable jobCheckThread() { return () -> { while (isRunnable()) { try { triggerJobMap.forEach((s, jobProfiles) -> { for (String jobId : jobProfiles.keySet()) { Map<String, JobWrapper> jobs = ...
vuln
Vulnerable
Java
static void xudc_getstatus(struct xusb_udc *udc) { struct xusb_ep *ep0 = &udc->ep[0]; struct xusb_req *req = udc->req; struct xusb_ep *target_ep; u16 status = 0; u32 epcfgreg; int epnum; u32 halt; int ret; switch (udc->setup.bRequestType & USB_RECIP_MASK) { case USB_RECIP_DEVICE: /* Get device status */ ...
vuln
Safe
C/C++
u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport) { u64 seq; __u32 hash[4]; struct keydata *keyptr = get_keyptr(); hash[0] = (__force u32)saddr; hash[1] = (__force u32)daddr; hash[2] = ((__force u16)sport << 16) + (__force u16)dport; hash[3] = keyptr->secret[11]; seq = ...
vuln
Vulnerable
C/C++
bool nfc_scene_detect_reader_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = context; bool consumed = false; if(event.type == SceneManagerEventTypeCustom) { if(event.event == NfcCustomEventViewExit) { nfc_worker_stop(nfc->worker); scene_manager_next_scene(nfc->...
vuln
Safe
C/C++
static void copyStereo8( short *dst, const int *const *src, unsigned nSamples, unsigned /* nChannels */) { for (unsigned i = 0; i < nSamples; ++i) { *dst++ = src[0][i] << 8; *dst++ = src[1][i] << 8; } }
vuln
Vulnerable
C/C++
package session import ( "context" "encoding/json" "errors" "fmt" "math" "math/rand" "net" "net/http" "os" "time" oidc "github.com/coreos/go-oidc" "github.com/dgrijalva/jwt-go/v4" log "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/argoproj/argo...
vuln
Safe
Go
@AttackVector( vulnerabilityExposed = VulnerabilityType.SIMPLE_SSRF, description = "SSRF_VULNERABILITY_URL_ONLY_IF_IN_THE_WHITELIST") @VulnerableAppRequestMapping( value = LevelConstants.LEVEL_4, htmlTemplate = "LEVEL_1/SSRF", variant = Variant.SECURE) ...
vuln
Safe
Java
static int bfi_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; BFIContext *bfi = avctx->priv_data; uint8_t *dst = bfi->dst; uint8_t *src, *dst_offset, colour1, colour2; u...
vuln
Vulnerable
C/C++
GF_EXPORT u32 gf_isom_guess_specification(GF_ISOFile *file) { u32 count, i, nb_any, nb_m4s, nb_a, nb_v, nb_auxv,nb_scene, nb_od, nb_mp3, nb_aac, nb_m4v, nb_avc, nb_amr, nb_h263, nb_qcelp, nb_evrc, nb_smv, nb_text, nb_pict; nb_m4s = nb_a = nb_v = nb_auxv = nb_any = nb_scene = nb_od = nb_mp3 = nb_aac = nb_m4v = nb_avc...
vuln
Vulnerable
C/C++
void BookmarksIOFunction::ShowSelectFileDialog( ui::SelectFileDialog::Type type, const base::FilePath& default_path) { AddRef(); WebContents* web_contents = dispatcher()->delegate()-> GetAssociatedWebContents(); select_file_dialog_ = ui::SelectFileDialog::Create( this, new ChromeSelectFil...
vuln
Vulnerable
C/C++
bool Permissions::check_remote_datawriter( const PermissionsHandle& remote_handle, const uint32_t domain_id, const WriterProxyData& publication_data, SecurityException& exception) { bool returned_value = false; const AccessPermissionsHandle& rah = AccessPermissionsHandle::narrow(...
vuln
Vulnerable
Unknown
FdInStream::FdInStream(int fd_, int timeoutms_, int bufSize_, bool closeWhenDone_) : fd(fd_), closeWhenDone(closeWhenDone_), timeoutms(timeoutms_), blockCallback(0), timing(false), timeWaitedIn100us(5), timedKbits(0), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0) { pt...
vuln
Vulnerable
C/C++
@mod.route('/delete/<int:msg_id>', methods=['GET', 'POST']) def delete(msg_id): if request.method == 'GET': cursor.execute("DELETE FROM message where msg_id = %s;", (msg_id,)) conn.commit() flash('Delete Success!') return redirect(url_for('show_entries'))
vuln
Safe
Python
function peg$parsetag() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$parseld(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsews(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsews(); } if (s2 !==...
vuln
Safe
JavaScript
public static void write(Node node, OutputStream out) throws IOException { if(node == null) { throw new NullPointerException("doc must not be null"); } if(out == null) { throw new NullPointerException("out must not be null"); } try ...
vuln
Safe
Java
static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, int is_write, sigset_t *old_set) { CPUState *cpu; CPUClass *cc; int ret; #if defined(DEBUG_SIGNAL) printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", pc, address, i...
vuln
Vulnerable
C/C++
@Override public Map<String, StoragePricing> loadFullPriceList() throws IOException, GeneralSecurityException { final GoogleCredential credentials = GoogleCredential.getApplicationDefault(); final Cloudbilling cloudBilling = new Cloudbilling.Builder(GoogleNetHttpTransport.newTrustedTransport(), ...
vuln
Vulnerable
Java
int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) { __u64 start = F2FS_BYTES_TO_BLK(range->start); __u64 end = start + F2FS_BYTES_TO_BLK(range->len) - 1; unsigned int start_segno, end_segno; struct cp_control cpc; int err = 0; if (start >= MAX_BLKADDR(sbi) || range->len < sbi->blocksize) r...
vuln
Vulnerable
Unknown
package com.salesmanager.core.business.services.common.generic; import java.io.Serializable; import java.util.List; import com.salesmanager.core.business.exception.ServiceException; /** * <p>Service racine pour la gestion des entités.</p> * * @param <T> type d'entité */ public interface SalesManagerEntityServic...
vuln
Safe
Java
PJ_DEF(pj_status_t) pjsip_ua_unregister_dlg( pjsip_user_agent *ua, pjsip_dialog *dlg ) { struct dlg_set *dlg_set; pjsip_dialog *d; /* Sanity-check arguments. */ PJ_ASSERT_RETURN(ua && dlg, PJ_EINVAL); /* Check that dialog has been registered. */ PJ_ASSERT_RETURN(dlg->dlg_set, PJ_EINV...
vuln
Safe
C/C++
protected void retrieveTokensWithVLV( TokenDatabase database, Integer start, Integer size, TokenCollection response) throws Exception { String method = "TokenService.retrieveTokensWithVLV: "; // search with VLV sorted by date in reverse order IDBV...
vuln
Safe
Java
@SuppressWarnings("deprecation") private static void openMenu(@Nonnull FriendlyByteBuf payload, @Nonnull Supplier<LocalPlayer> player) { final int containerId = payload.readVarInt(); // No barrier, SAFE final MenuType<?> type = Registry.MENU.byIdOrThrow(payload.readVarInt());...
vuln
Vulnerable
Java
make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, void *data2) { const uint16_t buf_len = 511; char buf[buf_len + 1]; struct lys_type_bit **bits = NULL; struct lyxp_expr *exp; const char *module_name, *cur_expr, *end; int i, j, count; int64_t num; uint64_t unu...
vuln
Safe
C/C++
public Map<String, Object> loadSidebar() throws IOException { try (Reader reader = Files.newBufferedReader(sidebarPath, StandardCharsets.UTF_8)) { Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); return yaml.load(reader); } }
vuln
Safe
Java
GLOBAL(void) jinit_2pass_quantizer(j_decompress_ptr cinfo) { my_cquantize_ptr cquantize; int i; cquantize = (my_cquantize_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, sizeof(my_cquantizer)); cinfo->cquantize = (struct jpeg_color_quantizer *)cquantize; ...
vuln
Vulnerable
C/C++
// Copyright 2014 The Gogs Authors. All rights reserved. // Copyright 2020 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package context import ( "context" "crypto/sha256" "encoding/hex" "errors" "html" "html/templ...
vuln
Safe
Go
void bm_roundrect(Bitmap *b, int x0, int y0, int x1, int y1, int r) { int x = -r; int y = 0; int err = 2 - 2 * r; int rad = r; bm_line(b, x0 + r, y0, x1 - r, y0); bm_line(b, x0, y0 + r, x0, y1 - r); bm_line(b, x0 + r, y1, x1 - r, y1); bm_line(b, x1, y0 + r, x1, y1 - r); do { ...
vuln
Vulnerable
C/C++
int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { struct inet_sock *inet = inet_sk(sk); struct udp_sock *up = udp_sk(sk); struct flowi4 *fl4; int ulen = len; struct ipcm_cookie ipc; struct rtable *rt = NULL; int free = 0; int connected = 0; __be32 daddr, faddr, saddr; __...
vuln
Vulnerable
Unknown
static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; uint8_t profile_level; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; if (atom.size >= (1<<28) || atom.size < 7) return AVERROR_INVALIDDATA; profile_level = avio...
vuln
Vulnerable
C/C++
Status AuthorizationManager::getBSONForRole(RoleGraph* graph, const RoleName& roleName, mutablebson::Element result) try { if (!graph->roleExists(roleName)) { return Status(ErrorCodes::RoleNotFound, ...
vuln
Safe
Unknown