code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target) { const int16_...
vuln
Vulnerable
C/C++
int ha_partition::open(const char *name, int mode, uint test_if_locked) { char *name_buffer_ptr; int error= HA_ERR_INITIALIZATION; handler **file; char name_buff[FN_REFLEN]; bool is_not_tmp_table= (table_share->tmp_table == NO_TMP_TABLE); ulonglong check_table_flags; DBUG_ENTER("ha_partition::open"); D...
vuln
Vulnerable
Unknown
synchronized void updateAAD(byte[] src, int offset, int len) { if (aadBuffer != null) { aadBuffer.write(src, offset, len); } else { // update has already been called throw new IllegalStateException ("Update has been called; no more AAD data"); ...
vuln
Safe
Java
xmlXPtrNewRangeNodePoint(xmlNodePtr start, xmlXPathObjectPtr end) { xmlXPathObjectPtr ret; if (start == NULL) return(NULL); if (end == NULL) return(NULL); if (start->type != XPATH_POINT) return(NULL); if (end->type != XPATH_POINT) return(NULL); ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xm...
vuln
Vulnerable
Unknown
rsvg_state_clone (RsvgState * dst, const RsvgState * src) { gint i; RsvgState *parent = dst->parent; rsvg_state_finalize (dst); *dst = *src; dst->parent = parent; dst->mask = g_strdup (src->mask); dst->font_family = g_strdup (src->font_family); dst->lang = g_strdup (src->lang); rsv...
vuln
Safe
Unknown
public void resortTransparency(RenderType layer, double x, double y, double z) { for (LittleLevelEntity animation : entities) if (animation.hasLoaded()) LittleLevelEntityRenderer.INSTANCE.resortTransparency(animation, layer, x, y, z); }
vuln
Safe
Java
public void setOssNicknames(String[] ossNicknames) { this.ossNicknames = ossNicknames; }
vuln
Vulnerable
Java
/* Copyright 2016 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
Python
static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr) { uint16_t val = 0; if (addr <= sizeof(s->mem) - sizeof(val)) { memcpy(&val, &s->mem[addr], sizeof(val)); } switch (addr) { case SCBStatus: case SCBCmd: TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(addr), val...
vuln
Safe
C/C++
package verify import ( "errors" "fmt" "time" ) var ( ErrMissingKey = errors.New("tuf: missing key") ErrNoSignatures = errors.New("tuf: data has no signatures") ErrInvalid = errors.New("tuf: signature verification failed") ErrWrongMethod = errors.New("tuf: invalid signat...
vuln
Safe
Go
@Override public void loadSettings() { super.loadSettings(); // Load values from new connection info DBPConnectionConfiguration connectionInfo = site.getActiveDataSource().getConnectionConfiguration(); if (projectText != null) { projectText.setText(CommonUtils.notEmp...
vuln
Safe
Java
async def _static_request_handler( self, file_or_directory, use_modified_since, use_content_range, stream_large_files, request, content_type=None, __file_uri__=None, ): # Merge served directory and requested file if provided root_path =...
vuln
Vulnerable
Python
copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) { int charsRequired = 0; XML_Char *result; /* First determine how long the string is */ while (s[charsRequired] != 0) { charsRequired++; } /* Include the terminator */ charsRequired++; /* Now allocate space for the copy */ ...
vuln
Vulnerable
Unknown
static void qed_check_for_leaks(QEDCheck *check) { BDRVQEDState *s = check->s; uint64_t i; for (i = s->header.header_size; i < check->nclusters; i++) { if (!qed_test_bit(check->used_clusters, i)) { check->result->leaks++; } } }
vuln
Safe
C/C++
public function onRouteShutdown(Enlight_Controller_EventArgs $args) { /** @var Enlight_Controller_Request_RequestHttp $request */ $request = $args->getRequest(); $config = $this->Config(); if ($request->getModuleName() === 'backend' || $request->getModuleName() === 'api') { ...
vuln
Safe
PHP
void isis_notif_max_area_addr_mismatch(const struct isis_circuit *circuit, uint8_t max_area_addrs, const char *raw_pdu, size_t raw_pdu_len) { const char *xpath = "/frr-isisd:max-area-addresses-mismatch"; struct list *arguments = yang_data_list_new(); char xpath_arg[XPATH_MAXLEN]; struct yang_d...
vuln
Safe
Unknown
function attachToBody (options, req, reply, next) { if (req.raw[kMultipart] !== true) { next() return } const consumerStream = options.onFile || defaultConsumer const body = {} const mp = req.multipart((field, file, filename, encoding, mimetype) => { body[field] = body[field] || [] body[field...
vuln
Vulnerable
JavaScript
static void vncws_send_handshake_response(VncState *vs, const char* key) { char combined_key[WS_CLIENT_KEY_LEN + WS_GUID_LEN + 1]; unsigned char hash[SHA1_DIGEST_LEN]; size_t hash_size = sizeof(hash); char *accept = NULL, *response = NULL; gnutls_datum_t in; int ret; g_strlcpy(combined_key, ...
vuln
Safe
C/C++
@Override public List<LittleTile> placeTile(Placement placement, PlacementBlock block, IParentTileList parent, LittleStructure structure, LittleTile tile, boolean requiresCollisionTest) throws LittleActionException { List<LittleTile> tiles = new ArrayList<>(); Pair<IParentTileList, LittleTile> inter...
vuln
Safe
Java
static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size) { const uint8_t *s = src; const uint8_t *end; const uint8_t *mm_end; uint16_t *d = (uint16_t *)dst; end = s + src_size; __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); __asm__ volatile( "movq...
vuln
Safe
C/C++
/** * * Rhonabwy JSON Web Encryption (JWE) library * * jwe.c: functions definitions * * Copyright 2020-2022 Nicolas Mora <mail@babelouest.org> * * This program 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 Softw...
vuln
Safe
C/C++
static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s, AVFrame *frame) { int x, y; unsigned char P[8]; int flags = 0; bytestream2_get_buffer(&s->stream_ptr, P, 4); if (P[0] <= P[1]) { for (y = 0; y < 16; y++) { if (!(y & 3)) { if ...
vuln
Vulnerable
C/C++
/** * <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
Safe
Java
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) { AVStream *st; int i; AVStream **streams; if (s->nb_streams >= INT_MAX/sizeof(*streams)) streams = av_realloc_array(s->streams, s->nb_streams + 1, sizeof(*streams)); if (!streams) s->streams = streams; st = av_mallocz(s...
vuln
Vulnerable
C/C++
static void openpic_realize(DeviceState *dev, Error **errp) { SysBusDevice *d = SYS_BUS_DEVICE(dev); OpenPICState *opp = OPENPIC(dev); int i, j; int list_count = 0; static const MemReg list_le[] = { {"glb", &openpic_glb_ops_le, OPENPIC_GLB_REG_START, OPENPIC_GLB_REG_SIZE}, ...
vuln
Safe
Unknown
xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3) { unsigned long value = 0L; char ch; if (name != NULL) { value += 30 * (*name); while ((ch = *name++) != 0) { value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); }...
vuln
Vulnerable
Unknown
function AJchangeUserGroupPrivs() { global $user; $node = processInputVar("activeNode", ARG_NUMERIC); if(! checkUserHasPriv("userGrant", $user["id"], $node)) { $text = "You do not have rights to modify user privileges at this node."; print "alert('$text');"; return; } $newusergrpid = processInputVar("item", ...
vuln
Vulnerable
PHP
private static void addAnnotation(LocalTaintVulnerability vulnerability, AnnotationHolder annotationHolder) { RangeMarker rangeMarker = vulnerability.rangeMarker(); if (rangeMarker == null) { return; } TextRange textRange = createTextRange(rangeMarker); if (textRange.isEmpty()) { return;...
vuln
Safe
Java
import $ from "jquery"; import _ from "lodash"; import render_recent_topic_row from "../templates/recent_topic_row.hbs"; import render_recent_topics_filters from "../templates/recent_topics_filters.hbs"; import render_recent_topics_body from "../templates/recent_topics_table.hbs"; import * as compose_closed_ui from "...
vuln
Safe
JavaScript
static char* set_iovec_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value) { char *x; x = set_iovec_field(iovec, n_iovec, field, value); free(value); return x; }
vuln
Vulnerable
Unknown
static void sasl_step_fail(IRC_SERVER_REC *server) { irc_send_cmd_now(server, "AUTHENTICATE *"); cap_finish_negotiation(server); sasl_timeout_stop(server); signal_emit("server sasl failure", 2, server, "The server sent an invalid payload"); }
vuln
Safe
Unknown
package verify import ( "encoding/json" "strings" "time" "github.com/secure-systems-lab/go-securesystemslib/cjson" "github.com/theupdateframework/go-tuf/data" "github.com/theupdateframework/go-tuf/internal/roles" ) type signedMeta struct { Type string `json:"_type"` Expires time.Time `json:"expires"` ...
vuln
Safe
Go
PHP_FUNCTION(exif_read_data) { char *p_name, *p_sections_needed = NULL; size_t p_name_len, p_sections_needed_len = 0; zend_bool sub_arrays=0, read_thumbnail=0, read_all=0; int i, ret, sections_needed=0; image_info_type ImageInfo; char tmp[64], *sections_str, *s; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sb...
vuln
Vulnerable
Unknown
static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, struct msghdr *msg, size_t len) { struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct sock *sk = sock->sk; struct sock *other = NULL; struct sockaddr_un *sunaddr=msg->msg_name; int err,size; struct sk_buff *skb; int sent=0; s...
vuln
Vulnerable
Unknown
def _delete_vdisk(self, name, force): """Deletes existing vdisks. It is very important to properly take care of mappings before deleting the disk: 1. If no mappings, then it was a vdisk, and can be deleted 2. If it is the source of a flashcopy mapping and copy_rate is 0, then ...
vuln
Safe
Python
_PUBLIC_ codepoint_t next_codepoint_handle(struct smb_iconv_handle *ic, const char *str, size_t *size) { return next_codepoint_handle_ext(ic, str, CH_UNIX, size); }
vuln
Vulnerable
Unknown
public function admin_delete($id = null) { if (!$this->request->is('post') && !$this->request->is('delete')) { throw new MethodNotAllowedException(__('Action not allowed, post or delete request expected.')); } if (!$this->_isAdmin()) { throw new Exception('Administrat...
vuln
Safe
PHP
@Override public AlgorithmStatus run(ReachedSet reachedSet) throws CPAException, InterruptedException { AlgorithmStatus status = algorithm.run(reachedSet); totalTime.start(); try { FluentIterable<CounterexampleInfo> counterExamples = Optionals.presentInstances( from(reachedS...
vuln
Safe
Java
struct clock_source *dcn20_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); if (!clk_src) return NULL; if (dcn20_clk_sr...
vuln
Safe
Unknown
private void global(AdminPerformer performer, CommandParser.Arguments arguments) { performer.success("<b>Admin console usage</b>"); performer.info("For execute a command, simply type the command name, and add arguments separated by a single space."); performer.error("<i>(!) The command and argum...
vuln
Safe
Java
QPDF::lengthNextN(int first_object, int n, std::list<std::string>& errors) { int length = 0; for (int i = 0; i < n; ++i) { QPDFObjGen og(first_object + i, 0); if (this->m->xref_table.count(og) == 0) { errors.push_back( "no xref table entry for " + QUtil::int_to_string(first_object + i) + " 0...
vuln
Safe
Unknown
static void kvm_set_phys_mem(target_phys_addr_t start_addr, ram_addr_t size, ram_addr_t phys_offset, bool log_dirty) { KVMState *s = kvm_state; ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK; KVMSlot *mem, old; int err; void *ram = NULL; size = TARGET_PAGE_A...
vuln
Vulnerable
C/C++
public void init(InputStream input, String sqlDefsSection, Connection conn, Map<String, String> configParameters) throws Exception { // Parse the InputStream as an XML document. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBu...
vuln
Vulnerable
Java
public boolean strict_equals(VideoType that) { return ( (that != null) && this.title.equals(that.title) && this.URL_low_res.equals(that.URL_low_res) && ((this.URL_high_res == null) ? (that.URL_high_res == null) : this.URL_high_res.equals(tha...
vuln
Safe
Java
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2009-2018 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
vuln
Safe
Python
def self.create_user_from_invite(email:, invite:, username: nil, name: nil, password: nil, user_custom_fields: nil, ip_address: nil, session: nil, email_token: nil) if username && UsernameValidator.new(username).valid_format? && User.username_available?(username, email) available_username = username else ...
vuln
Vulnerable
Ruby
int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev, enum wimax_rf_state state) { int result; struct i2400m *i2400m = wimax_dev_to_i2400m(wimax_dev); struct device *dev = i2400m_dev(i2400m); struct sk_buff *ack_skb; struct { struct i2400m_l3l4_hdr hdr; struct i2400m_tlv_rf_operation sw_rf; } ...
vuln
Safe
C/C++
private static String getResolverData(Context context, Uri uri, String selection, String[] selectionArgs) { final String column = MediaStore.Files.FileColumns.DATA; final String[] projection = {column}; try { try (Cursor cursor = context.getContentResolver().query(uri, projection, ...
vuln
Vulnerable
Java
int PackLinuxElf32::canUnpack() { if (super::canUnpack()) { return true; } if (Elf32_Ehdr::ET_DYN==get_te16(&ehdri.e_type)) { PackLinuxElf32help1(fi); } return false; }
vuln
Vulnerable
C/C++
static void rpza_decode_stream(RpzaContext *s) { int width = s->avctx->width; int stride = s->frame->linesize[0] / 2; int row_inc = stride - 4; int chunk_size; uint16_t colorA = 0, colorB; uint16_t color4[4]; uint16_t ta, tb; uint16_t *pixels = (uint16_t *)s->frame->data[0]; int row...
vuln
Safe
Unknown
public static String getFilePath(Context context, Uri uri) { Cursor cursor = null; final String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME }; try { cursor = context.getContentResolver().query(uri, projection, null, null, null);...
vuln
Vulnerable
Java
TPMI_DH_SAVED_Unmarshal(TPMI_DH_SAVED *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; TPMI_DH_SAVED orig_target = *target; // libtpms added allowNull = allowNull; if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_R...
vuln
Safe
Unknown
def _request( self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey, ): """Do the actual request using the connection object and also follow one level of redirects if necessary""" ...
vuln
Vulnerable
Python
static int get_siz(Jpeg2000DecoderContext *s) { int i; int ncomponents; uint32_t log2_chroma_wh = 0; const enum AVPixelFormat *possible_fmts = NULL; int possible_fmts_nb = 0; if (bytestream2_get_bytes_left(&s->g) < 36) { av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for SIZ\n"); ...
vuln
Safe
C/C++
void DecodePngV2(OpKernelContext* context, StringPiece input) { int channel_bits = (data_type_ == DataType::DT_UINT8) ? 8 : 16; png::DecodeContext decode; OP_REQUIRES( context, png::CommonInitDecode(input, channels_, channel_bits, &decode), errors::InvalidArgument("Invalid PNG. Failed to ini...
vuln
Safe
C/C++
private Download build() { return new Download(this.url, this.expectedHash, this.useEtag, this.forceDownload, this.offline, maxAge, progressListener); }
vuln
Vulnerable
Java
public static void register(ModLoadingContext context, IEventBus modBus) { Lists.newArrayList( // Pair.of(ModConfig.Type.COMMON, Common.SPEC), Pair.of(ModConfig.Type.CLIENT, Client.SPEC), Pair.of(ModConfig.Type.SERVER, Server.SPEC) ).forEach(pair -> context.registerConfig(pair.getKey(), pair.getValue())); ...
vuln
Vulnerable
Java
static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; FieldOrderContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; int h, plane, line_step, line_size, line; uint8_t *data; if (!frame->interlaced_frame || frame-...
vuln
Vulnerable
Unknown
apr_status_t h2_session_process(h2_session *session, int async) { apr_status_t status = APR_SUCCESS; conn_rec *c = session->c; int rv, mpm_state, trace = APLOGctrace3(c); apr_time_t now; if (trace) { ap_log_cerror( APLOG_MARK, APLOG_TRACE3, status, c, H2_SSSN_MSG(s...
vuln
Safe
Unknown
public IMqttToken subscribe(String[] topicFilters, int[] qos, IMqttMessageListener[] messageListeners) throws MqttException { return this.subscribe(topicFilters, qos, messageListeners); }
vuln
Vulnerable
Java
@PayloadRoot(localPart = "FindAllManufacturersRequest", namespace = NAMESPACE) @ResponsePayload public FindAllManufacturersResponse findAllManufacturers( @OrganisationIdentification final String organisationIdentification, @RequestPayload final FindAllManufacturersRequest request) throws OsgpExcep...
vuln
Safe
Java
void fp2_read_bin(fp2_t a, const uint8_t *bin, size_t len) { if (len != RLC_FP_BYTES + 1 && len != 2 * RLC_FP_BYTES) { RLC_THROW(ERR_NO_BUFFER); return; } if (len == RLC_FP_BYTES + 1) { fp_read_bin(a[0], bin, RLC_FP_BYTES); fp_zero(a[1]); fp_set_bit(a[1], 0, bin[RLC_FP_BYTES]); fp2_upk(a, a); } if (len...
vuln
Safe
C/C++
IMPEG2D_ERROR_CODES_T impeg2d_dec_p_b_slice(dec_state_t *ps_dec) { WORD16 *pi2_vld_out; UWORD32 i; yuv_buf_t *ps_cur_frm_buf = &ps_dec->s_cur_frm_buf; UWORD32 u4_frm_offset = 0; const dec_mb_params_t *ps_dec_mb_params; IMPEG2D_ERROR_CODES_T e_error = (IMPEG2D_ERROR_CODES_T)IVD_ERROR_N...
vuln
Safe
Unknown
getScanlineChunkOffsetTableSize(const Header& header) { const Box2i &dataWindow = header.dataWindow(); vector<size_t> bytesPerLine; size_t maxBytesPerLine = bytesPerLineTable (header, bytesPerLine); int linesInBuffer = numLinesInBuffer ( header.compressi...
vuln
Safe
Unknown
processPrimeResponse(struct module_qstate* qstate, int id) { struct iter_qstate* iq = (struct iter_qstate*)qstate->minfo[id]; enum response_type type; iq->response->rep->flags &= ~(BIT_RD|BIT_RA); /* ignore rec-lame */ type = response_type_from_server( (int)((iq->chase_flags&BIT_RD) || iq->chase_to_rd), iq->re...
vuln
Safe
Unknown
static int match(Reinst *pc, const char *sp, const char *bol, int flags, Resub *out, int depth) { Resub scratch; int result; int i; Rune c; /* stack overflow */ if (depth > MAXREC) return -1; for (;;) { switch (pc->opcode) { case I_END: return 0; case I_JUMP: pc = pc->x; break; case I_SPLIT:...
vuln
Safe
C/C++
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "hermes/BCGen/HBC/BytecodeGenerator.h" #include "hermes/BCGen/HBC/ConsecutiveStringStorage.h" #include "hermes/FrontEndDe...
vuln
Vulnerable
C/C++
@Override public String getQueryString() { String value = super.getQueryString(); if (value == null) { return null; } return HtmlUtils.htmlEscape(value); }
vuln
Vulnerable
Java
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2016, Open Source Geospatial Foundation (OSGeo) * * This library 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 ...
vuln
Vulnerable
Java
public static void addConnectionsFromTemplate( ServerLevelAccessor iworld, IConnectionTemplate template, StructurePlaceSettings orientation, BlockPos startPos ) { if(template.getStoredConnections().isEmpty()) return; Level world = iworld.getLevel(); GlobalWireNetwork net = GlobalWireNetwork.getNetwork(wor...
vuln
Vulnerable
Java
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInput, &input)); const TfLiteTensor* input_state; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputState, &input_state)); const TfLit...
vuln
Safe
C/C++
/** * FreeRDP: A Remote Desktop Protocol Implementation * Auto-Detect PDUs * * Copyright 2014 Dell Software <Mike.McDonald@software.dell.com> * * 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 Lice...
vuln
Vulnerable
C/C++
public function getPurchaseOrderByJSON() { if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']); } else { $purchase_orders = $this->purchase_order->find('all'); } echo json_encode($purchase_orders); }
vuln
Vulnerable
PHP
obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena) { PyObject* tmp = NULL; identifier name; identifier asname; if (_PyObject_HasAttrId(obj, &PyId_name)) { int res; tmp = _PyObject_GetAttrId(obj, &PyId_name); if (tmp == NULL) goto failed; res = obj2ast_identifier...
vuln
Vulnerable
C/C++
static public function onPost( $par, $out, $request ) { global $wgUser; if (!$request->getText('reason')) { $out->addHTML(Html::rawElement( 'p', [ 'class' => 'error '], wfMessage( 'report-error-missing-reason' )->escaped() )); } else { $dbw = wfGetDB( DB_MASTER ); $dbw->startAtomic(__METHO...
vuln
Vulnerable
PHP
Variant HHVM_FUNCTION(mcrypt_create_iv, int size, int source /* = 0 */) { if (size <= 0 || size >= INT_MAX) { raise_warning("Can not create an IV with a size of less than 1 or " "greater than %d", INT_MAX); return false; } int n = 0; char *iv = (char*)calloc(size + 1, 1); if (sour...
vuln
Safe
C/C++
/* * Copyright (c) 2004-2021, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of cond...
vuln
Vulnerable
Java
std::string PrintPreviewUI::GetPrintPreviewUIAddress() const { int32 PrintPreviewUI::GetIDForPrintPreviewUI() const { return id_; }
vuln
Safe
C/C++
static inline void CheckEventLogging() { /* Are we logging events? */ if (IsLinkedListEmpty(log_cache) != MagickFalse) event_logging=MagickFalse; else { LogInfo *p; ResetLinkedListIterator(log_cache); p=(LogInfo *) GetNextValueInLinkedList(log_cache); event_logging=(...
vuln
Safe
C/C++
static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, void *data, uint32_t length, uint64_t offset) { int ret = 0; void *buffer = NULL; void *merged_sector = NULL; void *data_tmp, *sector_write; unsigned int i; int sector_offset; uint32_t desc_sectors, s...
vuln
Safe
C/C++
// Copyright 2018 Google 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
vuln
Vulnerable
JavaScript
void net_rx_pkt_attach_iovec_ex(struct NetRxPkt *pkt, const struct iovec *iov, int iovcnt, size_t iovoff, bool strip_vlan, uint16_t vet) { uint16_t tci = 0; uint16_t ploff = iovoff; assert(pkt); pkt->vlan_str...
vuln
Vulnerable
C/C++
pub fn ensure_ethereum_transaction<OuterOrigin>(o: OuterOrigin) -> Result<H160, &'static str> where OuterOrigin: Into<Result<RawOrigin, OuterOrigin>>, { match o.into() { Ok(RawOrigin::EthereumTransaction(n)) => Ok(n), _ => Err("bad origin: expected to be an Ethereum transaction"), } } pub struct EnsureEthereumT...
vuln
Vulnerable
Rust
int qemu_opts_set(QemuOptsList *list, const char *id, const char *name, const char *value) { QemuOpts *opts; opts = qemu_opts_create(list, id, 1); if (opts == NULL) { return -1; } return qemu_opt_set(opts, name, value); }
vuln
Vulnerable
C/C++
def get_avail_resource_agents(params, request, session) if not allowed_for_local_cluster(session, Permissions::READ) return 403, 'Permission denied' end agents = getResourceAgents(session) return JSON.generate(agents) end
vuln
Vulnerable
Ruby
function getGttsCmdWithArgs(fields) { var text = fields.textToSpeech, language = fields.language, speed = fields.speed, speedParam = speed ? ' -s' : '', cmd = 'gtts-cli' + ' -l ' + language + speedParam + ' --nocheck \"' + text + '\"' + ' | play -t mp3 -'; return cmd; }
vuln
Vulnerable
JavaScript
static bool object_create_initial(const char *type) { if (g_str_equal(type, "rng-egd")) { return false; } if (g_str_equal(type, "filter-buffer") || g_str_equal(type, "filter-dump") || g_str_equal(type, "filter-mirror") || g_str_equal(type, "filter-redirector")) { ...
vuln
Safe
C/C++
VERSION = (0, 9, '8') __version__ = '.'.join(map(str, VERSION)) def version(): return __version__
vuln
Vulnerable
Python
public static String constructFunctionKey(String fnamespace, String fname) { return fnamespace + Program.KEY_DELIM + fname; }
vuln
Vulnerable
Java
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.review.ProductReviewService; import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse; import com.salesmana...
vuln
Vulnerable
Java
package dtls import ( "crypto" "crypto/ecdsa" "crypto/rand" "crypto/x509" "fmt" "math" "net" "sync" "sync/atomic" "time" "github.com/pion/logging" ) const ( initialTickerInterval = time.Second cookieLength = 20 defaultNamedCurve = namedCurveX25519 inboundBufferSize = 8192 ) var inval...
vuln
Safe
Go
static void slirp_guestfwd(SlirpState *s, Monitor *mon, const char *config_str, int legacy_format) { struct in_addr server = { .s_addr = 0 }; struct GuestFwd *fwd; const char *p; char buf[128]; char *end; int port; p = config_str; if (legacy_format) { i...
vuln
Vulnerable
C/C++
void SVGStyleElement::DidNotifySubtreeInsertionsToDocument() { if (isConnected()) { if (StyleElement::ProcessStyleSheet(GetDocument(), *this) == StyleElement::kProcessingFatalError) { NotifyLoadedSheetAndAllCriticalSubresources( kErrorOccurredLoadingSubresource); } } return kInsert...
vuln
Safe
C/C++
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
vuln
Vulnerable
Java
void janus_videocall_destroy_session(janus_plugin_session *handle, int *error) { if(g_atomic_int_get(&stopping) || !g_atomic_int_get(&initialized)) { *error = -1; return; } janus_videocall_session *session = (janus_videocall_session *)handle->plugin_handle; if(!session) { JANUS_LOG(LOG_ERR, "No VideoCall sess...
vuln
Vulnerable
C/C++
def get_output_files(titles: list[str]) -> list[Output]: outputs = [Output(title=titles[i], file_name=get_temp_file_name()) for i in range(len(titles))] for out in outputs: get_console().print(f"[info]Capturing output of {out.title}:[/] {out.file_name}") return outputs
vuln
Vulnerable
Python
static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y) { const int16_t *ubuf0 = ubuf...
vuln
Safe
C/C++
static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { DVVideoContext *s = avctx->priv_data; s->sys = dv_frame_profile(buf); if (!s->sys || buf_size < s->sys->frame_size) retur...
vuln
Safe
C/C++
conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent) { apr_allocator_t *allocator; apr_status_t status; apr_pool_t *pool; conn_rec *c; void *cfg; module *mpm; ap_assert(master); ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, master, "h2_stream(...
vuln
Safe
Unknown
public void updateServiceCmd(Map<String, Object> parameter) { DockerClient dockerClient = DockerUtil.get(parameter); String serviceId = (String) parameter.get("serviceId"); ServiceSpec serviceSpec = this.intServiceSpec(dockerClient, serviceId); String name = (String) parameter.get("name...
vuln
Vulnerable
Java