code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; VP56Context *s = avctx->priv_data; AVFrame *const p = s->frames[VP56_FRAME_CURRENT]; int remaining_buf_size = avpkt->size; int av_uninit(alpha_off...
vuln
Safe
C/C++
mxTooltipHandler.prototype.reset=function(a,b,c){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||...
vuln
Safe
JavaScript
void jswrap_spi_send8bit(JsVar *parent, JsVar *srcdata, int bit0, int bit1, Pin nss_pin) { if (!jsvIsObject(parent)) return; IOEventFlags device = jsiGetDeviceFromClass(parent); if (!DEVICE_IS_SPI(device)) { jsExceptionHere(JSET_ERROR, "SPI.send8bit only works on hardware SPI"); return; } jshSPISet16(...
vuln
Safe
C/C++
/* etterfilter -- the actual compiler Copyright (C) ALoR & NaGA 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 2 of the License, or (at your option) any later...
vuln
Safe
C/C++
static bool io_wq_files_match(struct io_wq_work *work, void *data) { struct files_struct *files = data; return work->files == files; }
vuln
Vulnerable
Unknown
void PictureLayerImpl::UpdateRasterSource( scoped_refptr<RasterSource> raster_source, Region* new_invalidation, const PictureLayerTilingSet* pending_set) { DCHECK_IMPLIES(!raster_source->GetSize().IsEmpty(), bounds() == raster_source->GetSize()) << " bounds " << bounds().ToString()...
vuln
Vulnerable
C/C++
static int output_frame(AVFilterLink *outlink, int nb_samples) { AVFilterContext *ctx = outlink->src; MixContext *s = ctx->priv; AVFilterBufferRef *out_buf, *in_buf; int i; calculate_scales(s, nb_samples); out_buf = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples); if (!out_buf) ...
vuln
Safe
C/C++
package api import ( "bytes" "encoding/json" "errors" "fmt" "net/http" "time" "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/models"...
vuln
Safe
Go
public void addUser(JpaUser user) throws UnauthorizedException { if (!UserDirectoryUtils.isCurrentUserAuthorizedHandleRoles(securityService, user.getRoles())) throw new UnauthorizedException("The user is not allowed to set the admin role on other users"); // Create a JPA user with an encoded password. ...
vuln
Vulnerable
Java
static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst) { int i, j, k; for(i = 0; i < 4; i++, dst += r->intra_types_stride - 4){ for(j = 0; j < 4; j+= 2){ int code = svq3_get_ue_golomb(gb) << 1; if(code >= 81*2){ av_log(r->s.avctx, AV...
vuln
Vulnerable
C/C++
fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) { int r, num; OnigCodePoint c; OnigEncoding enc = env->enc; const OnigSyntaxType* syn = env->syntax; UChar* prev; UChar* p = *src; PFETCH_READY; start: if (PEND) { tok->type = TK_EOT; return tok->type; } tok->type = TK_ST...
vuln
Safe
C/C++
generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags) { struct address_space *mapping = out->f_mapping; struct inode *inode = mapping->host; ssize_t ret; int err; ret = __splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); if ...
vuln
Vulnerable
Unknown
def doLogout(request: GetRequest, redirectIfMayNotSeeUrlPath: Opt[St]): Result = { import request.{dao, requester, siteSettings} requester foreach { theRequester => request.dao.logout(theRequester, bumpLastSeen = true) } val goToNext: Opt[St] = siteSettings.effSsoLogoutAllRedirUrl orElse { ...
vuln
Vulnerable
Scala
$q = self::query($sql); } return true; }
vuln
Safe
JavaScript
crypt_pw_cmp(const char *userpwd, const char *dbpwd) { int rc; char *cp; struct crypt_data data; data.initialized = 0; /* we use salt (first 2 chars) of encoded password in call to crypt_r() */ cp = crypt_r(userpwd, dbpwd, &data); if (cp) { rc = slapi_ct_memcmp(dbpwd, cp, strlen(dbp...
vuln
Vulnerable
C/C++
sysServices_handler(snmp_varbind_t *varbind, snmp_oid_t *oid) { snmp_api_set_time_ticks(varbind, oid, clock_seconds() * 100); }
vuln
Safe
C/C++
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg) { const char *endp = ap_strrchr_c(arg, '>'); const char *limited_methods; void *tog = cmd->cmd->cmd_...
vuln
Safe
Unknown
dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) { DTLS1_RECORD_DATA *rdata; pitem *item; /* Limit the size of the queue to prevent DOS attacks */ if (pqueue_size(queue->q) >= 100) return 0; rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA)); item = pitem_new(priority, rdata); if (r...
vuln
Safe
C/C++
p11_rpc_buffer_get_byte_array (p11_buffer *buf, size_t *offset, const unsigned char **data, size_t *length) { size_t off = *offset; uint32_t len; if (!p11_rpc_buffer_get_uint32 (buf, &off, &len)) return false; if (len == ...
vuln
Safe
C/C++
@Override public void cancel() { Slog.i(TAG, "Cancel"); if (!RadioServiceUserController.isCurrentOrSystemUser()) { Slogf.w(TAG, "Cannot cancel on HAL 2.0 client from non-current user"); return; } synchronized (mLock) { checkNotClosedLocked(); ...
vuln
Safe
Java
public function getClone($modelId = null) { $this->authorize('create', AssetModel::class); // Check if the model exists if (is_null($model_to_clone = AssetModel::find($modelId))) { return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'...
vuln
Safe
PHP
int ff_v4l2_m2m_codec_reinit(V4L2m2mContext* s) { int ret; av_log(s->avctx, AV_LOG_DEBUG, "reinit context\n"); ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMOFF); if (ret) av_log(s->avctx, AV_LOG_ERROR, "capture VIDIOC_STREAMOFF\n"); av_log(s->avctx, AV_LOG_DEBUG, "wai...
vuln
Vulnerable
C/C++
public File runFilter(File file, Map<String, String[]> parameters) { File resultFile = getResultsFile(file, parameters); if (!overwrite(resultFile, parameters)) { return resultFile; } int page = parameters.get(getPrefix() + "page") != null ? Integer.parseInt(parameters.get...
vuln
Safe
Java
QPDF::removePage(QPDFObjectHandle page) { int pos = findPage(page); // also ensures flat /Pages QTC::TC("qpdf", "QPDF remove page", (pos == 0) ? 0 : // remove at beginning (pos == static_cast<int>( this->m->all_pages.size() - 1)) ? 1 : // end ...
vuln
Vulnerable
Unknown
static void tcg_out_qemu_ld(TCGContext *s, TCGReg data, TCGReg addr, TCGMemOpIdx oi, bool is_64) { TCGMemOp memop = get_memop(oi); #ifdef CONFIG_SOFTMMU unsigned memi = get_mmuidx(oi); TCGReg addrz, param; tcg_insn_unit *func; tcg_insn_unit *label_ptr; addrz = tcg_out...
vuln
Safe
C/C++
/* xfrm_user.c: User interface to configure xfrm engine. * * Copyright (C) 2002 David S. Miller (davem@redhat.com) * * Changes: * Mitsuru KANDA @USAGI * Kazunori MIYAZAWA @USAGI * Kunihiro Ishiguro <kunihiro@ipinfusion.com> * IPv6 support * */ #include <linux/crypto.h> #include <linux/module.h> #include ...
vuln
Safe
C/C++
@Override public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) { if (mItems.isEmpty()) return; int idx = i; if (idx > mItems.size()) idx = 0; final UriData ud = mItems.get(idx); if (ud != null) { // Set item views based on the views and data model TextView name = v...
vuln
Vulnerable
Java
/** * Copyright (c) 2006-2012, JGraph Ltd */ Format = function(editorUi, container) { this.editorUi = editorUi; this.container = container; }; /** * Background color for inactive tabs. */ Format.inactiveTabBackgroundColor = '#f1f3f4'; /** * Icons for markers (24x16). */ Format.classicFilledMarkerImage = Graph...
vuln
Safe
JavaScript
@Nullable private PackageManagerService.VerificationParams prepareForVerification() throws PackageManagerException { assertNotLocked("makeSessionActive"); @UserActionRequirement int userActionRequirement = USER_ACTION_NOT_NEEDED; // TODO(b/159331446): Move this to makeSe...
vuln
Safe
Java
struct razer_report razer_chroma_extended_matrix_set_custom_frame2(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char *rgb_data, size_t packetLength) { const size_t start_arg_offset = 5; size_t data_length = 0; struct razer_report report = {0}; size_t row_length = (s...
vuln
Safe
C/C++
function rsvpmaker_stripe_checkout() { rsvpmaker_debug_log( 'rsvpmaker_stripe_checkout' ); global $post, $rsvp_options, $current_user; $keys = get_rsvpmaker_stripe_keys(); if ( empty( $_GET['txid'] ) ) { return; } ob_start(); $varkey = $idempotency_key = sanitize_text_field( $_GET['txid'] ); $vars = g...
vuln
Safe
PHP
DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, pixman_format_code_t format, int linesize, uint64_t addr) { DisplaySurface *surface; hwaddr size; void *data; if (linesize ==...
vuln
Vulnerable
C/C++
int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp) { ThrottleGroupMember *tgm = &blk->public.throttle_group_member; blk->root = bdrv_root_attach_child(bs, "root", &child_root, blk->perm, blk->shared_perm, blk, errp); if (blk->root == NULL) { ...
vuln
Safe
C/C++
rsvp_obj_print(netdissect_options *ndo, const u_char *pptr, u_int plen, const u_char *tptr, const char *ident, u_int tlen, const struct rsvp_common_header *rsvp_com_header) { const struct rsvp_object_header *rsvp_obj_header; const u_char *obj_tptr; union { ...
vuln
Vulnerable
C/C++
TPM_EO_Unmarshal(TPM_EO *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT16_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case TPM_EO_EQ: case TPM_EO_NEQ: case TPM_EO_SIGNED_GT: case TPM_EO_UNSIGN...
vuln
Vulnerable
Unknown
static bool blendSpec(cchar *name, cchar *version, MprJson *spec) { MprJson *blend, *cp, *scripts; cchar *script, *key; char *major, *minor, *patch; int i; /* Before blending, expand ${var} references */ if ((scripts = mprGetJsonObj(spec, "app.client.+scrip...
vuln
Safe
C/C++
static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) { SmackerContext *smk = s->priv_data; int flags; int ret; int i; int frame_size = 0; int palchange = 0; if (s->pb->eof_reached || smk->cur_frame >= smk->frames) return AVERROR_EOF; if(smk->curstream < 0) { ...
vuln
Safe
C/C++
static void vexpress_common_init(MachineState *machine) { VexpressMachineState *vms = VEXPRESS_MACHINE(machine); VexpressMachineClass *vmc = VEXPRESS_MACHINE_GET_CLASS(machine); VEDBoardInfo *daughterboard = vmc->daughterboard; DeviceState *dev, *sysctl, *pl041; qemu_irq pic[64]; uint32_t sys_id...
vuln
Vulnerable
C/C++
static int decode_b_picture_primary_header(VC9Context *v) { GetBitContext *gb = &v->s.gb; int pqindex; if (v->profile == PROFILE_SIMPLE) { av_log(v->s.avctx, AV_LOG_ERROR, "Found a B frame while in Simple Profile!\n"); return FRAME_SKIPED; } v->bfraction = vc9_bfraction_lut[...
vuln
Safe
C/C++
gss_unwrap_iov (minor_status, context_handle, conf_state, qop_state, iov, iov_count) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int * conf_state; gss_qop_t *qop_state; gss_iov_buffer_desc * iov; int iov_count; { /* EXPO...
vuln
Safe
C/C++
MagickPrivate ResizeFilter *AcquireResizeFilter(const Image *image, const FilterType filter,const MagickBooleanType cylindrical, ExceptionInfo *exception) { const char *artifact; FilterType filter_type, window_type; double B, C, value; register ResizeFilter *resize_filter; ...
vuln
Safe
C/C++
private List<String> getAllCommandOutput(String[] cmdArray) throws IOException { Process executable = Runtime.getRuntime().exec(cmdArray); BufferedReader processReader = null; List<String> psOutput; try { processReader = new BufferedReader(new InputStreamReader(executable.getInputStream())); ...
vuln
Vulnerable
Java
/* * PNG image format * Copyright (c) 2003 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (a...
vuln
Vulnerable
C/C++
public static void lock(Context context, @NonNull Settings settings) { Log.e(TAG, "lock"); settings.clearTempPassword(); FileStuff.deleteCache(context); Glide.get(context).clearMemory(); new Thread(() -> Glide.get(context).clearDiskCache()).start(); LaunchActivity.GLIDE_K...
vuln
Vulnerable
Java
// mkerrors.sh -marm // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -marm _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x1...
vuln
Safe
Go
static jpc_enc_cp_t *cp_create(char *optstr, jas_image_t *image) { jpc_enc_cp_t *cp; jas_tvparser_t *tvp; int ret; int numilyrrates; double *ilyrrates; int i; int tagid; jpc_enc_tcp_t *tcp; jpc_enc_tccp_t *tccp; jpc_enc_ccp_t *ccp; int cmptno; uint_fast16_t rlvlno; uint_fast16_t prcwidthexpn; uint_fast16_...
vuln
Vulnerable
Unknown
void qemu_thread_exit(void *arg) { QemuThreadData *data = TlsGetValue(qemu_thread_tls_index); if (data) { data->ret = arg; EnterCriticalSection(&data->cs); data->exited = true; LeaveCriticalSection(&data->cs); } _endthreadex(0); }
vuln
Safe
C/C++
@Override public void onGpsStatusChanged(int event) { if(null == mLocationManager) { return; } GpsStatus gpsStatus; try { gpsStatus = mLocationManager.getGpsStatus(null); } catch (SecurityException e) { return; } mGp...
vuln
Vulnerable
Java
static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, struct sctp_association *assoc, sctp_socket_type_t type) { struct sctp_sock *oldsp = sctp_sk(oldsk); struct sctp_sock *newsp = sctp_sk(newsk); struct sctp_bind_bucket *pp; /* hash list port iterator */ struct sctp_endpoint *newe...
vuln
Safe
C/C++
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. * All rights reserved. */ #include "cfg80211.h" #define GO_NEG_REQ 0x00 #define GO_NEG_RSP 0x01 #define GO_NEG_CONF 0x02 #define P2P_INV_REQ 0x03 #define P2P_INV_RSP 0x04 #define WILC_INVA...
vuln
Vulnerable
C/C++
mISDN_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags) { struct sk_buff *skb; struct sock *sk = sock->sk; int copied, err; if (*debug & DEBUG_SOCKET) printk(KERN_DEBUG "%s: len %d, flags %x ch.nr %d, proto %x\n", __func__, (int)len, flags, _...
vuln
Safe
C/C++
PHP_METHOD(Phar, copy) { char *oldfile, *newfile, *error; const char *pcr_error; size_t oldfile_len, newfile_len; phar_entry_info *oldentry, newentry = {0}, *temp; int tmp_len = 0; PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &oldfile, &oldfile_len, &newfile, &newfile_len) == FAILURE...
vuln
Vulnerable
Unknown
static void local_mapped_file_attr(int dirfd, const char *name, struct stat *stbuf) { FILE *fp; char buf[ATTR_MAX]; int map_dirfd; map_dirfd = openat(dirfd, VIRTFS_META_DIR, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); if (map_dirfd == -1) { ...
vuln
Safe
C/C++
static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num) { BDRVBochsState *s = bs->opaque; int64_t offset = sector_num * 512; int64_t extent_index, extent_offset, bitmap_offset; char bitmap_entry; extent_index = offset / s->extent_size; extent_offset = (offset % s->extent_siz...
vuln
Vulnerable
C/C++
static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child, int64_t offset, unsigned int bytes, QEMUIOVector *qiov) { BlockDriverState *bs = child->bs; void *bounce_buffer; BlockDriver *drv = bs->drv; struct iovec iov; QEMUIOVector local_qiov; int64_t cluster_offset; int6...
vuln
Safe
C/C++
def load_hparams_from_yaml(config_yaml: str, use_omegaconf: bool = True) -> Dict[str, Any]: """Load hparams from a file. Args: config_yaml: Path to config yaml file use_omegaconf: If omegaconf is available and ``use_omegaconf=True``, the hparams will be converted to ...
vuln
Safe
Python
@NeverInline("Accesses caller stack pointer and return address.") @Uninterruptible(reason = "Copies stack frames containing references.") private Object enter1(boolean isContinue) { // Note that the frame of this method will remain on the stack, and yielding will ignore it // and return past it ...
vuln
Safe
Java
def update_date_modified(self): sql = "UPDATE jdk_entries " + \ "SET date_last_modified = " + CURRENT_DATESTAMP + " " + \ "WHERE jdk_entries.id = '" + self.entry_id + "';" db_execute(sql) return None
vuln
Vulnerable
Python
/* * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, Tom Huybrechts * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without ...
vuln
Safe
Java
void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) { Guchar *line; int i, j, n; n = base->getNComps(); line = (Guchar *) gmallocn (length, n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; base->getRGBLine(line, ...
vuln
Safe
C/C++
MagickExport void XFontBrowserWidget(Display *display,XWindows *windows, const char *action,char *reply) { #define BackButtonText "Back" #define CancelButtonText "Cancel" #define FontnameText "Name:" #define FontPatternText "Pattern:" #define ResetButtonText "Reset" char back_pattern[MaxTextExtent], *...
vuln
Vulnerable
Unknown
public static function finishSetup(Request $request) { if (!isset($_COOKIE['setup_arguments'])) { // Abort if setup arguments are missing. abort(404); } $setup_finish_args_raw = $_COOKIE['setup_arguments']; $setup_finish_args = json_decode($setup_finish_args_raw)...
vuln
Safe
PHP
static int nbd_co_send_request(BlockDriverState *bs, struct nbd_request *request, QEMUIOVector *qiov, int offset) { NbdClientSession *s = nbd_get_client_session(bs); AioContext *aio_context; int rc, ret; qemu_co_mutex_lock(&s->send_mutex); ...
vuln
Vulnerable
C/C++
@Nullable @Override public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity) { CompoundNBT baseTag = stack.getTag(); IBakedModel result = originalModel; if(baseTag != null && !baseTag.isEmpty()) { ...
vuln
Safe
Java
static struct ucma_multicast* ucma_alloc_multicast(struct ucma_context *ctx) { struct ucma_multicast *mc; mc = kzalloc(sizeof(*mc), GFP_KERNEL); if (!mc) return NULL; mutex_lock(&mut); mc->id = idr_alloc(&multicast_idr, NULL, 0, 0, GFP_KERNEL); mutex_unlock(&mut); if (mc->id < 0) goto error; mc->ctx = ct...
vuln
Safe
C/C++
MagickExport void XFontBrowserWidget(Display *display,XWindows *windows, const char *action,char *reply) { #define BackButtonText "Back" #define CancelButtonText "Cancel" #define FontnameText "Name:" #define FontPatternText "Pattern:" #define ResetButtonText "Reset" char back_pattern[MaxTextExtent], *...
vuln
Safe
Unknown
package main import ( "fmt" "os" "text/tabwriter" "github.com/dustin/go-humanize" "github.com/flynn/go-docopt" tuf "github.com/theupdateframework/go-tuf/client" ) func init() { register("list", cmdList, ` usage: tuf-client list [-s|--store=<path>] <url> Options: -s <path> The path to the local file stor...
vuln
Vulnerable
Go
static void scalar32_min_max_and(struct bpf_reg_state *dst_reg, struct bpf_reg_state *src_reg) { bool src_known = tnum_subreg_is_const(src_reg->var_off); bool dst_known = tnum_subreg_is_const(dst_reg->var_off); struct tnum var32_off = tnum_subreg(dst_reg->var_off); s32 smin_val = src_reg->s32_min_value; u32 u...
vuln
Safe
Unknown
MagickExport MagickBooleanType InterpolatePixelChannel( const Image *magick_restrict image,const CacheView_ *image_view, const PixelChannel channel,const PixelInterpolateMethod method, const double x,const double y,double *pixel,ExceptionInfo *exception) { double alpha[16], gamma, pixels[16]; Mag...
vuln
Safe
C/C++
protected function gdImageBackground($image, $bgcolor) { if ($bgcolor === 'transparent') { imagealphablending($image, false); imagesavealpha($image, true); } else { list($r, $g, $b) = sscanf($bgcolor, "#%02x%02x%02x"); $bgcolor1 = imagecolorallocate($image, $r, $g, $b); imagefill($image, 0, 0, $bgc...
vuln
Safe
JavaScript
int MemIo::seek(int64 offset, Position pos ) { int64 newIdx = 0; switch (pos) { case BasicIo::cur: newIdx = p_->idx_ + offset; break; case BasicIo::beg: newIdx = offset; break; case BasicIo::end: ...
vuln
Vulnerable
Unknown
- (id <WOActionResults>) logoffAction { NSString *userName, *value; SOGoWebAuthenticator *auth; WOResponse *response; NSCalendarDate *date; WOCookie *cookie; NSArray *creds; userName = [[context activeUser] login]; [self logWithFormat: @"user '%@' logged off", userName]; response = [self redirect...
vuln
Safe
Objective-C
srtp_protect_aead (srtp_ctx_t *ctx, srtp_stream_ctx_t *stream, void *rtp_hdr, unsigned int *pkt_octet_len) { srtp_hdr_t *hdr = (srtp_hdr_t*)rtp_hdr; uint32_t *enc_start; /* pointer to start of encrypted portion */ int enc_octet_len = 0; /* number of octets in encrypted portion */ x...
vuln
Safe
Unknown
static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb) { struct sk_buff *ax_skb; int pkt_cnt; u32 rx_hdr; u16 hdr_off; u32 *pkt_hdr; /* At the end of the SKB, there's a header telling us how many packets * are bundled into this buffer and where we can find an array of * per-packet metadata (whi...
vuln
Safe
C/C++
static void vnc_desktop_resize(VncState *vs) { DisplaySurface *ds = vs->vd->ds; if (vs->csock == -1 || !vnc_has_feature(vs, VNC_FEATURE_RESIZE)) { return; } if (vs->client_width == surface_width(ds) && vs->client_height == surface_height(ds)) { return; } vs->client_width...
vuln
Vulnerable
Unknown
void restore() { System.arraycopy(rSave, 0, r, 0, blockSize); int ret = nativeCrypto.CBCInit(nativeContext, mode, r, r.length, key, key.length); if (ret == -1) { throw new ProviderException("Error in Native CipherBlockChaining"); } }
vuln
Vulnerable
Java
@Override protected boolean checkApiLogic(final Player ai, final SpellAbility sa) { sa.resetTargets(); final Card source = sa.getHostCard(); // everything is defined or targeted above, can't do anything there? if (sa.hasParam("Defined") && !sa.usesTargeting()) { // TODO ...
vuln
Safe
Java
do_put( int regname, char_u *expr_result, // result for regname "=" when compiled int dir, // BACKWARD for 'P', FORWARD for 'p' long count, int flags) { char_u *ptr; char_u *newp, *oldp; int yanklen; int totlen = 0; // init for gcc linenr_T lnum; colnr_T col; long ...
vuln
Safe
C/C++
krb5_error_code ipadb_get_pwd_policy(krb5_context kcontext, char *name, osa_policy_ent_t *policy) { struct ipadb_context *ipactx; char *esc_name = NULL; char *src_filter = NULL; krb5_error_code kerr; LDAPMessage *res = NULL; LDAPMessage *lentry; osa_polic...
vuln
Safe
C/C++
render() { let item = null; const story = this.state.story; if (story) { // 如果没有 img 要处理,否则不好看。 item = ( <div id={`story${story.id}`} className="flex-tile" ref="self" >...
vuln
Vulnerable
JavaScript
int TabStrip::OnPerformDrop(const DropTargetEvent& event) { if (!drop_info_.get()) return ui::DragDropTypes::DRAG_NONE; const int drop_index = drop_info_->drop_index; const bool drop_before = drop_info_->drop_before; const bool file_supported = drop_info_->file_supported; SetDropIndex(-1, false); GU...
vuln
Safe
C/C++
var Gogo = (function() { // create our angular module and tell angular what route(s) it will handle var pluginName = "gogo"; var simplePlugin = angular.module(pluginName, ['hawtioCore']) .factory('log', function() { return Logger.get("Gogo"); }).config(function($routeProvider) { $routeProvid...
vuln
Vulnerable
Java
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
vuln
Safe
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
vuln
Safe
Java
public static String getMediaTypeName(SearchResult.MediaType mediaType, Context context) { int id = context.getResources().getIdentifier("mediatype_" + mediaType.toString().toLowerCase(), "string", context.getPackageName()); try { return context.getRes...
vuln
Safe
Java
/** * This file is part of the Gribbit Web Framework. * * https://github.com/lukehutch/gribbit * * @author Luke Hutchison * * -- * * @license Apache 2.0 * * Copyright 2015 Luke Hutchison * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in com...
vuln
Safe
Java
function getTextVoiceArrayFromText(text) { const el = document.createElement('div'); el.innerHTML = window.xssUtils.sanitize(text); const $el = $(el); return window.TTSUtils.getTextVoiceArrayFromElement($el,presenter.configuration.langTag); }
vuln
Safe
JavaScript
png_set_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp palette, int num_palette) { png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH) { if (info_ptr->color_type =...
vuln
Vulnerable
C/C++
static inline int is_bit_set(BlockDriverState *bs, int64_t bitnum) { uint64_t offset = sizeof(struct cow_header_v2) + bitnum / 8; uint8_t bitmap; int ret; ret = bdrv_pread(bs->file, offset, &bitmap, sizeof(bitmap)); if (ret < 0) { return ret; } return !!(bitmap & (1 << (bitnum % 8)));...
vuln
Safe
C/C++
_evbuffer_expand_fast(struct evbuffer *buf, size_t datlen, int n) { struct evbuffer_chain *chain = buf->last, *tmp, *next; size_t avail; int used; ASSERT_EVBUFFER_LOCKED(buf); EVUTIL_ASSERT(n >= 2); if (chain == NULL || (chain->flags & EVBUFFER_IMMUTABLE)) { /* There is no last chunk, or we can't touch the la...
vuln
Vulnerable
Unknown
long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) { int ret=0; #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA) if ( #ifndef OPENSSL_NO_RSA cmd == SSL_CTRL_SET_TMP_RSA || cmd == SSL_CTRL_SET_TMP_RSA_CB || #endif #ifndef OPENSSL_NO_DSA cmd == SSL_CTRL_SET_TMP_DH || cmd == SSL_CTRL_SE...
vuln
Safe
Unknown
static void enable_nmi_window(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm = to_svm(vcpu); if ((svm->vcpu.arch.hflags & (HF_NMI_MASK | HF_IRET_MASK)) == HF_NMI_MASK) return; /* IRET will cause a vm exit */ /* * Something prevents NMI from been injected. Single step over possible * problem (IRET or exce...
vuln
Vulnerable
Unknown
static void read_multiple_cb(struct bt_att_chan *chan, uint8_t opcode, const void *pdu, uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; struct gatt_db_attribute *attr; struct read_mult_data *data = NULL; uint8_t ecode; size_t i = 0; uint16_t handle = 0; if (length < 4) {...
vuln
Vulnerable
Unknown
function addImsi(req) { var getImsiInfoFromReq = function(name) { if (req.query && req.query[name]) { return req.query[name]; } else if (req.body && req.body[name]) { return req.body[name]; } else if (req.params && req.params[name]) { return req.params[name]; } else { return nu...
vuln
Vulnerable
JavaScript
static bool read_lead(zckCtx *zck) { VALIDATE_READ_BOOL(zck); int lead = 5 + 2*MAX_COMP_SIZE; char *header = zmalloc(lead); if (!header) { zck_log(ZCK_LOG_ERROR, "OOM in %s", __func__); return false; } size_t length = 0; if(read_data(zck, header, lead) < lead) { free(hea...
vuln
Vulnerable
C/C++
private void addOdyseeAccountExplicitly(String currentEmail) { // Add account explicitly Account account = new Account("odysee", ARG_ACCOUNT_TYPE); AccountManager accountManager = AccountManager.get(getApplicationContext()); try { Bundle bundle = new Bundle(); bun...
vuln
Safe
Java
"""Stock database model definitions.""" from __future__ import annotations import os from datetime import datetime, timedelta from decimal import Decimal, InvalidOperation from django.contrib.auth.models import User from django.core.exceptions import FieldError, ValidationError from django.core.validators import Min...
vuln
Vulnerable
Python
u_int juniper_es_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { struct juniper_l2info_t l2info; struct juniper_ipsec_header { uint8_t sa_index[2]; uint8_t ttl; uint8_t type; uint8_t spi[4]; ...
vuln
Vulnerable
C/C++
static void upnp_event_prepare(struct upnp_event_notify * obj) { static const char notifymsg[] = "NOTIFY %s HTTP/1.1\r\n" "Host: %s%s\r\n" #if (UPNP_VERSION_MAJOR == 1) && (UPNP_VERSION_MINOR == 0) "Content-Type: text/xml\r\n" /* UDA v1.0 */ #else "Content-Type: text/xml; charset=\"utf-8\"\r\n" /* UDA v1.1 or ...
vuln
Vulnerable
C/C++
inline void pad(int bytes) { while (bytes-- > 0) writeU8(0); }
vuln
Vulnerable
C/C++