code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
#include <gio/gio.h> #include <stdlib.h> #include <sys/types.h> #include <pwd.h> #include <grp.h> #include "libabrt.h" #include "abrt-polkit.h" #include "abrt_glib.h" #include <libreport/dump_dir.h> #include "problem_api.h" static GMainLoop *loop; static guint g_timeout_source; /* default, settable with -t: */ static ...
vuln
Vulnerable
C/C++
package com.salesmanager.core.model.catalog.product.price; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * Transient entity used to display * different price information in the catalogue * @author Carl Samson * */ public class FinalPrice implements Se...
vuln
Vulnerable
Java
private void reload() { Seed seed = Seeds.get().getSeed(); if (seed == null) return; worldSeed = seed; oreConfig = Ore.getConfig(Seeds.get().getSeed().version); chunkRenderers.clear(); if (mc.world != null && worldSeed != null) { loadVisibleChunks(); }...
vuln
Vulnerable
Java
@Override public String prepareStagingFile() { final var name = prepareGcsStagingFile(); if (!gcsStagingFiles.contains(name)) { gcsStagingFiles.add(name); final var blobId = BlobId.of(gcsConfig.getBucketName(), name); final var blobInfo = BlobInfo.newBuilder(blobId).build(); final var ...
vuln
Safe
Java
// Dependencies const protocols = require("protocols") , isSsh = require("is-ssh") , qs = require("query-string") ; /** * parsePath * Parses the input url. * * @name parsePath * @function * @param {String} url The input url. * @return {Object} An object containing the following fields: * * - `pro...
vuln
Vulnerable
JavaScript
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1994 Linus Torvalds * * Cyrix stuff, June 1998 by: * - Rafael R. Reilova (moved everything from head.S), * <rreilova@ececs.uc.edu> * - Channing Corn (tests & fixes), * - Andrew D. Balsa (code cleanup). */ #include <linux/init.h> #include <linux/ut...
vuln
Vulnerable
C/C++
def create_sysadmin(): name = os.environ.get("CKAN_SYSADMIN_NAME") password = os.environ.get("CKAN_SYSADMIN_PASSWORD") email = os.environ.get("CKAN_SYSADMIN_EMAIL") if name and password and email: # Check if user exists command = ["ckan", "-c", ckan_ini, "user", "show", name] ...
vuln
Safe
Python
"""Core API v2 views.""" import logging from django.utils.html import escape from django.utils.translation import ugettext as _ from django.utils.datastructures import MultiValueDictKeyError from django.contrib.auth import login from drf_spectacular.utils import extend_schema from rest_framework import response, st...
vuln
Safe
Python
int SocketStream::DoBeforeConnect() { next_state_ = STATE_BEFORE_CONNECT_COMPLETE; if (!context_.get() || !context_->network_delegate()) { return OK; } int result = context_->network_delegate()->NotifyBeforeSocketStreamConnect( this, io_callback_); if (result != OK && result != ERR_IO_PENDING)...
vuln
Vulnerable
C/C++
private static Stream<Path> searchPotentialJavaExecutables() throws IOException { List<Stream<Path>> javaExecutables = new ArrayList<>(); switch (OperatingSystem.CURRENT_OS) { case WINDOWS: javaExecutables.add(queryJavaHomesInRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSo...
vuln
Vulnerable
Java
/* ** class.c - Class class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/hash.h> #include <mruby/class.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/string.h> #include <mruby/variable.h> #include <mruby/error.h> #include <mruby/data.h> #in...
vuln
Vulnerable
C/C++
void qmp_transaction(TransactionActionList *dev_list, Error **errp) { TransactionActionList *dev_entry = dev_list; BlkTransactionState *state, *next; Error *local_err = NULL; QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionState) snap_bdrv_states; QSIMPLEQ_INIT(&snap_bdrv_states); bdrv_drain_...
vuln
Vulnerable
C/C++
/* * demod_flex.c * * Copyright 2004,2006,2010 Free Software Foundation, Inc. * Copyright (C) 2015 Craig Shelley (craig@microtron.org.uk) * * FLEX Radio Paging Decoder - Adapted from GNURadio for use with Multimon * * GNU Radio is free software; you can redistribute it and/or modify * ...
vuln
Vulnerable
C/C++
static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt) { MvContext *mv = avctx->priv_data; AVIOContext *pb = avctx->pb; AVStream *st = avctx->streams[mv->stream_index]; const AVIndexEntry *index; int frame = mv->frame[mv->stream_index]; int ret; uint64_t pos; if (frame < st->nb...
vuln
Vulnerable
C/C++
static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowPCXException(severity,tag) \ { \ if (scanline != (unsigned char *) NULL) \ scanline=(unsigned char *) RelinquishMagickMemory(scanline); \ if (pixel_info != (MemoryInfo *) NULL) \ pixel_info=RelinquishVirtualMemor...
vuln
Safe
Unknown
ArgParser::handleArgFileArguments() { // Support reading arguments from files. Create a new argv. Ensure // that argv itself as well as all its contents are automatically // deleted by using PointerHolder objects to back the pointers in // argv. new_argv.push_back(PointerHolder<char>(true, QUtil::co...
vuln
Safe
Unknown
public function getHtmlForControlButtons() { $ret = ''; $cfgRelation = PMA_getRelationsParam(); if ($cfgRelation['navwork']) { $db = $this->realParent()->real_name; $item = $this->real_name; $ret = '<span class="navItemControls">' . '<a ...
vuln
Safe
PHP
void setup_protocol(int f_out,int f_in) { if (am_sender) file_extra_cnt += PTR_EXTRA_CNT; else file_extra_cnt++; if (preserve_uid) uid_ndx = ++file_extra_cnt; if (preserve_gid) gid_ndx = ++file_extra_cnt; if (preserve_acls && !am_sender) acls_ndx = ++file_extra_cnt; if (preserve_xattrs) xattrs_ndx = +...
vuln
Vulnerable
Unknown
static opj_bool pi_next_lrcp(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; long index = 0; if (!pi->first) { comp = &pi->comps[pi->compno]; res = &comp->resolutions[pi->resno]; goto LABEL_SKIP; } else { pi->first = 0; } ...
vuln
Safe
C/C++
filter_close (struct backend *b, struct connection *conn) { struct backend_filter *f = container_of (b, struct backend_filter, backend); void *handle = connection_get_handle (conn, f->backend.i); debug ("%s: close", f->name); if (handle && f->filter.close) f->filter.close (handle); f->backend.next->clos...
vuln
Vulnerable
Unknown
void AppListController::Init(Profile* initial_profile) { if (win8::IsSingleWindowMetroMode()) return; PrefService* prefs = g_browser_process->local_state(); if (prefs->HasPrefPath(prefs::kRestartWithAppList) && prefs->GetBoolean(prefs::kRestartWithAppList)) { prefs->SetBoolean(prefs::kRestartWithAp...
vuln
Safe
C/C++
@Override public void execute(LauncherAppState appState, BgDataModel dataModel, AllAppsList apps) { Set<ComponentKey> widgetsInWorkspace = dataModel.appWidgets.stream().map( widget -> new ComponentKey(widget.providerName, widget.user)).collect( Collectors.toSet()); Ma...
vuln
Safe
Java
static int 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(siz...
vuln
Safe
C/C++
c+";"))}}),mxUtils.bind(this,function(){var n=null;A.getModel().beginUpdate();try{n=A.insertVertex(A.getDefaultParent(),null,c,A.snap(e),A.snap(g),1,1,"text;"+(k?"html=1;":"")),A.updateCellSize(n),A.fireEvent(new mxEventObject("textInserted","cells",[n]))}finally{A.getModel().endUpdate()}A.setSelectionCell(n)}))}else{c...
vuln
Safe
JavaScript
PyObject *PyString_DecodeEscape(const char *s, Py_ssize_t len, const char *errors, Py_ssize_t unicode, const char *recode_encoding) { int c; char *p, *buf; const char *end; PyO...
vuln
Vulnerable
C/C++
static int ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base, struct fw_iso_packet *packet, struct fw_iso_buffer *buffer, unsigned long payload) { struct iso_context *ctx = container_of(base, struct iso_context, base); struct db_descriptor *db = NULL; struct descriptor *d; ...
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
Vulnerable
Java
import logging import operator import re import string import sys import typing import typing as t from datetime import date from datetime import datetime from datetime import timezone from itertools import chain from weakref import WeakKeyDictionary if t.TYPE_CHECKING: from _typeshed.wsgi import StartResponse ...
vuln
Safe
Python
private void planPartial(@Nonnull PlanContext context, @Nonnull Supplier<RelationalExpression> expressionSupplier) { currentRoot = GroupExpressionRef.of(expressionSupplier.get()); aliasResolver = AliasResolver.withRoot(currentRoot); Debugger.withDebugger(debugger -> PlannerGraphProperty.show(tru...
vuln
Vulnerable
Java
private void updateFields(boolean updateChat) { if (updateChat) { TLRPC.Chat chat = getMessagesController().getChat(chatId); if (chat != null) { currentChat = chat; } } boolean isPrivate = TextUtils.isEmpty(currentChat.username); if (h...
vuln
Vulnerable
Java
int obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) { PyObject* tmp = NULL; identifier arg; expr_ty value; if (exists_not_none(obj, &PyId_arg)) { int res; tmp = _PyObject_GetAttrId(obj, &PyId_arg); if (tmp == NULL) goto failed; res = obj2ast_identifier(tm...
vuln
Vulnerable
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
static int vc1_init_common(VC1Context *v) { static int done = 0; int i = 0; v->hrd_rate = v->hrd_buffer = NULL; if(!done) { done = 1; init_vlc(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, ff_vc1_bfraction_bits, 1, 1, ff_vc1_bfraction_codes...
vuln
Vulnerable
C/C++
private boolean removeTask(Task t, boolean removeFromSystem) { mOrganizedTasks.remove(t); mInterceptBackPressedOnRootTasks.remove(t.mTaskId); boolean taskAppearedSent = t.mTaskAppearedSent; if (taskAppearedSent) { if (t.getSurfaceControl() != null) { ...
vuln
Safe
Java
protected boolean goToNextPage() { if (activePagePosition >= pageItems.size() - 1) { return false; // last page } int newPosition = activePagePosition + 1; PageMenuItem pageItem = null; while (pageItem == null) { pageItem = pageItems.get(newPosition); newPosition++; if (newPosition >= pageItems...
vuln
Vulnerable
Java
package pluginproxy import ( "bytes" "errors" "fmt" "io/ioutil" "log" "net/http" "net/http/httputil" "net/url" "strconv" "strings" "time" "github.com/grafana/grafana/pkg/api/datasource" glog "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/p...
vuln
Safe
Go
__u32 secure_ip_id(__be32 daddr)
vuln
Safe
C/C++
@Override public long archiveFolder(long folderId, String comment) throws ServerException { Session session = validateSession(getThreadLocalRequest()); DocumentManager manager = (DocumentManager) Context.get().getBean(DocumentManager.class); DocumentHistory transaction = new DocumentHistory(); transaction.set...
vuln
Safe
Java
static inline void vmsvga_update_rect(struct vmsvga_state_s *s, int x, int y, int w, int h) { DisplaySurface *surface = qemu_console_surface(s->vga.con); int line; int bypl; int width; int start; uint8_t *src; uint8_t *dst; if (x < 0) { fprin...
vuln
Vulnerable
C/C++
@Override public boolean receiveEntity(Entity entity, Vec3d relativePos, EulerAngle relativeAngle, Vec3d relativeVelocity) { BlockPos teleportPos = entity.getBlockPos(); while(ModDimensions.LIMBO_DIMENSION.getBlockState(VirtualLocation.getTopPos(ModDimensions.LIMBO_DIMENSION, teleportPos)).getBlock() == ModBlocks....
vuln
Vulnerable
Java
int nfc_dev_up(struct nfc_dev *dev) { int rc = 0; pr_debug("dev_name=%s\n", dev_name(&dev->dev)); device_lock(&dev->dev); if (dev->shutting_down) { rc = -ENODEV; goto error; } if (dev->rfkill && rfkill_blocked(dev->rfkill)) { rc = -ERFKILL; goto error; } if (dev->fw_download_in_progress) { rc = -...
vuln
Safe
Unknown
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt( const SaplingEncCiphertext &ciphertext, const uint256 &epk, const uint256 &esk, const uint256 &pk_d, const uint256 &cmu ) { auto pt = AttemptSaplingEncDecryption(ciphertext, epk, esk, pk_d); if (!pt) { return boost:...
vuln
Vulnerable
C/C++
function ecrecover(recId, sigr, sigs, message) { assert(recId >= 0 && recId <= 3, "recId must be 0..3") assert(sigr != 0, "sigr must not be 0") assert(sigs != 0, "sigs must not be 0") // 1.0 For j from 0 to h (h == recId here and the loop is outside this function) // 1.1 Let ...
vuln
Safe
JavaScript
public void removePopupFromView() { // wrap in try-catch since it could sometimes generate errors randomly try { if (popupHasParent()) { windowManager.removeView(binding.getRoot()); } } catch (final IllegalArgumentException e) { Log.w(TAG, "Fai...
vuln
Safe
Java
const char *cpu_parse_cpu_model(const char *typename, const char *cpu_model) { ObjectClass *oc; CPUClass *cc; Error *err = NULL; gchar **model_pieces; const char *cpu_type; model_pieces = g_strsplit(cpu_model, ",", 2); oc = cpu_class_by_name(typename, model_pieces[0]); if (oc == NULL) { ...
vuln
Vulnerable
C/C++
public void autoBuild(EntityPlayer player, MultiblockControllerBase controllerBase) { World world = player.world; BlockWorldState worldState = new BlockWorldState(); int minZ = -centerOffset[4]; EnumFacing facing = controllerBase.getFrontFacing().getOpposite(); BlockPos centerPos...
vuln
Safe
Java
static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y, const uint8_t *src, int src_size) { int width, height; int hdr, zsize, npal, tidx = -1, ret; int i, j; const uint8_t *src_end = src + src_size; uint8_t pal[768], transp[3]; uLongf dlen = (c->tile_wid...
vuln
Vulnerable
C/C++
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 * th...
vuln
Vulnerable
Java
@Override public int getSlotLimit(int slot) { return call(i -> i.getSlotLimit(slot), 0); }
vuln
Vulnerable
Java
/* * Copyright(C) 2015 Linaro Limited. All rights reserved. * Author: Mathieu Poirier <mathieu.poirier@linaro.org> * * 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. * * This pr...
vuln
Safe
C/C++
void OPPROTO op_POWER_doz (void) { if ((int32_t)T1 > (int32_t)T0) T0 = T1 - T0; else T0 = 0; RETURN(); }
vuln
Safe
C/C++
var li = document.createElement('li') var a = document.createElement('a') a.textContent = 'Recently Viewed' li.appendChild(a) li.dataset.tab = 'recent' document.querySelector('ul#tabs').lastChild.className = '' li.className = 'last' document.querySelector('ul#tabs').appendChild(li) li.onclick = function() { getR...
vuln
Safe
JavaScript
void sock_release(struct socket *sock) static void __sock_release(struct socket *sock, struct inode *inode) { if (sock->ops) { struct module *owner = sock->ops->owner; if (inode) inode_lock(inode); sock->ops->release(sock); if (inode) inode_unlock(inode); sock->ops = NULL; module_put(owner); ...
vuln
Safe
C/C++
TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir) { static const char module[] = "TIFFWriteDirectoryTagTransferfunction"; uint32 m; uint16 n; uint16* o; int p; if (dir==NULL) { (*ndir)++; return(1); } m=(1<<tif->tif_dir.td_bitspersample); n=tif->tif_dir.td_samplesperpixel-t...
vuln
Safe
C/C++
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
vuln
Safe
Java
@Environment(value = EnvType.CLIENT) @Override public Rectangle3f getRenderBoundingBox(BlockState state) { BakedSkin bakedSkin = BakedSkin.of(getDescriptor()); if (bakedSkin == null) { return null; } float f = 1 / 16f; Rectangle3f box = bakedSkin.getRenderBoun...
vuln
Safe
Java
ImagingNew(const char* mode, int xsize, int ysize) { int bytes; Imaging im; if (strlen(mode) == 1) { if (mode[0] == 'F' || mode[0] == 'I') bytes = 4; else bytes = 1; } else bytes = strlen(mode); /* close enough */ if (xsize < 0 || ysize < 0) { ...
vuln
Safe
C/C++
krb5_gss_inquire_sec_context_by_oid (OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_OID desired_object, gss_buffer_set_t *data_set) { krb5_gss_ctx_id_rec *ctx; size_t i; if ...
vuln
Safe
C/C++
void monitor_flush(Monitor *mon) { int rc; size_t len; const char *buf; if (mon->skip_flush) { return; } buf = qstring_get_str(mon->outbuf); len = qstring_get_length(mon->outbuf); if (len && !mon->mux_out) { rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len); ...
vuln
Vulnerable
C/C++
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { int ret=0; int top,al,bl; BIGNUM *rr; #if defined(BN_MUL_COMBA) || defined(BN_RECURSION) int i; #endif #ifdef BN_RECURSION BIGNUM *t=NULL; int j=0,k; #endif #ifdef BN_COUNT fprintf(stderr,"BN_mul %d * %d\n",a->top,b->top); #endif bn_check...
vuln
Vulnerable
Unknown
WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, const int argc,const char **argv,Image **images,ExceptionInfo *exception) { ChannelType channel; const char *option; ImageInfo *mogrify_info; MagickStatusType status; QuantizeInfo *quantize_info; register ssize_t...
vuln
Safe
C/C++
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, plane, tm...
vuln
Vulnerable
Unknown
public static File[] convertPdf2Png(File inputPdfFile) throws IOException { return PdfBoxUtilities.convertPdf2Png(inputPdfFile); }
vuln
Safe
Java
@Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ComposterBlock;extractProduce(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;")) public void beforeCollect(BlockState state, World world, BlockPos pos, Pla...
vuln
Vulnerable
Java
static struct tevent_req *dns_process_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct dns_server *dns, DATA_BLOB *in) { struct tevent_req *req, *subreq; struct dns_process_state *state; enum ndr_err_code ndr_err; WERROR ret; const char *forwarder = lpcfg_dns_forwarder(dns->task-...
vuln
Safe
Unknown
static int epass2003_sm_unwrap_apdu(struct sc_card *card, struct sc_apdu *sm, struct sc_apdu *plain) { int r; size_t len = 0; epass2003_exdata *exdata = NULL; if (!card->drv_data) return SC_ERROR_INVALID_ARGUMENTS; exdata = (epass2003_exdata *)card->drv_data; LOG_FUNC_CALLED(card->ctx); r = sc_check_sw(ca...
vuln
Vulnerable
C/C++
Object *object_dynamic_cast(Object *obj, const char *typename) { if (object_class_dynamic_cast(object_get_class(obj), typename)) { return obj; } return NULL; }
vuln
Vulnerable
C/C++
negotiate_handshake_newstyle_options (struct connection *conn) { struct new_option new_option; size_t nr_options; uint64_t version; uint32_t option; uint32_t optlen; char data[MAX_OPTION_LENGTH+1]; struct new_handshake_finish handshake_finish; const char *optname; for (nr_options = 0; nr_options < MA...
vuln
Vulnerable
Unknown
def _update_run_single(self, run: Run) -> None: """Update a run.""" self.client.update_run(run.id, **run.dict())
vuln
Vulnerable
Python
static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id) { VirtIOSerial *s = opaque; VirtIOSerialPort *port; uint32_t max_nr_ports, nr_active_ports, ports_map; unsigned int i; if (version_id > 3) { virtio_load(&s->vdev, f); if (version_id < 2) { return 0; ...
vuln
Vulnerable
C/C++
import json import typing from http import cookies as http_cookies import anyio from starlette._utils import AwaitableOrContextManager, AwaitableOrContextManagerWrapper from starlette.datastructures import URL, Address, FormData, Headers, QueryParams, State from starlette.exceptions import HTTPException from starlett...
vuln
Safe
Python
public static CompletableFuture<PositionImpl> publishMessages(Message<byte[]> message, Topic topic) { CompletableFuture<PositionImpl> future = new CompletableFuture<>(); ByteBuf headerAndPayload = messageToByteBuf(message); topic.publishMessage(headerAndPayload, MessagePublishCo...
vuln
Vulnerable
Java
TfLiteStatus ResizeOutput(TfLiteContext* context, const TfLiteTensor* input, const TfLiteTensor* axis, TfLiteTensor* output) { int axis_value; // Retrive all 8 bytes when axis type is kTfLiteInt64 to avoid data loss. if (axis->type == kTfLiteInt64) { axis_value = static_cast<int>(*Ge...
vuln
Safe
C/C++
MagickExport Image *AcquireImage(const ImageInfo *image_info) { const char *option; Image *image; MagickStatusType flags; /* Allocate image structure. */ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); image=(Image *) AcquireCriticalMemory(sizeof(*image)); (void) memset(ima...
vuln
Safe
C/C++
fn parse_quoted_text(input: &str) -> Result<Cow<'_, str>, ParseErrorKind> { Ok(match input.as_bytes()[0] { b'"' => { let mut s = strip_first_last(input); let mut buf = String::new(); loop { let mut chars = s.chars(); let char_len; ...
vuln
Safe
Rust
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e, struct xt_table_info *newinfo, unsigned int *size, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, const char *name) { struct xt_entry_target...
vuln
Vulnerable
C/C++
fmtfp(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, LDOUBLE fvalue, int min, int max, int flags) { int signvalue = 0; LDOUBLE ufvalue; char iconvert[20]; char fconvert[20]; int iplace = 0; int fplace = 0; int padlen = 0; int zpadlen = 0; long intpa...
vuln
Vulnerable
Unknown
private IFluidHandler createHandlerForCap() { return this.isController() ? this.fluid : this.getControllerTE().createHandlerForCap(); }
vuln
Vulnerable
Java
public void write(PrintWriter pw) throws IOException { pw.println(COMMENT + " " + "dumped by " + getClass().getSimpleName()); pw.println(COMMENT + " " + BEGIN_MARKER); if (getUrls() != null) { for (final String url : getUrls()) { pw.println(url); for(f...
vuln
Safe
Java
get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading text-format PPM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr) sinfo; FILE * infile = source->pub.input_file; register JSAMPROW ptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; ...
vuln
Safe
Unknown
static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt) { int packet_size, ret, width, height; AVStream *st = s->streams[0]; width = st->codec->width; height = st->codec->height; packet_size = avpicture_get_size(st->codec->pix_fmt, width, height); if (packet_size < 0) return -...
vuln
Safe
C/C++
PHP_METHOD(Phar, delete) { char *fname; size_t fname_len; char *error; phar_entry_info *entry; PHAR_ARCHIVE_OBJECT(); if (PHAR_G(readonly) && !phar_obj->archive->is_data) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Cannot write out phar archive, phar is read-only"); return...
vuln
Safe
C/C++
String_Obj Parser::parse_url_function_argument() { const char* p = position; std::string uri(""); if (lex< real_uri_value >(false)) { uri = lexed.to_string(); } if (peek< exactly< hash_lbrace > >()) { const char* pp = position; // TODO: error checking for unclosed interpolants ...
vuln
Vulnerable
C/C++
ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf, struct sdr_record_eventonly_sensor *sensor) { char desc[17]; if (!sensor) return -1; memset(desc, 0, sizeof (desc)); snprintf(desc, sizeof(desc), "%.*s", (sensor->id_code & 0x1f) + 1, sensor->id_string); if (verbose) { printf("Sensor ID ...
vuln
Safe
Unknown
def verify_rno(self, rno): self.cursor.execute("SELECT COUNT(rno) FROM rides WHERE rno = :rno", {'rno': rno}) result = self.cursor.fetchone() if (int(result[0]) > 0): return True else: return False
vuln
Safe
Python
jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t *p_header_size) { Jbig2Segment *result; uint8_t rtscarf; uint32_t rtscarf_long; uint32_t *referred_to_segments; uint32_t referred_to_segment_count; uint32_t referred_to_segment_size; uint32_t pa_size; uint...
vuln
Safe
C/C++
(function() { // Adds Lean Mapping shapes Sidebar.prototype.addLeanMappingPalette = function() { var w = 100; var h = 100; var s = mxConstants.STYLE_STROKEWIDTH + '=2;html=1;shape=mxgraph.lean_mapping.'; var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;html=1;' + mxConstants.STYLE_VERTICAL_ALIGN...
vuln
Vulnerable
Java
def parse_type_line(type_line, rcb, loc): """Parses a type annotation specified as a comment. Example inputs: # type: (Tensor, torch.Tensor) -> Tuple[Tensor] # type: (Tensor, Tuple[Tensor, Tensor]) -> Tensor """ arg_ann_str, ret_ann_str = split_type_line(type_line) try: arg...
vuln
Safe
Python
private List<Component> buildMiddleTooltip(IdentificationPresentationStyle style) { List<ItemIdentificationContainer> idContainers = gearItem.getIdContainers(); List<GearIdentification> identifications = gearItem.getIdentifications(); if (idContainers.isEmpty()) { return List.of(); ...
vuln
Vulnerable
Java
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- modul...
vuln
Vulnerable
C/C++
static int udp_push_pending_frames(struct sock *sk) int udp_push_pending_frames(struct sock *sk) { struct udp_sock *up = udp_sk(sk); struct inet_sock *inet = inet_sk(sk); struct flowi4 *fl4 = &inet->cork.fl.u.ip4; struct sk_buff *skb; int err = 0; skb = ip_finish_skb(sk, fl4); if (!skb) goto out; err = ...
vuln
Safe
C/C++
nma_gconf_connection_changed (NMAGConfConnection *self) { NMAGConfConnectionPrivate *priv; GHashTable *settings; NMConnection *wrapped_connection; NMConnection *gconf_connection; GHashTable *new_settings; GError *error = NULL; g_return_val_if_fail (NMA_IS_GCONF_CONNECTION (self), FALSE); priv = NMA_GCONF_CONN...
vuln
Safe
Unknown
static int neightbl_fill_info(struct neigh_table *tbl, struct sk_buff *skb, struct netlink_callback *cb) { struct nlmsghdr *nlh; struct ndtmsg *ndtmsg; nlh = NLMSG_NEW_ANSWER(skb, cb, RTM_NEWNEIGHTBL, sizeof(struct ndtmsg), NLM_F_MULTI); ndtmsg = NLMSG_DATA(nlh); read_lock_bh(&tbl->lock); nd...
vuln
Vulnerable
Unknown
Pl_Count::write(unsigned char* buf, size_t len) { if (len) { this->count += len; getNext()->write(buf, len); this->last_char = buf[len - 1]; } }
vuln
Vulnerable
Unknown
static ssize_t _epoll_writev( oe_fd_t* desc, const struct oe_iovec* iov, int iovcnt) { ssize_t ret = -1; epoll_t* file = _cast_epoll(desc); void* buf = NULL; size_t buf_size = 0; size_t data_size = 0; if (!file || (iovcnt && !iov) || iovcnt < 0 || iovcnt > OE_IOV_MAX) OE_RAI...
vuln
Safe
Unknown
amgtar_selfcheck( application_argument_t *argument) { char *option; if (argument->dle.disk) { delete_message(print_message(build_message( AMANDA_FILE, __LINE__, 3700000, MSG_INFO, 3, "disk", argument->dle.disk, "device", argument->dle.device, "hostname", argument->host))); } delete_me...
vuln
Safe
Unknown
fep_client_open (const char *address) { FepClient *client; struct sockaddr_un sun; ssize_t sun_len; int retval; if (!address) address = getenv ("LIBFEP_CONTROL_SOCK"); if (!address) return NULL; if (strlen (address) + 1 >= sizeof(sun.sun_path)) { fep_log (FEP_LOG_LEVEL_WARNING, ...
vuln
Vulnerable
Unknown
/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions ...
vuln
Safe
C/C++
private void processSyncTasks() { /* * Synchronous tasks should only ever be processed on the * main Thread. Never on any other one. */ if (!Bukkit.isPrimaryThread()) { return; } /* * Let's not lag the main thread. * Spikes suck. ...
vuln
Safe
Java
static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, u32 val, ktime_t *abs_time, u32 bitset, u32 __user *uaddr2) { struct hrtimer_sleeper timeout, *to = NULL; struct rt_mutex_waiter rt_waiter; struct rt_mutex *pi_mutex = NULL; struct futex_hash_bucket *hb; union futex_key key2 = FUTEX_...
vuln
Safe
C/C++