code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
int meth_post(struct transaction_t *txn, void *params) { struct meth_params *pparams = (struct meth_params *) params; struct strlist *action; int r, ret; size_t len; /* Response should not be cached */ txn->flags.cc |= CC_NOCACHE; /* Parse the path */ r = dav_parse_req_target(txn, ppar...
vuln
Vulnerable
Unknown
read_children(struct archive_read *a, struct file_info *parent) { struct iso9660 *iso9660; const unsigned char *b, *p; struct file_info *multi; size_t step, skip_size; iso9660 = (struct iso9660 *)(a->format->data); /* flush any remaining bytes from the last round to ensure * we're positioned */ if (iso9660->e...
vuln
Safe
Unknown
static ssize_t _epoll_read(oe_fd_t* epoll_, void* buf, size_t count) { ssize_t ret = -1; epoll_t* file = _cast_epoll(epoll_); oe_errno = 0; /* * According to the POSIX specification, when the count is greater * than SSIZE_MAX, the result is implementation-defined. OE raises an * error i...
vuln
Safe
Unknown
static struct db_arg_chain_tree *_db_node_get(struct db_arg_chain_tree *node) { if (node != NULL) node->refcnt++; return node; }
vuln
Safe
Unknown
static int iwgif_read_image(struct iwgifrcontext *rctx) { int retval=0; struct lzwdeccontext d; size_t subblocksize; int has_local_ct; int local_ct_size; unsigned int root_codesize; if(!iwgif_read(rctx,rctx->rbuf,9)) goto done; rctx->image_left = (int)iw_get_ui16le(&rctx->rbuf[0]); rctx->image_top = (int)iw...
vuln
Vulnerable
Unknown
def resource_status(params, request, session) if not allowed_for_local_cluster(session, Permissions::READ) return 403, 'Permission denied' end resource_id = params[:resource] @resources,@groups = getResourcesGroups(session) location = "" res_status = "" @resources.each {|r| if r.id == resource_id ...
vuln
Vulnerable
Ruby
print_syscall_ret_addr(const struct syscallname *name, abi_long ret) { char *errstr = NULL; if (ret == -1) { errstr = target_strerror(errno); } if ((ret == -1) && errstr) { gemu_log(" = -1 errno=%d (%s)\n", errno, errstr); } else { gemu_log(" = 0x" TARGET_ABI_FMT_lx "\n", ret...
vuln
Vulnerable
C/C++
static int rd_build_device_space(struct rd_dev *rd_dev) { struct rd_dev_sg_table *sg_table; u32 sg_tables, total_sg_needed; u32 max_sg_per_table = (RD_MAX_ALLOCATION_SIZE / sizeof(struct scatterlist)); int rc; if (rd_dev->rd_page_count <= 0) { pr_err("Illegal page count: %u for Ramdisk device\n", r...
vuln
Safe
Unknown
static int snd_pcm_control_ioctl(struct snd_card *card, struct snd_ctl_file *control, unsigned int cmd, unsigned long arg) { switch (cmd) { case SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE: { int device; if (get_user(device, (int __user *)arg)) return -EFAULT; mutex_lock(&register_mutex); device = sn...
vuln
Vulnerable
C/C++
void kvm_mmu_invpcid_gva(struct kvm_vcpu *vcpu, gva_t gva, unsigned long pcid) { struct kvm_mmu *mmu = vcpu->arch.mmu; bool tlb_flush = false; uint i; if (pcid == kvm_get_active_pcid(vcpu)) { if (mmu->invlpg) mmu->invlpg(vcpu, gva, mmu->root.hpa); tlb_flush = true; } for (i = 0; i < KVM_MMU_NUM_PREV_ROOT...
vuln
Safe
C/C++
static void uart_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { CadenceUARTState *s = opaque; DB_PRINT(" offset:%x data:%08x\n", (unsigned)offset, (unsigned)value); offset >>= 2; switch (offset) { case R_IER: s->r[R_IMR] |= value; break...
vuln
Vulnerable
C/C++
function w(){var e=a(),n=E(e);if(c=arguments,u=this,d=e,n){if(void 0===f)return b(d);if(v)return clearTimeout(f),f=setTimeout(x,t),y(d)}return void 0===f&&(f=setTimeout(x,t)),p}
vuln
Vulnerable
JavaScript
/* This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) * Copyright (C) 2012-2019 mutschler, janeczku, jkrehm, OzzieIsaacs * * 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 Soft...
vuln
Vulnerable
Python
static int vdi_create(const char *filename, QEMUOptionParameter *options, Error **errp) { int fd; int result = 0; uint64_t bytes = 0; uint32_t blocks; size_t block_size = DEFAULT_CLUSTER_SIZE; uint32_t image_type = VDI_TYPE_DYNAMIC; VdiHeader header; size_t i; s...
vuln
Safe
Unknown
static char *userauth_list(LIBSSH2_SESSION *session, const char *username, unsigned int username_len) { static const unsigned char reply_codes[3] = { SSH_MSG_USERAUTH_SUCCESS, SSH_MSG_USERAUTH_FAILURE, 0 }; /* packet_type(1) + username_len(4) + service_len(4) + service(...
vuln
Vulnerable
Unknown
#include "cache.h" #include "config.h" #include "commit.h" #include "utf8.h" #include "diff.h" #include "revision.h" #include "string-list.h" #include "mailmap.h" #include "log-tree.h" #include "notes.h" #include "color.h" #include "reflog-walk.h" #include "gpg-interface.h" #include "trailer.h" #include "run-command.h"...
vuln
Vulnerable
C/C++
public static synchronized void initThreads(int count) { if (count <= 0) throw new IllegalArgumentException("count has to be at least equal or greater than one"); if (THREADS != null) { for (RenderingThread thread : THREADS) if (thread != null) ...
vuln
Safe
Java
static js_Ast *logand(js_State *J, int notin) { js_Ast *a = bitor(J, notin); if (jsP_accept(J, TK_AND)) a = EXP2(LOGAND, a, logand(J, notin)); return a; }
vuln
Vulnerable
Unknown
const SegmentCommand* Binary::segment_from_offset(uint64_t offset) const { if (offset_seg_.empty()) { return nullptr; } const auto it_begin = std::begin(offset_seg_); if (offset < it_begin->first) { return nullptr; } auto it = offset_seg_.lower_bound(offset); if (it->first == offset || it == it_...
vuln
Safe
Unknown
package hamt import ( "context" "fmt" bitfield "github.com/ipfs/go-bitfield" "github.com/ipfs/go-unixfsnode/data" "github.com/ipfs/go-unixfsnode/iter" dagpb "github.com/ipld/go-codec-dagpb" "github.com/ipld/go-ipld-prime" "github.com/ipld/go-ipld-prime/schema" ) const ( // HashMurmur3 is the multiformats id...
vuln
Vulnerable
Go
int ff_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, int max_size) { uint32_t mrk; int i, tmp; const uint16_t *ssrc = (const uint16_t *) src; uint16_t *sdst = (uint16_t *) dst; PutBitContext pb; if ((unsigned) src_size > (unsigned) max_size) ...
vuln
Vulnerable
C/C++
package service import ( "context" "encoding/json" "net/http" "github.com/go-kit/kit/endpoint" kitlog "github.com/go-kit/kit/log" "github.com/igm/sockjs-go/v3/sockjs" "github.com/fleetdm/fleet/server/contexts/viewer" "github.com/fleetdm/fleet/server/kolide" "github.com/fleetdm/fleet/server/websocket" ) ////...
vuln
Vulnerable
Go
static int parse_icy(HTTPContext *s, const char *tag, const char *p) { int len = 4 + strlen(p) + strlen(tag); int is_first = !s->icy_metadata_headers; int ret; if (s->icy_metadata_headers) len += strlen(s->icy_metadata_headers); if ((ret = av_reallocp(&s->icy_metadata_headers, len)) < 0) ...
vuln
Safe
C/C++
function renderSelectTemplates(formElement, template) { var appendMultiValue, defaultValue, multiValueTemplateContent, propertyPath, propertyValue; multiValueTemplateContent = $( getHelper().getDomElementDataIdentifierSelector('multiValueContainer'), $(template) ).clone(); $(get...
vuln
Safe
JavaScript
sixel_dither_new( sixel_dither_t /* out */ **ppdither, /* dither object to be created */ int /* in */ ncolors, /* required colors */ sixel_allocator_t /* in */ *allocator) /* allocator, null if you use default allocator */ { SIXELSTATU...
vuln
Vulnerable
C/C++
static BROTLI_INLINE uint32_t GetInsertExtra(uint16_t inscode) { return kBrotliInsExtra[inscode]; }
vuln
Safe
Unknown
Status ConstantFolding::IsSimplifiableReshape( const NodeDef& node, const GraphProperties& properties) const { if (!IsReshape(node)) { return errors::Internal("Node ", node.name(), " is not a Reshape node"); } if (2 > node.input_size()) { return errors::Internal("Node ", node.name(), ...
vuln
Safe
C/C++
def from_FunctionDef( cls, node: vy_ast.FunctionDef, is_interface: Optional[bool] = False ) -> "ContractFunctionT": """ Generate a `ContractFunctionT` object from a `FunctionDef` node. Arguments --------- node : FunctionDef Vyper ast node to generate the ...
vuln
Vulnerable
Python
/* * * * Copyright (c) 2016. David Sowerby * * * * 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 la...
vuln
Safe
Java
public static void setup() { ClientRegistry.bindTileEntityRenderer(DeferredRegisters.TILE_ADVANCEDSOLARPANEL.get(), RenderAdvancedSolarPanel::new); ClientRegistry.bindTileEntityRenderer(DeferredRegisters.TILE_BATTERYBOX.get(), RenderBatteryBox::new); ClientRegistry.bindTileEntityRenderer(DeferredRegisters.TILE_LITHI...
vuln
Safe
Java
package api import ( "context" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" "net/url" "os" "path" "path/filepath" "sort" "strings" "sync" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" "github.c...
vuln
Vulnerable
Go
@Override public void writeToBuffer(ByteBuf buf){ super.writeToBuffer(buf); if(linkedID != null){ buf.writeBoolean(true); writeUUIDToBuffer(linkedID, buf); buf.writeBoolean(connect); }else{ buf.writeBoolean(false); } writePoint3dToBuffer(partOffset, buf); }
vuln
Safe
Java
int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, unsigned int hdr_off, unsigned int sg, unsigned int off) { struct rds_ib_connection *ic = conn->c_transport_data; struct ib_device *dev = ic->i_cm_id->device; struct rds_ib_send_work *send = NULL; struct rds_ib_send_work *first; struct rds_ib_s...
vuln
Vulnerable
Unknown
int64_t ff_ape_parse_tag(AVFormatContext *s) { AVIOContext *pb = s->pb; int file_size = avio_size(pb); uint32_t val, fields, tag_bytes; uint8_t buf[8]; int64_t tag_start; int i; if (file_size < APE_TAG_FOOTER_BYTES) return 0; avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_S...
vuln
Vulnerable
C/C++
def verify_email(self, member): query = "SELECT COUNT(email) FROM members WHERE email = '{email}'".format(email = member) self.cursor.execute(query) result = self.cursor.fetchone() if (int(result[0]) > 0): return True else: return False
vuln
Vulnerable
Python
void DelayedExecutor::delayedExecute(const QString &udi) { Solid::Device device(udi); QString exec = m_service.exec(); MacroExpander mx(device); mx.expandMacrosShellQuote(exec); KRun::runCommand(exec, QString(), m_service.icon(), 0); deleteLater(); }
vuln
Safe
Unknown
int main(void) { int fd, len, sock_opt; int error; struct cn_msg *message; struct pollfd pfd; struct nlmsghdr *incoming_msg; struct cn_msg *incoming_cn_msg; struct hv_kvp_msg *hv_msg; char *p; char *key_value; char *key_name; daemon(1, 0); openlog("KVP", 0, LOG_USER); syslog(LOG_INFO, "KVP starting; pid i...
vuln
Safe
C/C++
public static void execute() { Global.getLogger(StartSetupPostTimePass.class).info("Running start setup post time pass"); SectorAPI sector = Global.getSector(); if (Global.getSector().isInNewGameAdvance()) return; if (!TutorialMissionIntel.isTutorialInProgress()) VanillaSystemsGenerator.exerelinEndGalati...
vuln
Vulnerable
Java
static void process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof) { int i; int repeating = 0; AVPacket avpkt; if (ist->next_dts == AV_NOPTS_VALUE) ist->next_dts = ist->last_dts; if (!pkt) { av_init_packet(&avpkt); avpkt.data = NULL; avpkt.si...
vuln
Vulnerable
C/C++
const MarkdownIt = require('markdown-it'); const Entities = require('html-entities').AllHtmlEntities; const htmlentities = (new Entities()).encode; const Resource = require('lib/models/Resource.js'); const ModelCache = require('lib/ModelCache'); const ObjectUtils = require('lib/ObjectUtils'); const { shim } = require('...
vuln
Safe
JavaScript
WRITE_JSON_ELEMENT(ArrStart) { /* increase depth, save: before first array entry no comma needed. */ ctx->commaNeeded[++ctx->depth] = false; return writeChar(ctx, '['); }
vuln
Vulnerable
Unknown
static int nc_uri(ASN1_IA5STRING *uri, ASN1_IA5STRING *base) { const char *baseptr = (char *)base->data; const char *hostptr = (char *)uri->data; const char *p = ia5memchr(uri, (char *)uri->data, ':'); int hostlen; /* Check for foo:// and skip past it */ if (p == NULL || IA5_OFFSET_...
vuln
Safe
Unknown
""" Functionality for dealing with dbkeys. """ #dbkeys read from disk using builds.txt from galaxy.util import read_dbnames from galaxy.util.json import loads import os.path class GenomeBuilds( object ): default_value = "?" default_name = "unspecified (?)" def __init__( self, app, data_table_name="__dbke...
vuln
Vulnerable
Python
/**************************************** * Computer Algebra System SINGULAR * ****************************************/ /* * ABSTRACT: Singular debugger */ #include "kernel/mod2.h" #include "omalloc/omalloc.h" #include "misc/options.h" #include "reporter/si_signals.h" #include "Singular/tok.h" #include "Singular...
vuln
Safe
C/C++
static int ffm_write_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; ByteIOContext *pb = s->pb; AVCodecContext *codec; int bit_rate, i; ffm->packet_size = FFM_PACKET_SIZE; put_le32(pb, MKTAG('F', 'F', 'M', '1')); put_be32(pb, ffm->packet_size); pu...
vuln
Vulnerable
C/C++
asn1_get_packed( unsigned char **buffer, /* IO - Pointer in buffer */ unsigned char *bufend) /* I - End of buffer */ { int value; /* Value */ if (*buffer >= bufend) return (0); value = 0; while (*buffer < bufend && (**buffer & 128)) { value = (value << 7) | (**buffer & 127); (*bu...
vuln
Safe
Unknown
package action import ( "context" "image/color" "strings" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/schema" "github.com/mojocn/base64Captcha" "github.com/segmentfault/pacman/errors" "github.com/segmentfault/pacman/log" ) // CaptchaRepo captcha repository type Ca...
vuln
Vulnerable
Go
static MagickPixelPacket **AcquirePixelThreadSet(const Image *image) { MagickPixelPacket **pixels; register ssize_t i, j; size_t number_threads; number_threads=(size_t) GetMagickResourceLimit(ThreadResource); pixels=(MagickPixelPacket **) AcquireQuantumMemory(number_threads, s...
vuln
Vulnerable
C/C++
@Override public void callSessionUpdateFailed(ImsReasonInfo reasonInfo) { if (mListener != null) { TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionUpdateFailed(ImsCallSession.this, reasonInfo), mListenerExecutor); ...
vuln
Vulnerable
Java
public int getSize(){ return Try.of(()->(int)getFieldsMeta().get(SIZE_META_KEY.key())).getOrElse(0); }
vuln
Vulnerable
Java
enum ImapAuthRes imap_auth_gss(struct ImapData *idata, const char *method) { gss_buffer_desc request_buf, send_token; gss_buffer_t sec_token; gss_name_t target_name; gss_ctx_id_t context; gss_OID mech_name; char server_conf_flags; gss_qop_t quality; int cflags; OM_uint32 maj_stat, min_stat; char buf...
vuln
Safe
C/C++
render() { const { isFetching, isLoggedIn, profile, superEdges, entityCount, messagesConnect, heartValue, heartCount, links, title, queryLink, isParsed, } = this.props; const { connectionDisplayIndex, isAddConnectionToggle...
vuln
Safe
JavaScript
void ShowExtensionInstallDialogImpl( ExtensionInstallPromptShowParams* show_params, ExtensionInstallPrompt::Delegate* delegate, scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); ExtensionInstallDialogView* dialog = new ExtensionInstallDialogVi...
vuln
Vulnerable
C/C++
public void setOnTuneEventListener(@NonNull @CallbackExecutor Executor executor, @NonNull OnTuneEventListener eventListener) { mOnTuneEventListener = eventListener; mOnTunerEventExecutor = executor; }
vuln
Vulnerable
Java
*/ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj) { /* OBJECTS_FIXME */ zval **ent, *fname, **varname; zval *retval = NULL; const char *key; ulong idx; char tmp_buf[WDDX_BUF_LEN]; HashTable *objhash, *sleephash; TSRMLS_FETCH(); MAKE_STD_ZVAL(fname); ZVAL_STRING(fname, "__sleep", 1); /...
vuln
Vulnerable
Unknown
private void processNewClientHello(final Record record) { InetSocketAddress peerAddress = record.getPeerAddress(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Processing new CLIENT_HELLO from peer [{}]:{}{}", StringUtil.toLog(peerAddress), StringUtil.lineSeparator(), record); } try { // CLIENT_HELLO...
vuln
Safe
Java
rend_decrypt_introduction_points(char **ipos_decrypted, size_t *ipos_decrypted_size, const char *descriptor_cookie, const char *ipos_encrypted, size_t ipos_encrypted_size) { tor_assert(i...
vuln
Safe
Unknown
static CharDriverState *qemu_chr_open_tty(QemuOpts *opts) { const char *filename = qemu_opt_get(opts, "path"); CharDriverState *chr; int fd; TFR(fd = open(filename, O_RDWR | O_NONBLOCK)); if (fd < 0) { return NULL; } tty_serial_init(fd, 115200, 'N', 8, 1); chr = qemu_chr_open_fd(...
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
int ssl3_send_client_key_exchange(SSL *s) { unsigned char *p,*d; int n; unsigned long l; #ifndef OPENSSL_NO_RSA unsigned char *q; EVP_PKEY *pkey=NULL; #endif #ifndef OPENSSL_NO_KRB5 KSSL_ERR kssl_err; #endif /* OPENSSL_NO_KRB5 */ #ifndef OPENSSL_NO_ECDH EC_KEY *clnt_ecdh = NULL; const EC_POINT *srvr_ecpoint = ...
vuln
Safe
Unknown
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) { char colorspace[MaxTextExtent], text[MaxTextExtent]; Image *image; IndexPacket *indexes; long type, x_offset, y, y_offset; MagickBooleanType status; MagickPixelPacket pixel; Qua...
vuln
Vulnerable
C/C++
DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, fsec_t *fsec, int *is2digits) { char *cp; /* * Have a decimal point? Then this is a date or something with a seconds * field... */ if ((cp = strchr(str, '.')) != NULL) { #ifdef HAVE_INT64_TIMESTAMP char fstr[7]; int...
vuln
Safe
C/C++
parallel_ioport_write_sw(void *opaque, uint32_t addr, uint32_t val) { ParallelState *s = opaque; pdebug("write addr=0x%02x val=0x%02x\n", addr, val); addr &= 7; switch(addr) { case PARA_REG_DATA: s->dataw = val; parallel_update_irq(s); break; case PARA_REG_CTR: va...
vuln
Safe
C/C++
public long getInGameTime(boolean smooth) { if (this.isCompleted && this != COMPLETED_INSTANCE) return COMPLETED_INSTANCE.getInGameTime(smooth); if (this.isCoop) return getRealTimeAttack(); if (this.isGlitched && this.isServerIntegrated && MinecraftClient.getInstance().getServer() != null) { ...
vuln
Safe
Java
public function invalidate() { $name = $this->getName(); if (null !== $name) { $params = session_get_cookie_params(); $cookie_options = array ( 'expires' => time() - 42000, 'path' => $params['path'], 'domain' => $params[...
vuln
Vulnerable
PHP
bool DNP3_Base::ProcessData(int len, const u_char* data, bool orig) { Endpoint* endp = orig ? &orig_state : &resp_state; while ( len ) { if ( endp->in_hdr ) { // We're parsing the DNP3 header and link layer, get that in full. int res = AddToBuffer(endp, PSEUDO_APP_LAYER_INDEX, &data, &len); if ( re...
vuln
Safe
C/C++
@Override public void callSessionConferenceExtendReceived(IImsCallSession newSession, ImsCallProfile profile) { TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { mListener.callSessionConferenceExtendReceived(ImsCallSession....
vuln
Safe
Java
int DwaCompressor::uncompress (const char *inPtr, int inSize, IMATH_NAMESPACE::Box2i range, const char *&outPtr) { int minX = range.min.x; int maxX = std::min (range.max.x, _max[0]); int minY = range.min.y; int maxY = std::min (range.max.y, _max[1]); Int64 iSize = static_cast<In...
vuln
Safe
C/C++
static void ehci_async_complete_packet(USBPort *port, USBPacket *packet) { EHCIQueue *q; EHCIState *s = port->opaque; uint32_t portsc = s->portsc[port->index]; if (portsc & PORTSC_POWNER) { USBPort *companion = s->companion_ports[port->index]; companion->ops->complete(companion, packet);...
vuln
Safe
C/C++
static void parse_str(StringInputVisitor *siv, Error **errp) { char *str = (char *) siv->string; long long start, end; Range *cur; char *endptr; if (siv->ranges) { return; } do { errno = 0; start = strtoll(str, &endptr, 0); if (errno == 0 && endptr > str) { ...
vuln
Vulnerable
C/C++
private String queryForApplicationTableName(final String datatable) { SQLInjectionValidator.validateSQLInput(datatable); final String sql = "SELECT application_table_name FROM x_registered_table where registered_table_name = '" + datatable + "'"; final SqlRowSet rs = this.jdbcTemplate.queryForR...
vuln
Vulnerable
Java
int wolfSSL_connect_TLSv13(WOLFSSL* ssl) { int advanceState; int ret = 0; WOLFSSL_ENTER("wolfSSL_connect_TLSv13()"); #ifdef HAVE_ERRNO_H errno = 0; #endif if (ssl == NULL) return BAD_FUNC_ARG; if (ssl->options.side != WOLFSSL_CLIENT_END) { ssl->error = SIDE_ERROR; WOL...
vuln
Safe
C/C++
@RequiresPermission(anyOf = { permission.INTERACT_ACROSS_USERS_FULL, permission.INTERACT_ACROSS_USERS }) public @Nullable Set<String> getCrossProfileCalendarPackages() { throwIfParentInstance("getCrossProfileCalendarPackages"); if (mService != null) { try { ...
vuln
Safe
Java
private List<Cwe> getCwes(final Object value) { if (value instanceof String) { final String cweIds = (String)value; if (cweIds.isEmpty()) { return null; } final List<Cwe> cwes = new ArrayList<>(); for (final String s : cweIds.split(",")...
vuln
Safe
Java
public static float getEstimatedHealthIncrement(int foodLevel, float saturationLevel, float exhaustionLevel) { float health = 0; float exhaustionForRegen = 6.0F; float exhaustionForConsumed = 4.0F; if (!Float.isFinite(exhaustionLevel) || !Float.isFinite(exhaustionLevel)) return 0; while (foodLevel >= 18...
vuln
Safe
Java
NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx chtype newmode, NCURSES_SP_OUTC outc) { attr_t turn_on, turn_off; int pair; bool reverse = FALSE; bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_...
vuln
Vulnerable
Unknown
def build_textcaptcha_config(options) if options.is_a?(Hash) options else YAML.safe_load(ERB.new(read_textcaptcha_config).result)[Rails.env] end rescue StandardError raise ArgumentError, "could not find any textcaptcha options, in config/textcaptcha.yml or model - run rake te...
vuln
Safe
Ruby
void *qemu_memalign(size_t alignment, size_t size) { if (!size) { abort(); } return oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE)); }
vuln
Vulnerable
C/C++
bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState, int bit, int byte, int glyph, int scan) { unsigned char *line; register CharInfoPtr ci; int i, ndx, nchars, nignored; unsigned int char_row, char_col; int numE...
vuln
Safe
C/C++
int ssl3_do_change_cipher_spec(SSL *s) { int i; const char *sender; int slen; if (s->state & SSL_ST_ACCEPT) i=SSL3_CHANGE_CIPHER_SERVER_READ; else i=SSL3_CHANGE_CIPHER_CLIENT_READ; if (s->s3->tmp.key_block == NULL) { if (s->session == NULL) { /* might happen if dtls1_read_bytes() calls this */ ...
vuln
Vulnerable
Unknown
static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) { static unsigned char HuffmanTable[] = { 0xFF, 0xC4, 0x01, 0xA2, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0...
vuln
Safe
C/C++
/* * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. * * Author: zccrs <zccrs@live.com> * * Maintainer: zccrs <zhangjide@deepin.com> * * 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 Foun...
vuln
Safe
C/C++
static int init_filters(const char *filters_descr) { char args[512]; int ret; AVFilter *abuffersrc = avfilter_get_by_name("abuffer"); AVFilter *abuffersink = avfilter_get_by_name("abuffersink"); AVFilterInOut *outputs = avfilter_inout_alloc(); AVFilterInOut *inputs = avfilter_inout_alloc(); ...
vuln
Safe
C/C++
def get(self, path): path = self.sanitize_path(path) base_paths = self.get_base_paths() if hasattr(base_paths, 'split'): # String, so go simple base_path = base_paths else: base_path = self.get_first_base(base_paths, path) return static_file(pa...
vuln
Safe
Python
bool ieee80211_parse_tx_radiotap(struct sk_buff *skb, struct net_device *dev) { struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_radiotap_iterator iterator; struct ieee80211_radiotap_header *rthdr = (struct ieee80211_radiotap_header *) skb->data; struct ieee80211_tx_info *info ...
vuln
Safe
C/C++
/* Copyright 2015 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
function insertRecord(recordRankType, dateDone,requirementID, scoutID, connection) { var strQuery = "INSERT INTO record VALUES('"+ connection.escape(recordRankType) +"', '"+ connection.escape(dateDone) +"', '"+ connection.escape(requirementID) +"', '"+ connection.escap...
vuln
Safe
JavaScript
@SystemApi @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int slotIndex, @SimPowerState int state, @NonNull Executor executor, @NonNull @SetSimPowerStateResult Consumer<Integer> callback) { if (state != CARD_POWER_DOWN && s...
vuln
Vulnerable
Java
@Override public void onWalletCardsRetrieved(@NonNull GetWalletCardsResponse response) { if (mIsDismissed) { return; } List<WalletCard> walletCards = response.getWalletCards(); List<WalletCardViewInfo> data = new ArrayList<>(walletCards.size()); for (WalletCard ca...
vuln
Vulnerable
Java
static int get_default_root(pool *p, int allow_symlinks, const char **root) { config_rec *c = NULL; const char *dir = NULL; int res; c = find_config(main_server->conf, CONF_PARAM, "DefaultRoot", FALSE); while (c != NULL) { pr_signals_handle(); /* Check the groups acl */ if (c->argc < 2) { ...
vuln
Vulnerable
C/C++
int ssl3_send_client_key_exchange(SSL *s) { unsigned char *p; int n; unsigned long alg_k; #ifndef OPENSSL_NO_RSA unsigned char *q; EVP_PKEY *pkey=NULL; #endif #ifndef OPENSSL_NO_KRB5 KSSL_ERR kssl_err; #endif /* OPENSSL_NO_KRB5 */ #ifndef OPENSSL_NO_ECDH EC_KEY *clnt_ecdh = NULL; const EC_POINT *srvr_ecpoint =...
vuln
Safe
Unknown
static int call_backend(char *uri, // I - URI of final destination int argc, // I - Number of command line // arguments char **argv, // I - Command-line arguments char *filename) // I - File name of input data { const ...
vuln
Safe
C/C++
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
Safe
C/C++
/************************************************************************ * 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
void AppCacheHost::SelectCacheForWorker(int parent_process_id, int parent_host_id) { DCHECK(pending_start_update_callback_.is_null() && pending_swap_cache_callback_.is_null() && pending_get_status_callback_.is_null() && !is_selection_pending() && ...
vuln
Vulnerable
C/C++
static int flv_write_trailer(AVFormatContext *s) { int64_t file_size; AVIOContext *pb = s->pb; FLVContext *flv = s->priv_data; int i; for (i = 0; i < s->nb_streams; i++) { AVCodecContext *enc = s->streams[i]->codec; FLVStreamContext *sc = s->streams[i]->priv_data; if (en...
vuln
Safe
C/C++
static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *buf, const uint8_t *end_buf) { int tag, type, count, off, value = 0; int i, j; uint32_t *pal; const uint8_t *rp, *gp, *bp; tag = tget_short(&buf, s->le); type = tget_short(&buf, s->le); count = tget_long(&buf, s-...
vuln
Safe
C/C++
static int reverseSortFiles(MprDirEntry **d1, MprDirEntry **d2) { char *base1, *base2, *b1, *b2, *p1, *p2; int rc; base1 = mprGetPathBase((*d1)->name); base2 = mprGetPathBase((*d2)->name); if (smatch(base1, base2)) { return 0; } b1 = ssplit(base1, "-", &p1); b2 = ssplit(...
vuln
Safe
C/C++
public boolean requiresCustomPersistence() { return super.requiresCustomPersistence() || this.hasCustomName() || this.fromBucket() || this.hasSwallowedEntity() || !this.catfishInventory.isEmpty(); }
vuln
Vulnerable
Java
static void vnc_tight_start(VncState *vs) { buffer_reset(&vs->tight.tight); // make the output buffer be the zlib buffer, so we can compress it later vs->tight.tmp = vs->output; vs->output = vs->tight.tight; }
vuln
Vulnerable
Unknown