code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl) { int i, j; unsigned int total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); if ((ctx->num + inl) < ctx...
vuln
Vulnerable
Unknown
/* * 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
Safe
Java
ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) { char current_path[MAXPGPATH]; char filename[MAXPGPATH]; int current_len_left; int current_padding = 0; bool basetablespace = PQgetisnull(res, rownum, 0); char *copybuf = NULL; FILE *file = NULL; if (basetablespace) strlcpy(curren...
vuln
Safe
Unknown
static inline void hid_map_usage_clear(struct hid_input *hidinput, struct hid_usage *usage, unsigned long **bit, int *max, __u8 type, __u16 c) { hid_map_usage(hidinput, usage, bit, max, type, c); if (*bit) clear_bit(usage->code, *bit); }
vuln
Safe
Unknown
static av_cold int roq_encode_init(AVCodecContext *avctx) { RoqContext *enc = avctx->priv_data; av_lfg_init(&enc->randctx, 1); enc->framesSinceKeyframe = 0; if ((avctx->width & 0xf) || (avctx->height & 0xf)) { av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n"); return AV...
vuln
Vulnerable
C/C++
RTCState *rtc_init(int base_year) { ISADevice *dev; dev = isa_create("mc146818rtc"); qdev_prop_set_int32(&dev->qdev, "base_year", base_year); qdev_init_nofail(&dev->qdev); return DO_UPCAST(RTCState, dev, dev); }
vuln
Safe
C/C++
package io.swagger.client.api; import io.swagger.client.ApiException; import io.swagger.client.ApiClient; import io.swagger.client.ApiResponse; import io.swagger.client.Configuration; import io.swagger.client.Pair; import javax.ws.rs.core.GenericType; import java.math.BigDecimal; import io.swagger.client.model.Clien...
vuln
Vulnerable
Java
static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_int hlen) { uint8_t optlen, i; ND_TCHECK(*option); if (*option >= 32) { ND_TCHECK(*(option+1)); optlen = *(option +1); if (optlen < 2) { if (*option >= 128) ND_PRINT((ndo, "CCID option %u optlen too short", *option)); ...
vuln
Vulnerable
C/C++
OMX_ERRORTYPE SimpleSoftOMXComponent::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamPortDefinition: { OMX_PARAM_PORTDEFINITIONTYPE *defParams = (OMX_PARAM_PORTDEFINITIONTYPE *)params; if (!isValidOMXParam(defParam...
vuln
Safe
C/C++
/* * Copyright (c) 2006-2020, JGraph Ltd * * This provides an indirection to make sure the mxClient.js * loads before the dependent classes below are loaded. This * is used for development mode where the JS is in separate * files and the mxClient.js loads other files. */ if (!mxIsElectron && location.protocol !...
vuln
Safe
JavaScript
int drm_mode_dirtyfb_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_clip_rect __user *clips_ptr; struct drm_clip_rect *clips = NULL; struct drm_mode_fb_dirty_cmd *r = data; struct drm_mode_object *obj; struct drm_framebuffer *fb; unsigned flags; int num_clips; int ret =...
vuln
Safe
Unknown
ieee802_11_print(netdissect_options *ndo, const u_char *p, u_int length, u_int orig_caplen, int pad, u_int fcslen) { uint16_t fc; u_int caplen, hdrlen, meshdrlen; struct lladdr_info src, dst; int llc_hdrlen; caplen = orig_caplen; /* Remove FCS, if present */ if (length < fcslen...
vuln
Vulnerable
C/C++
private void unzipFile(Path file, Path outputDir) throws IOException { ZipFile zipFile = new ZipFile(file.toFile()); try { Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); ...
vuln
Vulnerable
Java
package com.salesmanager.core.business.services.common.generic; import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import com.salesmanager.core.business.exception.ServiceException; import com.salesmanager.core....
vuln
Safe
Java
static int smtp_command_parse_parameters(struct smtp_command_parser *parser) { const unsigned char *p, *mp; uoff_t max_size = (parser->auth_response ? parser->limits.max_auth_size : parser->limits.max_parameters_size); /* We assume parameters to match textstr (HT, SP, Printable US-ASCII). For command parame...
vuln
Vulnerable
Unknown
def on_send_leave_request(self, origin, pdu): """ We have received a leave event for a room. Fully process it.""" event = pdu logger.debug( "on_send_leave_request: Got event: %s, signatures: %s", event.event_id, event.signatures, ) event.inte...
vuln
Vulnerable
Python
xmlHashComputeQKey(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3) { unsigned long value = 0L; char ch; if (prefix != NULL) value += 30 * (*prefix); else value += 30 * (*n...
vuln
Vulnerable
Unknown
package api type Resource struct { ID int `json:"id"` // Standard fields CreatorID int `json:"creatorId"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Filename string `json:"filename"` Blob []byte `json:"-"` Type string `json:"type"` Size int...
vuln
Vulnerable
Go
transform_chain_param(struct rte_crypto_sym_xform *xforms, VhostUserCryptoSessionParam *param) { struct rte_crypto_sym_xform *xform_cipher, *xform_auth; int ret; switch (param->chaining_dir) { case VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER: xform_auth = xforms; xform_cipher = xforms->next; xform_c...
vuln
Vulnerable
Unknown
public void setCdDtlNo(String[] cdDtlNo) { this.cdDtlNo = cdDtlNo != null ? cdDtlNo.clone() : null; }
vuln
Safe
Java
public void updateMessageId (long oldMessageId, long newMessageId, boolean success) { this.messageId = newMessageId; if (mediaWrapper != null) { mediaWrapper.updateMessageId(oldMessageId, newMessageId, success); } if (component != null) { if (component.getFileProgress() != null) { co...
vuln
Safe
Java
@Override public boolean canAuthenticate(RequestContext requestContext) { if (isJWTEnabled(requestContext)) { String authHeaderValue = retrieveAuthHeaderValue(requestContext); return authHeaderValue != null && authHeaderValue.trim().split("\\s+").length == 2 && ...
vuln
Vulnerable
Java
static int mpeg_decode_postinit(AVCodecContext *avctx) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; uint8_t old_permutation[64]; int ret; if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) { avctx->sample_aspect_ratio = av_d2q(1.0 / ff_mpeg1_aspect[s->a...
vuln
Vulnerable
C/C++
int main_loop(void *opaque) { struct pollfd ufds[2], *pf, *serial_ufd, *net_ufd, *gdb_ufd; int ret, n, timeout; uint8_t ch; CPUState *env = global_env; if (!term_inited) { term_inited = 1; term_init(); } for(;;) { ret = cpu_x86_exec(env); if (reset_re...
vuln
Vulnerable
C/C++
private void validatePolicyId(List<AuthorizationPolicy> policies) throws AuthorizationException { if (policies.stream().anyMatch(p -> Utils.isEmpty(p.getPolicyId()))) { throw new AuthorizationException("Malformed policy with empty/null policy Id's"); } // check for duplicates ...
vuln
Vulnerable
Java
/* * Description: * History: yang@haipo.me, 2017/04/26, create */ # include <stdbool.h> # include <openssl/sha.h> # include "ut_log.h" # include "ut_misc.h" # include "ut_base64.h" # include "ut_ws_svr.h" struct ws_frame { uint8_t fin; uint8_t opcode; uint64_t payload_len; void ...
vuln
Safe
C/C++
void appendCommand(client *c) { size_t totlen; robj *o, *append; o = lookupKeyWrite(c->db,c->argv[1]); if (o == NULL) { /* Create the key */ c->argv[2] = tryObjectEncoding(c->argv[2]); dbAdd(c->db,c->argv[1],c->argv[2]); incrRefCount(c->argv[2]); totlen = stringO...
vuln
Safe
C/C++
void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, uint32_t max_frags, bool has_virt_hdr) { struct NetTxPkt *p = g_malloc0(sizeof *p); p->pci_dev = pci_dev; p->vec = g_malloc((sizeof *p->vec) * (max_frags + NET_TX_PKT_PL_START_FRAG)); p->raw = g_malloc((sizeof *p->raw) * ...
vuln
Vulnerable
Unknown
static void xbr4x(AVFrame *input, AVFrame *output, const uint32_t *r2y) { const int nl = output->linesize[0]>>2; const int nl1 = nl + nl; const int nl2 = nl1 + nl; int x, y; for (y = 0; y < input->height; y++) { uint32_t * E = (uint32_t *)(output->data[0] + y * output->linesize[0] * 4); ...
vuln
Safe
C/C++
void lsetCommand(client *c) { robj *o = lookupKeyWriteOrReply(c,c->argv[1],shared.nokeyerr); if (o == NULL || checkType(c,o,OBJ_LIST)) return; long index; robj *value = c->argv[3]; if (sdslen(value->ptr) > LIST_MAX_ITEM_SIZE) { addReplyError(c, "Element too large"); return; } ...
vuln
Safe
Unknown
@Nonnull Map<Identifier, Category> categories();
vuln
Safe
Java
public void selection_updated(int old_cursor, int new_cursor) { if (new_cursor == _cursor) // Just typing return; if (new_cursor == 0) { // Detect whether the input box has been cleared CharSequence t = _ic.getTextAfterCursor(1, 0); if (t != null && t.equals("")) _should_up...
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
Safe
C/C++
void ConnectionManagerImpl::ActiveStream::recreateStream( StreamInfo::FilterStateSharedPtr filter_state) { // n.b. we do not currently change the codecs to point at the new stream // decoder because the decoder callbacks are complete. It would be good to // null out that pointer but should not be necessary. ...
vuln
Vulnerable
Unknown
uint64_t esp_reg_read(ESPState *s, uint32_t saddr) { uint32_t old_val; trace_esp_mem_readb(saddr, s->rregs[saddr]); switch (saddr) { case ESP_FIFO: if ((s->rregs[ESP_RSTAT] & STAT_PIO_MASK) == 0) { /* Data out. */ qemu_log_mask(LOG_UNIMP, "esp: PIO data read not impl...
vuln
Safe
Unknown
public CreateCommentResponse save(CreateCommentRequest createCommentRequest) { CreateCommentResponse createCommentResponse = new CreateCommentResponse(); if (createCommentRequest.getLogId() != null && createCommentRequest.getComment() != null) { if (isAllowComment(Integer.valueOf(createComme...
vuln
Vulnerable
Java
from textwrap import dedent from httpie.cli.argparser import HTTPieManagerArgumentParser from httpie import __version__ COMMANDS = { 'plugins': { 'help': 'Manage HTTPie plugins.', 'install': [ 'Install the given targets from PyPI ' 'or from a local paths.', { ...
vuln
Vulnerable
Python
private Set<Integer> checkUpdatedTable() { HashSet<Integer> invalidatedTableIds = new HashSet<>(); Cursor cursor = mDatabase.query(new SimpleSQLiteQuery(SELECT_UPDATED_TABLES_SQL)); //noinspection TryFinallyCanBeTryWithResources try { while (cursor.moveToN...
vuln
Safe
Java
def generate_id_verification_code() -> str: """ Generate one-time identity verification code """ return str(random.choice(range(100000, 999999)))
vuln
Vulnerable
Python
def users_to_notify_popup # anyone already attached to the task should be removed excluded_ids = params[:watcher_ids].blank? ? 0 : params[:watcher_ids] @users = current_user.customer.users.active.where("id NOT IN (#{excluded_ids})").order('name').limit(50) @task = AbstractTask.accessed_by(current_user)....
vuln
Vulnerable
Ruby
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
vuln
Vulnerable
Java
package com.salesmanager.core.business.utils; import java.awt.AlphaComposite; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Transparency; import java.awt.image.BufferedImage; /** * Utility class for image resize functions * @author Carl Samson * */ public class ProductImageSizeUtils ...
vuln
Safe
Java
static uint64_t icp_pit_read(void *opaque, hwaddr offset, unsigned size) { icp_pit_state *s = (icp_pit_state *)opaque; int n; n = offset >> 8; if (n > 2) { qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad timer %d\n", __func__, n); } return arm_timer_read(s->time...
vuln
Vulnerable
C/C++
e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size) { E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque; struct e1000_rx_desc desc; target_phys_addr_t base; unsigned int n, rdt; uint32_t rdh_start; uint16_t vlan_special = 0; uint8_t vlan_status = 0, vlan_offset = 0; uin...
vuln
Safe
C/C++
public void unload(AssetDesc asset) { final AssetContainer container = loadedAssets.get(asset); if (container == null) return; boolean released = container.release(); if (released) loadedAssets.remove(asset); log.debug("container released? {}", released); }
vuln
Safe
Java
GC_INNER ptr_t GC_scratch_alloc(size_t bytes) { ptr_t result = scratch_free_ptr; word bytes_to_get; bytes = ROUNDUP_GRANULE_SIZE(bytes); for (;;) { scratch_free_ptr += bytes; if ((word)scratch_free_ptr <= (word)GC_scratch_end_ptr) { /* Unallocated space of scratch buffer has...
vuln
Vulnerable
C/C++
static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs) { int ret; GlusterAIOCB acb; BDRVGlusterState *s = bs->opaque; acb.size = 0; acb.ret = 0; acb.coroutine = qemu_coroutine_self(); acb.aio_context = bdrv_get_aio_context(bs); ret = glfs_fsync_async(s->fd, gluster_f...
vuln
Safe
C/C++
static int parse_source_parameters(AVDiracSeqHeader *dsh, GetBitContext *gb, void *log_ctx) { AVRational frame_rate = { 0, 0 }; unsigned luma_depth = 8, luma_offset = 16; int idx; int chroma_x_shift, chroma_y_shift; if (get_bits1(gb)) { dsh->width...
vuln
Vulnerable
C/C++
void LayerTreeHost::PushPropertiesTo(LayerTreeImpl* tree_impl) { tree_impl->set_needs_full_tree_sync(needs_full_tree_sync_); needs_full_tree_sync_ = false; if (hud_layer_.get()) { LayerImpl* hud_impl = tree_impl->LayerById(hud_layer_->id()); tree_impl->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(...
vuln
Safe
C/C++
/* SPDX-License-Identifier: GPL-2.0 */ /* * vboxguest linux pci driver, char-dev and input-device code, * * Copyright (C) 2006-2016 Oracle Corporation */ #include <linux/input.h> #include <linux/kernel.h> #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/poll.h> #includ...
vuln
Safe
C/C++
public function rules() { // todo with multilanguage $rules = [ 'title' => 'required|max:500', 'url' => 'max:500', 'description' => 'max:500', 'content_meta_title' => 'max:500', 'content_meta_keywords' => 'max:500', 'original_l...
vuln
Safe
PHP
public function get_item( $request ) { $id = (int) $request['id']; $user = get_userdata( $id ); if ( empty( $id ) || empty( $user->ID ) ) { return new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) ); } $user = $this->prepare_item_for_response( $user, $request ); ...
vuln
Vulnerable
PHP
static int rtnetlink_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, int type, u32 pid, u32 seq, u32 change, unsigned int flags) { struct ifinfomsg *r; struct nlmsghdr *nlh; unsigned char *b = skb->tail; nlh = NLMSG_NEW(skb, pid, seq, type, sizeof(*r), flags); r = NLMSG_DATA(nlh); r->ifi_fa...
vuln
Vulnerable
Unknown
static void perf_remove_from_owner(struct perf_event *event) { struct task_struct *owner; rcu_read_lock(); owner = ACCESS_ONCE(event->owner); /* * Matches the smp_wmb() in perf_event_exit_task(). If we observe * !owner it means the list deletion is complete and we can indeed * free this event, otherwise we n...
vuln
Vulnerable
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
Safe
C/C++
SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event) { int error; int did_lock_epmutex = 0; struct file *file, *tfile; struct eventpoll *ep; struct epitem *epi; struct epoll_event epds; error = -EFAULT; if (ep_op_has_event(op) && copy_from_user(&epds, event, sizeof...
vuln
Safe
C/C++
static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_usb_hdr *usb_hdr, int len) { struct oz_data *data_hdr = (struct oz_data *)usb_hdr; switch (data_hdr->format) { case OZ_DATA_F_MULTIPLE_FIXED: { struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body...
vuln
Safe
C/C++
ofputil_pull_ofp11_group_mod(struct ofpbuf *msg, enum ofp_version ofp_version, struct ofputil_group_mod *gm) { const struct ofp11_group_mod *ogm; enum ofperr error; ogm = ofpbuf_pull(msg, sizeof *ogm); gm->command = ntohs(ogm->command); gm->type = ogm->type; gm->gro...
vuln
Safe
Unknown
/* * Copyright (c) 2008-2017 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
vuln
Safe
C/C++
auth_read_binary(struct sc_card *card, unsigned int offset, unsigned char *buf, size_t count, unsigned long flags) { int rv; struct sc_pkcs15_bignum bn[2]; unsigned char *out = NULL; bn[0].data = NULL; bn[1].data = NULL; LOG_FUNC_CALLED(card->ctx); sc_log(card->ctx, "offset %i; size %"SC_FORMAT_L...
vuln
Vulnerable
C/C++
@Override public void render(Firefly entity, float yaw, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumers, int light) { boolean nectar = false; if (entity.hasCustomName()) { nectar = entity.getCustomName().getString().toLowerCase().contains("nectar"); } ...
vuln
Safe
Java
@staticmethod def _add_to_db(user): """ Adds User object to the database :param user: User object with info about user :return: None """ query = ("INSERT INTO users (chat_id, first_name, nickname, " "last_name, language) " f"VALUES (%...
vuln
Safe
Python
static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output, char* timezone_out, size_t timezone_out_len) { base::Pickle request; request.WriteInt(LinuxSandbox::METHOD_LOCALTIME); request.WriteString( std::string(r...
vuln
Safe
C/C++
OMX_ERRORTYPE SoftG711::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPcm: { OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (!isValidOMXParam(pcmParams)) { ...
vuln
Safe
C/C++
static void xen_netbk_tx_submit(struct xen_netbk *netbk) { struct gnttab_copy *gop = netbk->tx_copy_ops; struct sk_buff *skb; while ((skb = __skb_dequeue(&netbk->tx_queue)) != NULL) { struct xen_netif_tx_request *txp; struct xenvif *vif; u16 pending_idx; unsigned data_len; pending_idx = *((u16 *)skb->dat...
vuln
Vulnerable
C/C++
private void redirectToPage(final HttpServletRequest req, final HttpServletResponse res) throws IOException { Object originalRequestUrl = req.getSession().getAttribute(REQUESTED_URL); if (originalRequestUrl != null) { res.sendRedirect(originalRequestUrl.toString()); } else { res.sendRedire...
vuln
Vulnerable
Java
bool Item_field::fix_fields(THD *thd, Item **reference) { DBUG_ASSERT(fixed == 0); Field *from_field= (Field *)not_found_field; bool outer_fixed= false; SELECT_LEX *select= thd->lex->current_select; if (select && select->in_tvc) { my_error(ER_FIELD_REFERENCE_IN_TVC, MYF(0), full_name()); return(1);...
vuln
Vulnerable
Unknown
@Override public SQLStatement preHandle(DumpFileContext context, String stmt) throws SQLSyntaxErrorException { String schema; stmt = stmt.replace("/*!", "/*#").replace("\r", ""); SQLStatement sqlStatement = RouteStrategyFactory.getRouteStrategy().parserSQL(stmt); if (sqlStatement ins...
vuln
Safe
Java
void CreateAuthenticatorFactory() { DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); if (!host_ || shutting_down_) return; std::string local_certificate = key_pair_.GenerateCertificate(); if (local_certificate.empty()) { LOG(ERROR) << "Failed to generate host certifi...
vuln
Safe
C/C++
public void incrementInTicksFromCondition(DataKey<Float> dataKey, boolean condition, float ticksToIncrement, float ticksToDecrement){ ticksToIncrement = Math.max(1, ticksToIncrement); ticksToDecrement = Math.max(1, ticksToDecrement); Variable<Float> data = this.get(dataKey); data.set(Mth...
vuln
Safe
Java
OMX_ERRORTYPE SoftVideoDecoderOMXComponent::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { const int32_t indexFull = index; switch (indexFull) { case OMX_IndexParamStandardComponentRole: { const OMX_PARAM_COMPONENTROLETYPE *roleParams = (const OMX_PARAM_CO...
vuln
Vulnerable
C/C++
static int am_handle_probe_discovery(request_rec *r) { am_dir_cfg_rec *cfg = am_get_dir_cfg(r); LassoServer *server; const char *disco_idp = NULL; int timeout; char *return_to; char *idp_param; char *redirect_url; int ret; server = am_get_lasso_server(r); if(server == NULL) { ...
vuln
Safe
C/C++
static void sycc444_to_rgb(opj_image_t *img) { int *d0, *d1, *d2, *r, *g, *b; const int *y, *cb, *cr; unsigned int maxw, maxh, max, i; int offset, upb; upb = (int)img->comps[0].prec; offset = 1<<(upb - 1); upb = (1<<upb)-1; maxw = (unsigned int)img->comps[0].w; maxh = (unsigned int)img->comps[0].h; max = maxw...
vuln
Vulnerable
C/C++
ia){ja=fa.getAttribute("section");ba=fa.getAttribute("subsection");if(null==ja&&(ma=ia.indexOf("/"),ja=ia.substring(0,ma),null==ba)){var qa=ia.indexOf("/",ma+1);-1<qa&&(ba=ia.substring(ma+1,qa))}ma=ta[ja];null==ma&&(ya++,ma=[],ta[ja]=ma);ia=fa.getAttribute("clibs");null!=ca[ia]&&(ia=ca[ia]);ia={url:fa.getAttribute("url...
vuln
Vulnerable
JavaScript
package client import ( "encoding/json" "fmt" api "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/kubeedge/beehive/pkg/core/model" "github.com/kubeedge/kubeedge/edge/pkg/common/message" "github.com/kubeedge/kubeedge/edge/pkg/common/modules" "github.com/kubeedge/kubeedge/edge/pk...
vuln
Vulnerable
Go
static void virtser_port_device_realize(DeviceState *dev, Error **errp) { VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev); VirtIOSerialPortClass *vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port); VirtIOSerialBus *bus = VIRTIO_SERIAL_BUS(qdev_get_parent_bus(dev)); VirtIODevice *vdev = VIRTIO_DEVICE(bus->vser); ...
vuln
Safe
C/C++
// Copyright (c) 2012 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. #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" #include <stddef.h> #include <memory> #include <utility> #include <...
vuln
Vulnerable
C/C++
void hbitmap_set(HBitmap *hb, uint64_t start, uint64_t count) { uint64_t last = start + count - 1; trace_hbitmap_set(hb, start, count, start >> hb->granularity, last >> hb->granularity); start >>= hb->granularity; last >>= hb->granularity; count = last - start + 1; ass...
vuln
Safe
C/C++
@Override public void setSyncAutomaticallyAsUser(Account account, String providerName, boolean sync, int userId) { if (TextUtils.isEmpty(providerName)) { throw new IllegalArgumentException("Authority must be non-empty"); } mContext.enfor...
vuln
Safe
Java
lvm_status_t lvm_set_long(lvm_instance_t *p, long l) { operand_t op; op.type = LVM_LONG; op.value.l = l; return lvm_set_operand(p, &op); }
vuln
Safe
C/C++
/* * Copyright (C) 2015-present ScyllaDB */ /* * SPDX-License-Identifier: AGPL-3.0-or-later */ #include "server.hh" #include <boost/bimap/unordered_set_of.hpp> #include <boost/range/irange.hpp> #include <boost/bimap.hpp> #include <boost/assign.hpp> #include <boost/range/adaptor/sliced.hpp> #include "cql3/statem...
vuln
Safe
C/C++
@Override public int getContent() { if(this.isMultiBlockOrigin()) { return super.getContent(); } else { return this.getMultiBlockOrigin().getContent(); } }
vuln
Vulnerable
Java
public void syncUnhide() { appHider = prefMgr.getAppHider(); // Unhide files Set<String> hideFilePath = prefMgr.getHideFilePath(); if (hideFilePath.size() > 0) { Log.i(TAG, "Unhiding files ..."); for (String p : hideFilePath) { FileHider.process(...
vuln
Safe
Java
static void handle_rotations(QPDF& pdf, Options& o) { QPDFPageDocumentHelper dh(pdf); std::vector<QPDFPageObjectHelper> pages = dh.getAllPages(); int npages = static_cast<int>(pages.size()); for (std::map<std::string, RotationSpec>::iterator iter = o.rotations.begin(); iter != o.ro...
vuln
Vulnerable
Unknown
package com.salesmanager.shop.admin.controller.content; import com.salesmanager.core.business.services.catalog.product.relationship.ProductRelationshipService; import com.salesmanager.core.business.services.content.ContentService; import com.salesmanager.core.business.services.reference.language.LanguageService; impor...
vuln
Safe
Java
private String getFeatureKey(LocationProfile location) { return location.getTranslatedName().replace(" ", "_"); }
vuln
Vulnerable
Java
read_data_section (Bit_Chain *sec_dat, Bit_Chain *dat, r2007_section *restrict sections_map, r2007_page *restrict pages_map, Dwg_Section_Type sec_type) { r2007_section *section; r2007_page *page; uint64_t max_decomp_size; BITCODE_RC *decomp; int error = 0, i; section =...
vuln
Safe
Unknown
static bool vring_notify(VirtIODevice *vdev, VirtQueue *vq) { uint16_t old, new; bool v; if (((vdev->guest_features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) && !vq->inuse && vring_avail_idx(vq) == vq->last_avail_idx)) { return true; } if (!(vdev->guest_features & (1 << VIRTIO_RING_F_...
vuln
Vulnerable
C/C++
protected function apiProcessLeaveMessage($args) { // Check captcha if (Settings::get('enablecaptcha') == '1' && can_show_captcha()) { $captcha = $args['captcha']; $original = isset($_SESSION[SESSION_PREFIX . 'mibew_captcha']) ? $_SESSION[SESSION_PREFIX . 'mib...
vuln
Safe
PHP
int imap_open_connection(struct ImapAccountData *adata) { if (mutt_socket_open(adata->conn) < 0) return -1; adata->state = IMAP_CONNECTED; if (imap_cmd_step(adata) != IMAP_RES_OK) { imap_close_connection(adata); return -1; } if (mutt_istr_startswith(adata->buf, "* OK")) { if (!mutt_istr...
vuln
Vulnerable
C/C++
private void newUserLogin(String aUsername) { User u = new User(); u.setUsername(aUsername); u.setPassword(EMPTY_PASSWORD); u.setEnabled(true); u.setRealm(UserDao.REALM_PREAUTH); u.setRoles(PreAuthUtils.getPreAuthenticationNewUserRoles(u)); userRepository.cre...
vuln
Safe
Java
public void onHashingAlgorithm(String algorithm) { if (algorithm == null) { return; } final String algorithmId = algorithm.toUpperCase(Locale.ROOT); if (!config.getIastWeakHashAlgorithms().contains(algorithmId)) { return; } // get StackTraceElement for the caller of MessageDigest ...
vuln
Vulnerable
Java
public final void filter( final Collection< FeatureFilter > filters ) { final Collection< Integer > frames = content.keySet(); final ExecutorService executors = Executors.newFixedThreadPool( numThreads ); for ( final Integer frame : frames ) { final Runnable command = new Runnable() { @Override ...
vuln
Safe
Java
struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb, struct request_sock *req, struct dst_entry *dst) { struct inet_request_sock *ireq; struct inet_sock *newinet; struct sock *newsk; if (sk_acceptq_is_full(sk)) goto exit_overflow; if (dst == NULL && (dst = inet_csk...
vuln
Safe
Unknown
/* ** vm.c - virtual machine for mruby ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/hash.h> #include <mruby/irep.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/range.h> #include <mruby/string.h> #include <mruby/vari...
vuln
Vulnerable
C/C++
def jstree_data(node, selected_node): result = [] result.append('{') result.append('"text": "{}",'.format(node.label)) result.append( '"state": {{ "opened": true, "selected": {} }},'.format( 'true' if node == selected_node else 'false' ) ) result.append( '"dat...
vuln
Vulnerable
Python
public static boolean isAnyPstnLineBusy(@NonNull Context context) { return getManager(context).getCallState() != TelephonyManager.CALL_STATE_IDLE; }
vuln
Vulnerable
Java
public void setDimension(final Dimension dimension) { Configuration config = Configuration.getInstance(); if (this.dimension != null) { this.dimension.removePropertyChangeListener(this); this.dimension.removeDimensionListener(this); for (Tile tile: this.dimension.getT...
vuln
Vulnerable
Java
public static CertPath validateCertificatePathWithIssuer(boolean truncateCertificatePath, CertPath certPath, X509Certificate[] trustedCertificates) throws GeneralSecurityException { if (trustedCertificates == null) { // trust none throw new CertPathValidatorException("certificates are not trusted!"); } L...
vuln
Safe
Java
private boolean isServiceVulnerable(NetworkService networkService) { String targetUri = NetworkServiceUtils.buildWebApplicationRootUrl(networkService) + QUERY_STRING; Stopwatch stopwatch = Stopwatch.createStarted(ticker); try { HttpResponse httpResponse = httpClient.send( ...
vuln
Vulnerable
Java