code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
package com.salesmanager.shop.admin.controller.user; import com.salesmanager.core.business.services.reference.country.CountryService; import com.salesmanager.core.business.services.user.GroupService; import com.salesmanager.core.business.services.user.PermissionService; import com.salesmanager.core.business.utils.ajax...
vuln
Vulnerable
Java
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MagickPathExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize...
vuln
Safe
C/C++
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) // // This file is provided under a dual BSD/GPLv2 license. When using or // redistributing this file, you may do so under either license. // // Copyright(c) 2018 Intel Corporation. All rights reserved. // // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> ...
vuln
Vulnerable
C/C++
void ex_retab(exarg_T *eap) { linenr_T lnum; int got_tab = FALSE; long num_spaces = 0; long num_tabs; long len; long col; long vcol; long start_col = 0; // For start of white-space string long start_vcol = 0; // For start of white-space string long old_len; char_u *ptr; ...
vuln
Safe
C/C++
static int get_device_guid( char *name, int name_size, char *actual_name, int actual_name_size) { LONG status; HKEY control_net_key; DWORD len; int i = 0; int stop = 0; status = RegOpenKeyEx( HKEY_LOCAL_MACHINE, NETWORK_CONNECTIONS_KEY, 0, KEY_READ...
vuln
Vulnerable
C/C++
int CLASS parse_tiff_ifd(int base) { unsigned entries, tag, type, len, plen = 16, save; int ifd, use_cm = 0, cfa, i, j, c, ima_len = 0; char *cbuf, *cp; uchar cfa_pat[16], cfa_pc[] = {0, 1, 2, 3}, tab[256]; double fm[3][4], cc[4][4], cm[4][3], cam_xyz[4][3], num; double ab[] = {1, 1, 1, 1}, asn[] = {0, 0, 0...
vuln
Vulnerable
C/C++
private void unregisterReceiver() { if (broadcastReceiver != null) { activity.unregisterReceiver(broadcastReceiver); broadcastReceiver = null; } }
vuln
Vulnerable
Java
let write_keyval = function(key, val) { let query = "INSERT INTO tb_events (uid, key, value) VALUES " + "(" + "'" + event.uid + "', " + "'" + key + "', " + "'" + val + "'" + " );"; obj.db.run(query); };
vuln
Vulnerable
JavaScript
@NonNull public static ParsedResource getResourceFromName(@NonNull PackageManager pm, @NonNull String resName) throws PackageManager.NameNotFoundException, Resources.NotFoundException { String packageName = resName.substring(0, resName.indexOf(':')); String type = resName.substring(resNa...
vuln
Vulnerable
Java
/* {{{ proto int pspell_new_personal(string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]]) Load a dictionary with a personal wordlist*/ static PHP_FUNCTION(pspell_new_personal) { char *personal, *language, *spelling = NULL, *jargon = NULL, *encoding = NULL; int pe...
vuln
Vulnerable
Unknown
static int smacker_decode_tree(GetBitContext *gb, HuffContext *hc, uint32_t prefix, int length) { if(!get_bits1(gb)){ if(hc->current >= 256){ av_log(NULL, AV_LOG_ERROR, "Tree size exceeded!\n"); if(length){ hc->bits[hc->current] = prefix; hc->lengths[hc->current]...
vuln
Vulnerable
C/C++
static int kvm_irqchip_create(MachineState *machine, KVMState *s) { int ret; if (!machine_kernel_irqchip_allowed(machine) || (!kvm_check_extension(s, KVM_CAP_IRQCHIP) && (kvm_vm_enable_cap(s, KVM_CAP_S390_IRQCHIP, 0) < 0))) { return 0; } ret = kvm_arch_irqchip_create(s); ...
vuln
Vulnerable
C/C++
@Override public long getLong(String key, long defaultValue, int userId) { checkDatabaseReadPermission(key, userId); return mStorage.getLong(key, defaultValue, userId); }
vuln
Safe
Java
def _try_init_vertexai(cls, values: Dict) -> None: allowed_params = ["project", "location", "credentials"] params = {k: v for k, v in values.items() if k in allowed_params} init_vertexai(**params) return None
vuln
Safe
Python
def cama_current_user return @cama_current_user if defined?(@cama_current_user) # api current user... @cama_current_user = cama_calc_api_current_user return @cama_current_user if @cama_current_user return nil unless cookies[:auth_token].present? c = cookies[:auth_token].split("&") return ni...
vuln
Vulnerable
Ruby
static Image *ReadWEBPImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; int webp_status; MagickBooleanType status; register unsigned char *p; size_t length; ssize_t count, y; unsigned char header[12], *stream; WebPDecoderConfig ...
vuln
Vulnerable
C/C++
public function get_info($object_id, $table_name = '') { $table_name = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this))); // Make sure we've got a real id if ($object_id < 1) { return array(); } if (self::is_cached($table_name, $...
vuln
Vulnerable
PHP
public void addObject(NetworkRouteSegment obj) { if (obj.getId() > 0) { for (NetworkRouteSegment obj2 : objects) { if (obj.getId() == obj2.getId() && obj.direction() == obj2.direction() && obj.routeKey.equals(obj2.routeKey)) { return; } } } objects.add(obj); }
vuln
Safe
Java
protected function getSubtask() { $subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id')); if (empty($subtask)) { throw new PageNotFoundException(); } return $subtask; }
vuln
Vulnerable
PHP
def __post_init_code(self, raw_code: str, request: HttpRequest): if not raw_code: LOGGER.warning("Missing authorization code") raise TokenError("invalid_grant") allowed_redirect_urls = self.provider.redirect_uris.split() # At this point, no provider should have a blank r...
vuln
Safe
Python
getcmdline_int( int firstc, long count UNUSED, // only used for incremental search int indent, // indent for inside conditionals int clear_ccline) // clear ccline first { static int depth = 0; // call depth int c; int i; int j; int gotesc = FALSE; // TRUE when <ESC> just...
vuln
Safe
Unknown
package envoyconfig import ( "context" "encoding/base64" "fmt" "net" "net/url" "strings" "time" envoy_config_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" envoy_config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" envoy_config_endpoint_v3 "github.com/env...
vuln
Safe
Go
int av_buffersrc_add_ref(AVFilterContext *buffer_filter, AVFilterBufferRef *picref, int flags) { BufferSourceContext *c = buffer_filter->priv; AVFilterBufferRef *buf; int ret; if (!picref) { c->eof = 1; return 0; } else if (c->eof) return AVERROR(EINV...
vuln
Vulnerable
C/C++
static int handle_packet(MpegTSContext *ts, const uint8_t *packet) { MpegTSFilter *tss; int len, pid, cc, expected_cc, cc_ok, afc, is_start, is_discontinuity, has_adaptation, has_payload; const uint8_t *p, *p_end; int64_t pos; pid = AV_RB16(packet + 1) & 0x1fff; if (pid && discard_pid(ts...
vuln
Vulnerable
C/C++
static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov, unsigned int max_num_sg, bool is_write, hwaddr pa, size_t sz) { unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); if (!sz) { error_report...
vuln
Safe
Unknown
function updateSelectedTags(tags, selected, selectedColor, filter) { tagCloud.innerText = ''; var title = document.createElement('div'); title.style.marginBottom = '8px'; mxUtils.write(title, (filter != null) ? 'Select hidden tags:' : 'Or add/remove existing tags for cell(s):'); tagCloud.appendChil...
vuln
Safe
JavaScript
def _map_vol_to_host(self, volume_name, host_name): """Create a mapping between a volume to a host.""" LOG.debug(_('enter: _map_vol_to_host: volume %(volume_name)s to ' 'host %(host_name)s') % {'volume_name': volume_name, 'host_name': host_name}) # Check i...
vuln
Safe
Python
int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length, long *offset, int depth, int yield, int j, int tag, VALUE tc, long *num_read) { VALUE value, asn1data, ary; int infinite; long off = *offset; infinite = (j == 0x21); ary = rb_ary_new(); while (length > 0 || i...
vuln
Vulnerable
Unknown
@Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { LOG.info("Loading Discovery configuration."); HttpSession sess = request.getSession(true); DiscoveryConfiguration config = (DiscoveryConfiguration) sess.getAttribute...
vuln
Safe
Java
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* params; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kParams, &params)); const TfLiteTensor* indices; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kIndices, &indices)); TfLiteTensor* output; TF_LITE_ENSURE_...
vuln
Vulnerable
Unknown
verify: function(digest, d) { // remove padding d = _decodePkcs1_v1_5(d, key, true); // d is ASN.1 BER-encoded DigestInfo var obj = asn1.fromDer(d); // compare the given digest to the decrypted one return digest === obj.value[1].value; }
vuln
Vulnerable
JavaScript
/* libdcr version 0.1.8.93 03/May/2009 libdcr : copyright (C) 2007-2009, Davide Pizzolato based on dcraw.c -- Dave Coffin's raw photo decoder Copyright 1997-2009 by Dave Coffin, dcoffin a cybercom o net Covered code is provided under this license on an "as is" basis, without warranty of any kind...
vuln
Safe
C/C++
function processRows(rows) { $j.each(rows, function(ndx, row) { try { row.Message = decodeURIComponent(row.Message); } catch(e) { // ignore errors } }); return rows; }
vuln
Vulnerable
JavaScript
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt) { /* * Note: FILE_SEARCH and FILE_REGEX do not actually copy * anything, but setup pointers into the source */ if (indir == 0) { switch (type) { case FILE_SEARC...
vuln
Vulnerable
C/C++
static void set_sensor_evt_enable(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMISensor *sens; IPMI_CHECK_CMD_LEN(4); if ((cmd[2] >...
vuln
Vulnerable
C/C++
RestStatus RestAuthHandler::execute() { auto const type = _request->requestType(); if (type != rest::RequestType::POST) { generateError(rest::ResponseCode::METHOD_NOT_ALLOWED, TRI_ERROR_HTTP_METHOD_NOT_ALLOWED); return RestStatus::DONE; } bool parseSuccess = false; VPackSlice slice = this->parseVPack...
vuln
Vulnerable
C/C++
int vnc_display_pw_expire(DisplayState *ds, time_t expires) { VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; vs->expires = expires; return 0;
vuln
Vulnerable
C/C++
add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out, int check_for_overlap, int many) { int current; cmap_splay *tree; if (low > high) { fz_warn(ctx, "range limits out of range in cmap %s", cmap->cmap_name); return; } tree = cmap->tree; if (cmap->tlen) { uns...
vuln
Safe
C/C++
var pushVal = function pushVal(obj, path, val) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; if (obj === undefined || obj === null || path === undefined) { return obj; } // Clean the path path = clean(path); var pathParts = split(path); var part = pathParts.s...
vuln
Safe
JavaScript
CString CZNC::FixupEncoding(const CString& sEncoding) const { if (!m_uiForceEncoding) { return sEncoding; } if (sEncoding.empty()) { return "UTF-8"; } const char* sRealEncoding = sEncoding.c_str(); if (sEncoding[0] == '*' || sEncoding[0] == '^') { sRealEncoding++; } ...
vuln
Safe
C/C++
xfs_attr3_leaf_lookup_int( struct xfs_buf *bp, struct xfs_da_args *args) { struct xfs_attr_leafblock *leaf; struct xfs_attr3_icleaf_hdr ichdr; struct xfs_attr_leaf_entry *entry; struct xfs_attr_leaf_entry *entries; struct xfs_attr_leaf_name_local *name_loc; struct xfs_attr_leaf_name_remote *name_rmt; xfs_daha...
vuln
Vulnerable
C/C++
/* * PKCS15 emulation layer for EstEID card. * * Copyright (C) 2004, Martin Paljak <martin@martinpaljak.net> * Copyright (C) 2004, Bud P. Bruegger <bud@comune.grosseto.it> * Copyright (C) 2004, Antonino Iacono <ant_iacono@tin.it> * Copyright (C) 2003, Olaf Kirch <okir@suse.de> * * This library is free software;...
vuln
Safe
C/C++
int bn_get_bit(const bn_t a, int bit) { int d; if (bit < 0) { RLC_THROW(ERR_NO_VALID); return 0; } if (bit > bn_bits(a)) { return 0; } RLC_RIP(bit, d, bit); if (d >= a->used) { return 0; } else { return (a->dp[d] >> bit) & (dig_t)1; } }
vuln
Vulnerable
C/C++
private static NbtCompound encodeEntityToNBT(Entity entity) { NbtCompound entityNbt = new NbtCompound(); if (entity instanceof PlayerEntity player) { GameProfile profile = player.getGameProfile(); entityNbt.putString("id", "player"); if (profile.getId() != null) { ...
vuln
Vulnerable
Java
int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_function, void* exec_payload, lxc_attach_options_t* options, pid_t* attached_process) { int ret, status; pid_t init_pid, pid, attached_pid, expected; struct lxc_proc_context_info *init_ctx; char* cwd; char* new_cwd; int ipc_sockets[2]; ...
vuln
Vulnerable
Unknown
void CBINDInstallDlg::OnInstall() { BOOL success = FALSE; int oldlen; if (CheckBINDService()) StopBINDService(); InstallTags(); UpdateData(); if (!m_toolsOnly && m_accountName != LOCAL_SERVICE) { /* * Check that the Passwords entered match. */ if (m_accountPassword != m_accountPasswordConfirm) { ...
vuln
Vulnerable
Unknown
EXPORTED time_t calc_compile_time(const char *time, const char *date) { struct tm tm; char month[4]; const char *monthname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; memset(&tm, 0, sizeof(struct tm)); tm.tm_isdst = -1; sscanf(time, "%02d:%0...
vuln
Vulnerable
Unknown
package evidence import ( "bytes" "errors" "fmt" "sort" "sync" "sync/atomic" "time" "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" dbm "github.com/tendermint/tm-db" clist "github.com/tendermint/tendermint/libs/clist" "github.com/tendermint/tendermint/libs/log" tmproto "githu...
vuln
Safe
Go
protected function getCheckFileQuery() { global $zdb; $select = $zdb->select(self::TABLE); $select->columns( array( 'picture', 'format' ) ); $select->where(self::PK . ' = ' . $this->db_id); return $select; }
vuln
Vulnerable
PHP
func (sg *SecureGet) Do(ctx context.Context) error { ref, err := name.ParseReference(sg.ImageRef) if err != nil { return err } opts := []remote.Option{ remote.WithAuthFromKeychain(authn.DefaultKeychain), remote.WithContext(ctx), } co := &cosign.CheckOpts{ ClaimVerifier: cosign.SimpleClaimVerifier, ...
vuln
Vulnerable
Go
function buildHttpOptions(installerfileURL) { var options = { host: url.parse(installerfileURL).host, port: 443, path: url.parse(installerfileURL).pathname }; var proxyStr; var child = exec('npm config get proxy', function(error, s...
vuln
Safe
JavaScript
static int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode, struct posix_acl *acl, int type) { int ret, size = 0; const char *name; char *value = NULL; switch (type) { case ACL_TYPE_ACCESS: name = XATTR_NAME_POSIX_ACL_ACCESS; if (acl) { ret = posix_acl_equiv_mode(acl, &inode->i_mo...
vuln
Vulnerable
C/C++
async fn main() -> Result<(), Box<dyn std::error::Error>> { let args = set_command_line_args().get_matches(); env::set_var("RUST_LOG", "swhkd=warn"); if args.is_present("debug") { env::set_var("RUST_LOG", "swhkd=trace"); } env_logger::init(); log::trace!("Logger initialized."); le...
vuln
Vulnerable
Rust
void Perl_my_setenv(pTHX_ const char *nam, const char *val) { dVAR; char *envstr; const Size_t nlen = strlen(nam); Size_t vlen; if (!val) { val = ""; } vlen = strlen(val); envstr = S_env_alloc(NULL, nlen, vlen, 2, 1); my_setenv_format(envstr, nam, nlen, val, vlen); (void)...
vuln
Safe
C/C++
@Override public default void flip(EntityPlayer player, ItemStack stack, Axis axis, boolean client) { LittlePreviews previews = getLittlePreview(stack, false); if (previews == null || previews.isEmpty()) return; previews.flipPreviews(axis, previews.getContext().rotationCenter); ...
vuln
Safe
Java
int zfp_prec_compress(const uint8_t *input, int32_t input_len, uint8_t *output, int32_t output_len, uint8_t meta, blosc2_cparams *cparams, const void *chunk) { BLOSC_UNUSED_PARAM(chunk); ZFP_ERROR_NULL(input); ZFP_ERROR_NULL(output); ZFP_ERROR_NULL(cparams); ZFP_ERROR_NULL(cparams->schun...
vuln
Safe
C/C++
static void do_dma_memory_set(dma_addr_t addr, uint8_t c, dma_addr_t len) { #define FILLBUF_SIZE 512 uint8_t fillbuf[FILLBUF_SIZE]; int l; memset(fillbuf, c, FILLBUF_SIZE); while (len > 0) { l = len < FILLBUF_SIZE ? len : FILLBUF_SIZE; cpu_physical_memory_rw(addr, fillbuf, l, true); ...
vuln
Safe
C/C++
@Override public List<KeyframeAnimation> read(InputStream inputStream, String filename) throws EmoteSerializerException { try{ List<KeyframeAnimation> deserialized = AnimationSerializing.deserializeAnimation(inputStream); if (deserialized == null) throw new IOException("Can't load em...
vuln
Safe
Java
void rfbTightCleanup(rfbScreenInfoPtr screen) { if(tightBeforeBufSize) { free(tightBeforeBuf); tightBeforeBufSize=0; tightBeforeBuf = NULL; } if(tightAfterBufSize) { free(tightAfterBuf); tightAfterBufSize=0; tightAfterBuf = NULL; } }
vuln
Safe
Unknown
static void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq, void *iommu, qemu_irq *dev_irq) { DeviceState *dev; SysBusDevice *s; dev = qdev_create(NULL, "sparc32_dma"); qdev_prop_set_ptr(dev, "iommu_opaque", iommu); qdev_init(dev); s = sysbus_from_q...
vuln
Vulnerable
C/C++
// SPDX-License-Identifier: Apache-2.0 // Copyright Authors of Cilium package clustermesh import ( "bytes" "context" "encoding/base64" "encoding/json" "errors" "fmt" "io" "net" "regexp" "strconv" "strings" "text/tabwriter" "time" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/...
vuln
Safe
Go
package git import ( "bufio" "bytes" "crypto/tls" "crypto/x509" "fmt" "io" "io/ioutil" "net" "net/http" "net/url" "os" "os/exec" "path/filepath" "strings" "time" "github.com/pkg/errors" "github.com/rancher/wrangler/pkg/randomtoken" "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "golang.org...
vuln
Vulnerable
Go
protected boolean isThisPipeBlock(Block block) { return block != null && block.getClass().isAssignableFrom(getClass()); }
vuln
Safe
Java
void GDataFileSystem::OnSearch(const SearchCallback& callback, GetDocumentsParams* params, GDataFileError error) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (error != GDATA_FILE_OK) { if (!callback.is_null()) callback.Run(error...
vuln
Safe
C/C++
static int _free_pwd_session (pwd_session_t *session) { BN_clear_free(session->private_value); BN_clear_free(session->peer_scalar); BN_clear_free(session->my_scalar); BN_clear_free(session->k); EC_POINT_clear_free(session->my_element); EC_POINT_clear_free(session->peer_element); EC_GROUP_free(session->group); E...
vuln
Vulnerable
Unknown
cib_recv_plaintext(int sock) { char *buf = NULL; ssize_t rc = 0; ssize_t len = 0; ssize_t chunk_size = 512; buf = calloc(1, chunk_size); while (1) { errno = 0; rc = read(sock, buf + len, chunk_size); crm_trace("Got %d more bytes. errno=%d", (int)rc, errno); ...
vuln
Vulnerable
C/C++
TPM_RC TPML_TAGGED_TPM_PROPERTY_Unmarshal(TPML_TAGGED_TPM_PROPERTY *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; UINT32 i; if (rc == TPM_RC_SUCCESS) { rc = UINT32_Unmarshal(&target->count, buffer, size); } if (rc == TPM_RC_SUCCESS) { if (target->count > MAX_TPM_PROPERTIES) {...
vuln
Vulnerable
C/C++
static Image *ReadJNGImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType logging, status; MngInfo *mng_info; char magic_number[MaxTextExtent]; size_t count; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); ...
vuln
Safe
C/C++
MEM_STATIC size_t ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ZSTD_entropyCTables_t const* prevEntropy, ZSTD_entropyCTables_t* nextEntropy, ZSTD_CCtx_params const* cctxParams, void* dst, ...
vuln
Safe
C/C++
def _pyi_rthook(): import atexit import os import shutil import win32com import _pyi_rth_utils # PyInstaller's run-time hook utilities module # Create temporary directory. # Use our replacement for `tempfile.mkdtemp` function that properly restricts access to directory on all platforms. ...
vuln
Safe
Python
mm_sshpam_init_ctx(Authctxt *authctxt) { Buffer m; int success; debug3("%s", __func__); buffer_init(&m); buffer_put_cstring(&m, authctxt->user); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m); debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__); mm_request_receive_expect(pmonitor->m...
vuln
Vulnerable
Unknown
Mac_Read_POST_Resource( FT_Library library, FT_Stream stream, FT_Long *offsets, FT_Long resource_cnt, FT_Long face_index, FT_Face *aface ) { FT_Error error = FT_Err...
vuln
Vulnerable
Unknown
handler: function (grid, rowIndex) { let data = grid.getStore().getAt(rowIndex); pimcore.helpers.deleteConfirm(t('translation'), Ext.util.Format.htmlEncode(data.data.key), function () { grid.getStore().removeAt(rowIndex); ...
vuln
Safe
JavaScript
av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation) { const int isRgb = c->dstFormat==PIX_FMT_RGB32 || c->dstFormat==PIX_FMT_RGB32_1 || c->ds...
vuln
Safe
C/C++
av_cold int ff_mpv_common_init(MpegEncContext *s) { int i; int nb_slices = (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1; if (s->encoding && s->avctx->slices) nb_slices = s->avctx->slices; if (s->codec_id ==...
vuln
Vulnerable
C/C++
# Copyright (c) 2013-2017 by Ron Frederick <ronf@timeheart.net>. # All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Eclipse Public License v1.0 which accompanies this # distribution and is available at: # # http://www.eclipse.org/legal/epl-v10.html # #...
vuln
Vulnerable
Python
public static String getRelativePath(File rootDir, String absolutePath) { String rootDirPath = normalizeToUnix(rootDir.getAbsolutePath()); String objectPath = normalizeToUnix(absolutePath); if (objectPath.startsWith(rootDirPath)) { objectPath = objectPath.substring(rootDirPath.length()); } if ...
vuln
Safe
Java
ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, handle_t *handle, unsigned int reserv_clstrs) { struct buffer_head *bitmap_bh = NULL; struct ext4_group_desc *gdp; struct buffer_head *gdp_bh; struct ext4_sb_info *sbi; struct super_block *sb; ext4_fsblk_t block; int err, len; BUG_ON(ac->ac_st...
vuln
Vulnerable
Unknown
static int get_v4l2_ext_controls32(struct file *file, struct v4l2_ext_controls *kp, struct v4l2_ext_controls32 __user *up) { struct v4l2_ext_control32 __user *ucontrols; struct v4l2_ext_control __user *kcontrols; unsigned int n; compat_caddr_t p; if (!access_ok(VERIFY_READ, up, sizeof(*up)) || ...
vuln
Vulnerable
Unknown
const got = require('@/utils/got'); const utils = require('./utils'); const config = require('@/config').value; module.exports = async (ctx) => { const site = ctx.params.site; const only_media = ctx.params.only_media ? 'true' : 'false'; if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSit...
vuln
Safe
JavaScript
static void Sp_replace_regexp(js_State *J) { js_Regexp *re; const char *source, *s, *r; js_Buffer *sb = NULL; int n, x; Resub m; source = checkstring(J, 0); re = js_toregexp(J, 1); if (js_doregexec(J, re->prog, source, &m, 0)) { js_copy(J, 0); return; } re->last = 0; loop: s = m.sub[0].sp; n = m.sub...
vuln
Safe
Unknown
NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd) { connection_struct *conn = fsp->conn; uid_t user = (uid_t)-1; gid_t grp = (gid_t)-1; SMB_STRUCT_STAT sbuf; DOM_SID file_owner_sid; DOM_SID file_grp_sid; canon_ace *file_ace_list = NULL; canon_ace *dir_ace_list = NULL; bool acl_pe...
vuln
Safe
Unknown
int attribute_align_arg sws_scale(struct SwsContext *c, const uint8_t * const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride...
vuln
Safe
C/C++
static int follow_dotdot_rcu(struct nameidata *nd) { struct inode *inode = nd->inode; if (!nd->root.mnt) set_root_rcu(nd); while (1) { if (path_equal(&nd->path, &nd->root)) break; if (nd->path.dentry != nd->path.mnt->mnt_root) { struct dentry *old = nd->path.dentry; struct dentry *parent = old->d_par...
vuln
Safe
C/C++
static void net_slirp_cleanup(NetClientState *nc) { SlirpState *s = DO_UPCAST(SlirpState, nc, nc); slirp_cleanup(s->slirp); qemu_remove_exit_notifier(&s->exit_notifier); slirp_smb_cleanup(s); QTAILQ_REMOVE(&slirp_stacks, s, entry); }
vuln
Vulnerable
C/C++
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { mainPage } from "../../support/page_objects/mainPage"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${ dbType === "xcdb" ? "Meta - " : "" }${apiType...
vuln
Vulnerable
JavaScript
int cp_cmlhs_gen(bn_t x[], gt_t hs[], size_t len, uint8_t prf[], size_t plen, bn_t sk, g2_t pk, bn_t d, g2_t y, int bls) { g1_t g1; g2_t g2; gt_t gt; bn_t n; int result = RLC_OK; g1_null(g1); g2_null(g2); gt_null(gt); bn_null(n); RLC_TRY { bn_new(n); g1_new(g1); g2_new(g2); gt_new(gt); pc_get_o...
vuln
Vulnerable
C/C++
zip_int64_t _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error) { zip_uint8_t buf[CDENTRYSIZE]; zip_uint16_t dostime, dosdate; zip_uint32_t size, variable_size; zip_uint16_t filename_len, comment_len, ef_len; bool from_buffer = (buffer != NUL...
vuln
Safe
C/C++
public int getInsertThrottleThresholdInPercentage() { Object val = this.parameterMap.getOrDefault( INSERT_THROTTLE_THRESHOLD_IN_PERCENTAGE, INSERT_THROTTLE_THRESHOLD_IN_PERCENTAGE_DEFAULT); if (val instanceof String) { return Integer.parseInt(val.toString()); } retu...
vuln
Safe
Java
private void getPowders(StringBuilder urlData, NonNullList<ItemStack> inventory, int slot) { ItemStack stack = inventory.get(slot); if (ItemUtils.getStringLore(stack).contains("Powder Slots [")) { ItemUtils.getLore(stack).forEach(line -> { if (line.contains("Powder Slots ["))...
vuln
Vulnerable
Java
function render() { if (panel.legendType === "On graph" || !panel.legend.show) { $container.empty(); elem.find(".piechart-legend").css("padding-top", 0); return; } else { elem.find(".piechart-legend").css("padding-top", 6); ...
vuln
Safe
JavaScript
static void lsi_execute_script(LSIState *s) { PCIDevice *pci_dev = PCI_DEVICE(s); uint32_t insn; uint32_t addr, addr_high; int opcode; int insn_processed = 0; s->istat1 |= LSI_ISTAT1_SRUN; again: s->istat1 |= LSI_ISTAT1_SRUN; again: insn_processed++; insn = read_dword(s, s->dsp...
vuln
Vulnerable
Unknown
tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected ) { byte readbuf[TRUST_RECORD_LEN]; const byte *buf, *p; gpg_error_t err = 0; int n, i; if( db_fd == -1 ) open_db(); buf = get_record_from_cache( recnum ); if( !buf ) { if( lseek( db_fd, recnum * TRUST_RECORD_LEN, SEEK_SET ) == ...
vuln
Vulnerable
Unknown
def _get_parsed_bigquery_log_events( self, project_id: str, limit: Optional[int] = None ) -> Iterable[AuditEvent]: audit_log_api = BigQueryAuditLogApi( self.report.audit_log_api_perf, self.config.rate_limit, self.config.requests_per_min, ) # We adj...
vuln
Safe
Python
f=mxUtils.button(f,c);f.insertBefore(d,f.firstChild);f.style.marginTop="6px";f.className="geBigButton";f.style.fontSize="18px";f.style.padding="14px";m.appendChild(n);m.appendChild(b);m.appendChild(f);this.container=m},FontDialog=function(b,e,f,c,m){function n(t){this.style.border="";13==t.keyCode&&O.click()}var v=docu...
vuln
Safe
JavaScript
int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *key, struct btrfs_path *p, int ins_len, int cow) { struct extent_buffer *b; int slot; int ret; int err; int level; int lowest_unlock = 1; int root_lock; /* everything at write_lock_level or lower m...
vuln
Safe
C/C++
void printIFD(std::ostream& out, PrintStructureOption option, uint64_t dir_offset, int depth) { BasicIo& io = Image::io(); depth++; bool bFirst = true; // buffer bool bPrint = true; ...
vuln
Vulnerable
C/C++
static int protocol_client_auth_sasl_step_len(VncState *vs, uint8_t *data, size_t len) { uint32_t steplen = read_u32(data, 0); VNC_DEBUG("Got client step len %d\n", steplen); if (steplen > SASL_DATA_MAX_LEN) { VNC_DEBUG("Too much SASL data %d\n", steplen); vnc_client_error(vs); retur...
vuln
Vulnerable
C/C++
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { php_url *url; size_t old_len = Z_STRLEN_P(value); if (flags & (FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) { php_error_docref(NULL, E_DEPRECATED, "explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is dep...
vuln
Vulnerable
C/C++
static void spl_ptr_heap_insert(spl_ptr_heap *heap, spl_ptr_heap_element elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */ int i; if (heap->count+1 > heap->max_size) { /* we need to allocate more memory */ heap->elements = (void **) safe_erealloc(heap->elements, sizeof(spl_ptr_heap_element), (heap->max_size), (si...
vuln
Safe
Unknown