code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
package tuple import ( v0 "github.com/authzed/authzed-go/proto/authzed/api/v0" ) // ONRSet is a set of ObjectAndRelation's. type ONRSet struct { onrs map[string]*v0.ObjectAndRelation } // NewONRSet creates a new set. func NewONRSet(onrs ...*v0.ObjectAndRelation) *ONRSet { created := &ONRSet{ onrs: map[string]*v...
vuln
Safe
Go
static char *Sys_PIDFileName( void ) { return va( "%s/%s", Sys_TempPath( ), PID_FILENAME ); }
vuln
Vulnerable
Unknown
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; const uint8_t *unescaped_buf_ptr; ...
vuln
Safe
C/C++
async def create_pres( self, pres_ex_record: V20PresExRecord, request_data: dict = {}, ) -> Tuple[V20PresFormat, AttachDecorator]: """Create a presentation.""" proof_request = pres_ex_record.pres_request.attachment( DIFPresFormatHandler.format ) pr...
vuln
Vulnerable
Python
@ApiOperation(value = "Revoke App certificate") @DELETE @JWTRequired(acceptedTokens={Audience.SERVICES}, allowedUserRoles={"AGENT"}) public Response revokeCertificate( @ApiParam(value = "Identifier of the Certificate to revoke", required = true) @QueryParam("certId") String certId) throws CAException { ...
vuln
Safe
Java
# -*- coding: utf-8 -*- # Copyright 2018 New Vector Ltd # # 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 l...
vuln
Safe
Python
public ResponseEntity<Void> testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException { Object postBody = null; // verify the required parameter 'requ...
vuln
Safe
Java
static Picture * remove_short(H264Context *h, int frame_num){ MpegEncContext * const s = &h->s; int i; if(s->avctx->debug&FF_DEBUG_MMCO) av_log(h->s.avctx, AV_LOG_DEBUG, "remove short %d count %d\n", frame_num, h->short_ref_count); for(i=0; i<h->short_ref_count; i++){ Picture *pic= h->sh...
vuln
Safe
C/C++
static MagickBooleanType ReadUncompressedRGBA(Image *image, DDSInfo *dds_info, ExceptionInfo *exception) { PixelPacket *q; ssize_t alphaBits, x, y; unsigned short color; alphaBits=0; if (dds_info->pixelformat.rgb_bitcount == 16) { if (IsBitMask(dds_info->pixelformat,0x7c00,0...
vuln
Safe
C/C++
function handle_submit($selected_id) { global $db_connections, $def_coy, $tb_pref_counter, $db, $comp_subdirs, $path_to_root, $Mode; $error = false; if ($selected_id==-1) $selected_id = count($db_connections); $new = !isset($db_connections[$selected_id]); if (check_value('def')) $def_coy = $selected_id; ...
vuln
Safe
PHP
/* Copyright The Helm Authors. 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 agreed to in writing, software di...
vuln
Vulnerable
Go
void SoftOpus::onQueueFilled(OMX_U32 portIndex) { List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (mOutputPortSettingsChange != NONE) { return; } if (portIndex == 0 && mInputBufferCount < 3) { BufferInfo *info = *inQueue.begin(); OMX_BUFFERHEADERTYPE *h...
vuln
Safe
C/C++
static int xcopy_parse_parameter_list(struct tcmu_device *dev, struct tcmulib_cmd *cmd, struct xcopy *xcopy) { uint8_t *cdb = cmd->cdb; size_t data_length = tcmu_cdb_get_xfer_length(cdb); struct iovec *iovec = cmd->iovec; size_t iov_cnt = cmd->iov_cnt; uint32_t inline_dl; uint8_t *seg_desc, *t...
vuln
Safe
C/C++
void AuthorizationSession::_refreshUserInfoAsNeeded(OperationContext* txn) { AuthorizationManager& authMan = getAuthorizationManager(); UserSet::iterator it = _authenticatedUsers.begin(); while (it != _authenticatedUsers.end()) { User* user = *it; if (!user->isValid()) { // Make...
vuln
Vulnerable
Unknown
static ssize_t add_slot_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t nbytes) { char drc_name[MAX_DRC_NAME_LEN]; char *end; int rc; if (nbytes >= MAX_DRC_NAME_LEN) return 0; memcpy(drc_name, buf, nbytes); end = strchr(drc_name, '\n'); if (!end) end = &drc_name[n...
vuln
Vulnerable
C/C++
public int getImprovementLevel(ItemStack itemStack, String improvementKey) { return Optional.ofNullable(itemStack.getTag()) .filter(tag -> tag.contains(slotTagKey + ":" + improvementKey)) .map(tag -> tag.getInt(slotTagKey + ":" + improvementKey)) .orElse(-1); ...
vuln
Safe
Java
static void vmxnet3_update_pm_state(VMXNET3State *s) { struct Vmxnet3_VariableLenConfDesc pm_descr; PCIDevice *d = PCI_DEVICE(s); pm_descr.confLen = VMXNET3_READ_DRV_SHARED32(d, s->drv_shmem, devRead.pmConfDesc.confLen); pm_descr.confVer = VMXNET3_READ_DRV_SHARED32(d, s->drv_shmem, devRe...
vuln
Safe
C/C++
static int wsd_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; int version; uint32_t text_offset, data_offset, channel_assign; char playback_time[AV_TIMECODE_STR_SIZE]; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); avio_skip(pb, 8); ...
vuln
Safe
C/C++
static char *multipart_buffer_read_body(multipart_buffer *self, size_t *len) { char buf[FILLUNIT], *out=NULL; int total_bytes=0, read_bytes=0; while((read_bytes = multipart_buffer_read(self, buf, sizeof(buf), NULL))) { out = erealloc(out, total_bytes + read_bytes + 1); memcpy(out + total_bytes, buf, read_bytes)...
vuln
Vulnerable
Unknown
/* * Description: network buf manager * History: yang@haipo.me, 2016/03/16, create */ # include <errno.h> # include <string.h> # include "nw_buf.h" # define NW_BUF_POOL_INIT_SIZE 64 # define NW_CACHE_INIT_SIZE 64 size_t nw_buf_size(nw_buf *buf) { return buf->wpos - buf->rpos; } size_t nw_buf_avail(nw_...
vuln
Vulnerable
C/C++
static struct sock *dccp_v6_request_recv_sock(struct sock *sk, struct sk_buff *skb, struct request_sock *req, struct dst_entry *dst) { struct inet6_request_sock *ireq6 = inet6_rsk(req); struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct inet_sock *newinet; struct dccp6_sock *newdp...
vuln
Safe
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
Vulnerable
Python
public TList readListBegin() throws TException { return new TList(readByte(), readI32()); }
vuln
Vulnerable
Java
static int r_core_cmd_subst(RCore *core, char *cmd) { ut64 rep = strtoull (cmd, NULL, 10); int ret = 0, orep; char *cmt, *colon = NULL, *icmd = NULL; bool tmpseek = false; bool original_tmpseek = core->tmpseek; if (r_str_startswith (cmd, "GET /cmd/")) { memmove (cmd, cmd + 9, strlen (cmd + 9) + 1); char *htt...
vuln
Vulnerable
C/C++
static int lmf_header_load(lmf_header *lmfh, RBuffer *buf, Sdb *db) { if (r_buf_size (buf) < sizeof (lmf_header)) { return false; } if (r_buf_fread_at (buf, QNX_HEADER_ADDR, (ut8 *) lmfh, "iiiiiiiicccciiiicc", 1) < QNX_HDR_SIZE) { return false; } r_strf_buffer (32); sdb_set (db, "qnx.version", r_strf ("0x%xH"...
vuln
Vulnerable
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
static int toneport_setup(struct usb_line6_toneport *toneport) { u32 *ticks; struct usb_line6 *line6 = &toneport->line6; struct usb_device *usbdev = line6->usbdev; ticks = kmalloc(sizeof(*ticks), GFP_KERNEL); if (!ticks) return -ENOMEM; /* sync time on device with host: */ /* note: 32-bit timestamps overflow...
vuln
Safe
Unknown
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Vulnerable
JavaScript
ignore_error_for_testing(char_u *error) { if (ignore_error_list.ga_itemsize == 0) ga_init2(&ignore_error_list, sizeof(char_u *), 1); if (STRCMP("RESET", error) == 0) ga_clear_strings(&ignore_error_list); else ga_add_string(&ignore_error_list, error); }
vuln
Vulnerable
C/C++
long keyctl_session_to_parent(void) { #ifdef TIF_NOTIFY_RESUME struct task_struct *me, *parent; const struct cred *mycred, *pcred; struct cred *cred, *oldcred; key_ref_t keyring_r; int ret; keyring_r = lookup_user_key(KEY_SPEC_SESSION_KEYRING, 0, KEY_LINK); if (IS_ERR(keyring_r)) return PTR_ERR(keyring_r); ...
vuln
Safe
Unknown
int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb) { int len, tag; int ret; int object_type_id = avio_r8(pb); avio_r8(pb); avio_rb24(pb); avio_rb32(pb); avio_rb32(pb); if(avcodec_is_open(st->codec)) { av_log(fc, AV_LOG_DEBUG, "codec open in r...
vuln
Safe
C/C++
sc_parse_ef_gdo_content(const unsigned char *gdo, size_t gdo_len, unsigned char *iccsn, size_t *iccsn_len, unsigned char *chn, size_t *chn_len) { int r = SC_SUCCESS, iccsn_found = 0, chn_found = 0; const unsigned char *p = gdo; size_t left = gdo_len; while (left >= 2) { unsigned int cla, tag; size_t tag_le...
vuln
Safe
C/C++
int FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext* codec_context, AVFrame* frame) { VideoFrame::Format format = PixelFormatToVideoFormat(codec_context->pix_fmt); if (format == VideoFrame::UNKNOWN) return AVERROR(EINVAL); DCHECK(format == VideoFrame::YV12 || format ==...
vuln
Safe
C/C++
xsltProcessUserParamInternal(xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * value, int eval) { xsltStylesheetPtr style; const xmlChar *prefix; const xmlChar *href; xmlXPathCompExprPtr xpExpr; xmlXPathObjectPtr result; xsltStackElemPtr elem; ...
vuln
Vulnerable
C/C++
void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, int gpu_host_id) { texture_layer_->setTextureId(params.surface_handle); DCHECK(texture_layer_ == layer_); layer_->setBounds(params.size); texture_id_in_layer_ = params....
vuln
Vulnerable
C/C++
/* * Copyright 2021 ThoughtWorks, 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 agr...
vuln
Vulnerable
Java
/* * SWIOTLB-based DMA API implementation * * Copyright (C) 2012 ARM Ltd. * Author: Catalin Marinas <catalin.marinas@arm.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. ...
vuln
Vulnerable
C/C++
$("form#streamrule-form").on("click", "#sr-inverted", function() { var modalBody = $(this).closest("form#streamrule-form").find(".modal-body"); var old_val = $("#sr-result-category", modalBody).html(); if ($(this).is(":checked")) { // Add the not. new_val = "not " + old_...
vuln
Safe
JavaScript
static void ready_codebook(vorbis_enc_codebook *cb) { int i; ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries); if (!cb->lookup) { cb->pow2 = cb->dimentions = NULL; } else { int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries); cb->dimentions = av_malloc(si...
vuln
Vulnerable
C/C++
$scope.removeAllNodes = function(foreignSource) { bootbox.confirm('Are you sure you want to remove all the nodes from ' + foreignSource + '?', function(ok) { if (ok) { RequisitionsService.startTiming(); RequisitionsService.removeAllNodesFromRequisition(foreignSource).then( ...
vuln
Vulnerable
JavaScript
fs.writeFile(dbRoot+"/"+db+"/md/"+name, obj, function(err) { if (err) response(res, 500, 'write fail!'); else response(res, 200, 'write success!'); })
vuln
Vulnerable
JavaScript
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Vulnerable
JavaScript
@Override public void onResult (TdApi.Object object) { switch (object.getConstructor()) { case TdApi.WebPageInstantView.CONSTRUCTOR: { final TdApi.WebPageInstantView instantView = (TdApi.WebPageInstantView) object; tdlib.ui().post(() -> { if (!isDestroyed()) { if (!TD.h...
vuln
Vulnerable
Java
static void vp5_parse_coeff(VP56Context *s) { VP56RangeCoder *c = &s->c; VP56Model *model = s->modelp; uint8_t *permute = s->idct_scantable; uint8_t *model1, *model2; int coeff, sign, coeff_idx; int b, i, cg, idx, ctx, ctx_last; int pt = 0; for (b=0; b<6; b++) { int ct = 1; ...
vuln
Vulnerable
C/C++
static int decode_residuals(FLACContext *s, int channel, int pred_order) { int i, tmp, partition, method_type, rice_order; int sample = 0, samples; method_type = get_bits(&s->gb, 2); if (method_type != 0){ av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type); ...
vuln
Safe
C/C++
fetch_next_cert_ldap (cert_fetch_context_t context, unsigned char **value, size_t *valuelen) { gpg_error_t err; unsigned char hdr[5]; char *p, *pend; unsigned long n; int okay = 0; /* int is_cms = 0; */ *value = NULL; *valuelen = 0; err = 0; while (!err) { err = rea...
vuln
Safe
Unknown
static int on_part_data_end(multipart_parser *parser) { multipart_parser_data_t *data = NULL; ogs_assert(parser); data = multipart_parser_get_data(parser); ogs_assert(data); data->num_of_part++; return 0; }
vuln
Vulnerable
Unknown
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size > 512) return 0; net::ProxyBypassRules rules; std::string input(data, data + size); const net::ProxyBypassRules::ParseFormat kFormats[] = { net::ProxyBypassRules::ParseFormat::kDefault, net::ProxyBypassRules:...
vuln
Safe
C/C++
def send_head(self): """Common code for GET and HEAD commands. This sends the response code and MIME headers. Return value is either a file object (which has to be copied to the outputfile by the caller unless the command was HEAD, and must be closed by the caller under all cir...
vuln
Safe
Python
var SqlString = exports; SqlString.escapeId = function (val, forbidQualified) { if (forbidQualified) { return '`' + val.replace(/`/g, '``') + '`'; } return '`' + val.replace(/`/g, '``').replace(/\./g, '`.`') + '`'; }; SqlString.escape = function(val, stringifyObjects, timeZone, dialect) { if (val === unde...
vuln
Vulnerable
JavaScript
def _sanitize_text_helper(text): """Restricts the characters that are allowed in a string""" out = [] for c in text: if c in valid_chars: out.append(c) elif c in mapped_chars: out.append(mapped_chars[c]) else: out.append('X') # makes debugging ea...
vuln
Vulnerable
Python
def _read_lockfile(self, lockfile: Mapping[str, Any]) -> None: root = self.environment.project.root with cd(root): for package in lockfile.get("package", []): version = package.get("version") if version: package["version"] = f"=={version}" ...
vuln
Vulnerable
Python
def load(self): if len(self.tile) != 1 or self.tile[0][0] != "iptc": return ImageFile.ImageFile.load(self) type, tile, box = self.tile[0] encoding, offset = tile self.fp.seek(offset) # Copy image data to temporary file outfile = tempfile.mktemp() ...
vuln
Vulnerable
Python
@Override public boolean onLongClick(final View view) { // Get the clicked position and retrieve the selected application if(view == null) return false ; final Application application = applicationsList.get(getBindingAdapterPosition()) ; final Context context = view.getContext() ; // Show visual fee...
vuln
Vulnerable
Java
void MediaStreamManager::StopStreamDevice(int render_process_id, int render_frame_id, int requester_id, const std::string& device_id, int session_id)...
vuln
Safe
C/C++
void SoftVorbis::onQueueFilled(OMX_U32 portIndex) { List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (mOutputPortSettingsChange != NONE) { return; } if (portIndex == 0 && mInputBufferCount < 2) { BufferInfo *info = *inQueue.begin(); OMX_BUFFERHEADERTYPE ...
vuln
Safe
C/C++
/** * Sample plugin. */ Draw.loadPlugin(function(ui) { var div = document.createElement('div'); div.style.background = Editor.isDarkMode() ? Editor.darkColor : '#ffffff'; div.style.border = '1px solid gray'; div.style.opacity = '0.8'; div.style.padding = '10px'; div.style.paddingTop = '0px'; div.style.width ...
vuln
Safe
JavaScript
int main(int argc, char *argv[]) { opj_dinfo_t* dinfo; opj_event_mgr_t event_mgr; /* event manager */ int tnum; unsigned int snum; opj_mj2_t *movie; mj2_tk_t *track; mj2_sample_t *sample; unsigned char* frame_codestream; FILE *file, *outfile; char outfilename[50]; mj2_dp...
vuln
Safe
C/C++
gxps_archive_input_stream_read (GInputStream *stream, void *buffer, gsize count, GCancellable *cancellable, GError **error) { GXPSArchiveInputStream *istream = GXPS_ARCHIVE_INPUT_STREAM (stream); gssize bytes_read; if (g_cancellable_set_error_if_canc...
vuln
Vulnerable
C/C++
void color_esycc_to_rgb(opj_image_t *image) { int y, cb, cr, sign1, sign2, val; unsigned int w, h, max, i; int flip_value = (1 << (image->comps[0].prec-1)); int max_value = (1 << image->comps[0].prec) - 1; if ( (image->numcomps < 3) || (image->comps[0].dx != image->comps[1].dx) || (image->comps[0].dx !=...
vuln
Safe
C/C++
xmlSchemaFormatNodeForError(xmlChar ** msg, xmlSchemaAbstractCtxtPtr actxt, xmlNodePtr node) { xmlChar *str = NULL; *msg = NULL; if ((node != NULL) && (node->type != XML_ELEMENT_NODE) && (node->type != XML_ATTRIBUTE_NODE)) { /* * Don't try to format other nodes than element and * att...
vuln
Vulnerable
Unknown
@Override public void onStop() { super.onStop(); handler.removeCallbacks(this::refreshLastConnection); }
vuln
Vulnerable
Java
static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p, uint8_t ep) { int status, len; if (!dev->endpoint[EP2I(ep)].iso_started && !dev->endpoint[EP2I(ep)].iso_error) { struct usb_redir_start_iso_stream_header start_iso = { .end...
vuln
Safe
C/C++
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/lice...
vuln
Vulnerable
C/C++
this.getstate = function() { return !this._disabled && mimes.length && fm.selected().length && fm.cwd().write ? 0 : -1; }
vuln
Vulnerable
JavaScript
private Mailbox loadMailbox(MailboxSession session, File mailboxFile, MailboxPath mailboxPath) throws MailboxException { MaildirFolder folder = new MaildirFolder(mailboxFile.getAbsolutePath(), mailboxPath, locker) .validateWithinFolder(getMaildirRoot()) .validateWithinFolder(new File(use...
vuln
Safe
Java
PageInfoUI::GetSecurityDescription(const IdentityInfo& identity_info) const { std::unique_ptr<PageInfoUI::SecurityDescription> security_description( new PageInfoUI::SecurityDescription()); switch (identity_info.safe_browsing_status) { case PageInfo::SAFE_BROWSING_STATUS_NONE: break; case Pag...
vuln
Vulnerable
C/C++
/* import-globals-from ../src/jsmime.jsm */ /* globals define, module */ (function(root, fn) { if (typeof define === "function" && define.amd) { define(fn); } else if (typeof module !== "undefined" && module.exports) { module.exports = fn(); } else { root.jsmime = fn(); } })(this, function() { va...
vuln
Safe
JavaScript
package com.salesmanager.shop.admin.controller; /** * Interface contain constant for Controller.These constant will be used throughout * sm-shop to providing constant values to various Controllers being used in the * application. * @author Umesh A * */ public interface ControllerConstants { interface Tiles...
vuln
Vulnerable
Java
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
vuln
Safe
C/C++
private void applyTransaction(@NonNull WindowContainerTransaction t, int syncId, @Nullable Transition transition, @NonNull CallerInfo caller, @Nullable Transition finishTransition) { int effects = 0; ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Apply window transaction, syncId=%d", syn...
vuln
Vulnerable
Java
static int wddx_stack_destroy(wddx_stack *stack) { register int i; if (stack->elements) { for (i = 0; i < stack->top; i++) { if (((st_entry *)stack->elements[i])->data) { zval_ptr_dtor(&((st_entry *)stack->elements[i])->data); } if (((st_entry *)stack->elements[i])->varname) { efree(((st_ent...
vuln
Vulnerable
Unknown
long ContentEncoding::ParseContentEncodingEntry(long long start, long long size, IMkvReader* pReader) { assert(pReader); long long pos = start; const long long stop = start + size; int compression_count = 0; int encryption_count = 0; while (pos < stop) { long long id, size; const long status = ParseElement...
vuln
Safe
C/C++
"""Object level permissions.""" from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from modoboa.core import constants as core_constants, signals as core_signals from modoboa.core.models import ObjectAccess, User def get_account_roles(user, account=Non...
vuln
Vulnerable
Python
void memory_region_del_eventfd(MemoryRegion *mr, hwaddr addr, unsigned size, bool match_data, uint64_t data, EventNotifier *e) { MemoryRegionIoeventfd mrfd = { ...
vuln
Vulnerable
C/C++
static int huffman_decode(MPADecodeContext *s, GranuleDef *g, int16_t *exponents, int end_pos2) { int s_index; int i; int last_pos, bits_left; VLC *vlc; int end_pos = FFMIN(end_pos2, s->gb.size_in_bits - s->extrasize * 8); s_index = 0; for (i = 0; i < 3; i++) {...
vuln
Safe
C/C++
uipbuf_get_next_header(uint8_t *buffer, uint16_t size, uint8_t *protocol, bool start) { int curr_hdr_len = 0; int next_hdr_len = 0; uint8_t *next_header = NULL; struct uip_ip_hdr *ipbuf = NULL; struct uip_ext_hdr *curr_ext = NULL; struct uip_ext_hdr *next_ext = NULL; if(start) { /* protocol in the IP...
vuln
Safe
Unknown
function headerValueNormalize (potentialValue) { // To normalize a byte sequence potentialValue, remove // any leading and trailing HTTP whitespace bytes from // potentialValue. // Trimming the end with `.replace()` and a RegExp is typically subject to // ReDoS. This is safer and faster. let i = potenti...
vuln
Safe
JavaScript
def get_disp_ctrl Log.add_info(request, params.inspect) if params[:id] != '0' begin @folder = Folder.find(params[:id]) rescue => evar @folder = nil end end session[:folder_id] = params[:id] render(:partial => 'ajax_disp_ctrl', :layout => false) end
vuln
Vulnerable
Ruby
SecureVector<byte> EME_PKCS1v15::unpad(const byte in[], size_t inlen, size_t key_len) const { if(inlen != key_len / 8 || inlen < 10 || in[0] != 0x02) throw Decoding_Error("PKCS1::unpad"); size_t seperator = 0; for(size_t j = 0; j != inlen; ++j) if(in[j] ==...
vuln
Vulnerable
Unknown
void snd_info_free_entry(struct snd_info_entry * entry) { struct snd_info_entry *p, *n; if (!entry) return; if (entry->p) { mutex_lock(&info_mutex); snd_info_disconnect(entry); mutex_unlock(&info_mutex); } /* free all children at first */ list_for_each_entry_safe(p, n, &entry->children, list) snd_info...
vuln
Vulnerable
Unknown
int status(const char *fmt, ...) { static char buf[1024]; va_list args; if(!show_status) return(0); va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); return(message(LOG_DEBUG, buf)); }
vuln
Safe
Unknown
/* * Copyright (c) 2014 Open Grid Computing, Inc. All rights reserved. * Copyright (c) 2005-2007 Network Appliance, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Vers...
vuln
Vulnerable
C/C++
int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { struct inode *inode = dentry->d_inode; struct task_struct *task; const struct cred *cred; generic_fillattr(inode, stat); rcu_read_lock(); stat->uid = 0; stat->gid = 0; task = pid_task(proc_pid(inode), PIDTYPE_PID); if (task) {...
vuln
Vulnerable
Unknown
Init_ossl_cipher(void) { #if 0 mOSSL = rb_define_module("OpenSSL"); eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError); #endif /* Document-class: OpenSSL::Cipher * * Provides symmetric algorithms for encryption and decryption. The * algorithms that are available dep...
vuln
Safe
Unknown
private void ensureAddressExist(String path) throws InvalidTransactionException { String code = Utilities.getCurrentSolAccount(context); SOLAccount account = SOLAccount.ofCode(code); path = path.toUpperCase(); SOLAccount target = SOLAccount.getAccountByPath(path); if (target == n...
vuln
Safe
Java
static int l2tp_ip6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)uaddr; struct sock *sk = sock->sk; struct ipv6_pinfo *np = inet6_sk(sk); struct l2tp_ip6_sock *lsk = l2tp_ip6_sk(sk); lsa->l2tp_family = AF_INET6; ...
vuln
Vulnerable
C/C++
static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen, PKCS7_RECIP_INFO *ri, EVP_PKEY *pkey, size_t fixlen) { EVP_PKEY_CTX *pctx = NULL; unsigned char *ek = NULL; size_t eklen; int ret = -1; pctx = EVP_PKEY_CTX_new(pkey, NULL)...
vuln
Safe
Unknown
@SuppressWarnings("deprecation") @Parameters(count=5, requires= {RMGOption.TARGET}) public void dispatchCodebase() { String className = p.getPositionalString(3); RMGUtils.setCodebase(p.getPositionalString(4)); Object payload = null; String component = p.getComponent(); ...
vuln
Vulnerable
Java
static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n) { struct net *net = sock_net(skb->sk); struct nlattr *tca[TCA_ACT_MAX + 1]; u32 portid = skb ? NETLINK_CB(skb).portid : 0; int ret = 0, ovr = 0; if ((n->nlmsg_type != RTM_GETACTION) && !netlink_capable(skb, CAP_NET_ADMIN)) return -EPERM; ret = ...
vuln
Safe
Unknown
public static FontConfig.FontFamily readFamily(XmlPullParser parser, String fontDir, @Nullable Map<String, File> updatableFontMap) throws XmlPullParserException, IOException { final String name = parser.getAttributeValue(null, "name"); final String lang = parser.getAttributeValue...
vuln
Vulnerable
Java
static <T extends MapstructBaseReference> PsiReference[] create(PsiElement psiElement, ReferenceCreator<T> creator, boolean supportsNested) { ElementManipulator<PsiElement> manipulator = getManipulator( psiElement ); TextRange rangeInElement = manipulator.getRangeInElement( psiElement ); ...
vuln
Vulnerable
Java
RectangleRequest(const struct RectangleRequest &req) : Explicit() { // Not linked in any way if this is new. rr_pNext = NULL; rr_Request = req.rr_Request; rr_usFirstComponent = req.rr_usFirstComponent; rr_usLastComponent = req.rr_usLastComponent; rr_cPriority = ...
vuln
Safe
C/C++
static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, const unsigned char *sess_id, int sesslen, SSL_SESSION **psess) { SSL_SESSION *sess; unsigned char *sdec; const unsigned char *p; int slen, mlen, renew_ticket = 0; unsigned char tick_hmac[EVP_MAX_MD_SIZE]; HMAC_CTX hctx; EVP...
vuln
Safe
Unknown
static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, const struct dp_upcall_info *upcall_info) { struct ovs_header *upcall; struct sk_buff *nskb = NULL; struct sk_buff *user_skb; /* to be queued to userspace */ struct nlattr *nla; struct genl_info info = { .dst_sk = ovs_dp_get_net(dp...
vuln
Safe
Unknown
robj *rdbLoadObject(int rdbtype, rio *rdb, sds key) { robj *o = NULL, *ele, *dec; uint64_t len; unsigned int i; if (rdbtype == RDB_TYPE_STRING) { /* Read string value */ if ((o = rdbLoadEncodedStringObject(rdb)) == NULL) return NULL; o = tryObjectEncoding(o); } else if (rdbt...
vuln
Vulnerable
Unknown
static av_always_inline int vmnc_get_pixel(const uint8_t *buf, int bpp, int be) { switch (bpp * 2 + be) { case 2: case 3: return *buf; case 4: return AV_RL16(buf); case 5: return AV_RB16(buf); case 8: return AV_RL32(buf); case 9: return AV_RB32(buf); ...
vuln
Vulnerable
C/C++
static void coroutine_fn v9fs_xattrwalk(void *opaque) { int64_t size; V9fsString name; ssize_t err = 0; size_t offset = 7; int32_t fid, newfid; V9fsFidState *file_fidp; V9fsFidState *xattr_fidp = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err...
vuln
Vulnerable
C/C++
int main(int argc, char *argv[]) { time_t timep; struct tm *timeptr; char *now; if (argc < 3) { send_error(1); return -1; } else if (argc > 3) { send_error(5); return -1; } build_needs_escape(); if (argv[2] == NULL) index_directory(argv[1], argv...
vuln
Vulnerable
C/C++
static inline str format_val2json(const ValPtr res) { char *buf = NULL; size_t sz = 0; if (BATatoms[res->vtype].atomNull && BATatoms[res->vtype].atomCmp(VALget(res), BATatoms[res->vtype].atomNull) == 0) return GDKstrdup("\"nil\""); bool use_external = true; switch (res->vtype ) { case TYPE_bte: case TYP...
vuln
Vulnerable
C/C++