code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAPTY...
vuln
Vulnerable
C/C++
QPDF_Array::insertItem(int at, QPDFObjectHandle const& item) { // As special case, also allow insert beyond the end if ((at < 0) || (at > static_cast<int>(this->items.size()))) { throw std::logic_error( "INTERNAL ERROR: bounds error accessing QPDF_Array element"); } this->items.insert(this->it...
vuln
Vulnerable
Unknown
/* ** $Id: ltm.c $ ** Tag methods ** See Copyright Notice in lua.h */ #define ltm_c #define LUA_CORE #include "lprefix.h" #include <string.h> #include "lua.h" #include "ldebug.h" #include "ldo.h" #include "lgc.h" #include "lobject.h" #include "lstate.h" #include "lstring.h" #include "ltable.h" #include "ltm.h" #i...
vuln
Safe
C/C++
static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { cpumask_clear(&mm->context.cpu_attach_mask); atomic_set(&mm->context.attach_count, 0); mm->context.flush_mm = 0; mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS; mm->context.asce_bits |= _ASCE_TYPE_REGION3; #ifd...
vuln
Vulnerable
C/C++
void bn_rec_rtnaf(int8_t *tnaf, size_t *len, const bn_t k, int8_t u, size_t m, size_t w) { int i, l; bn_t tmp, r0, r1; int8_t beta[64], gama[64]; uint8_t t_w; dig_t t0, t1, mask; int s, t, u_i; bn_null(r0); bn_null(r1); bn_null(tmp); if (*len < (bn_bits(k) + 1)) { RLC_THROW(ERR_NO_BUFFER); return; } ...
vuln
Safe
C/C++
private Map<FileDiffCacheKey, FileDiffOutput> createFileEntries( ObjectReader reader, List<FileDiffCacheKey> keys, RevWalk rw) throws DiffNotAvailableException, IOException { Map<AugmentedFileDiffCacheKey, AllFileGitDiffs> allFileDiffs = allDiffsEvaluatorFactory.create(rw).execute(wrapKe...
vuln
Vulnerable
Java
bool InstallablePaymentAppCrawler::CompleteAndStorePaymentWebAppInfoIfValid( const GURL& method_manifest_url, const GURL& web_app_manifest_url, std::unique_ptr<WebAppInstallationInfo> app_info) { if (app_info == nullptr) return false; if (app_info->sw_js_url.empty() || !base::IsStringUTF8(app_info-...
vuln
Vulnerable
C/C++
int64_t MemFile::readImpl(char *buffer, int64_t length) { assertx(m_len != -1); assertx(length > 0); int64_t remaining = m_len - m_cursor; if (remaining < length) length = remaining; if (length > 0) { memcpy(buffer, (const void *)(m_data + m_cursor), length); } m_cursor += length; return length; }
vuln
Vulnerable
C/C++
static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp, struct dump_opts* dump) { uint16 bps; uint32 tl, tw; uint32 row, col, nrow, ncol; uint32 src_rowsize, col_offset; uint32 tile_rowsize = TIFFTi...
vuln
Vulnerable
Unknown
RemoteFsDevice::Details RemoteDevicePropertiesWidget::details() { int t=type->itemData(type->currentIndex()).toInt(); RemoteFsDevice::Details det; det.name=name->text().trimmed(); switch (t) { case Type_SshFs: { det.url.setHost(sshHost->text().trimmed()); det.url.setUserName(sshUser...
vuln
Safe
Unknown
static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; int dc = block[0]; dc = (17 * dc + 4) >> 3; dc = (12 * dc + 64) >> 7; for(i = 0; i < 8; i++){ dest[0] = av_clip_uint8(dest[0] + dc); dest[1] = av_clip_uint8(dest[1] + dc); dest[2] = av_c...
vuln
Safe
C/C++
private void setOptions() { if (getContext() == null) return; if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED)) return; boolean pro = ActivityBilling.isPro(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreference...
vuln
Vulnerable
Java
static int tipc_udp_xmit(struct net *net, struct sk_buff *skb, struct udp_bearer *ub, struct udp_media_addr *src, struct udp_media_addr *dst, struct dst_cache *cache) { struct dst_entry *ndst = dst_cache_get(cache); int ttl, err = 0; if (dst->proto == htons(ETH_P_IP)) { struct rtable *rt = (struct rtable ...
vuln
Safe
Unknown
def __init__( self, web_path: str, filter_urls: Optional[List[str]] = None, parsing_function: Optional[Callable] = None, blocksize: Optional[int] = None, blocknum: int = 0, meta_function: Optional[Callable] = None, is_local: bool = False, continue_...
vuln
Vulnerable
Python
computedMember: function(left, right, context, create) { return function(scope, locals, assign, inputs) { var lhs = left(scope, locals, assign, inputs); var rhs; var value; if (lhs != null) { rhs = right(scope, locals, assign, inputs); rhs = getStringValue(rhs); if (create && create !== 1) { ...
vuln
Safe
JavaScript
static int StreamTcpPacketStateSynSent(ThreadVars *tv, Packet *p, StreamTcpThread *stt, TcpSession *ssn, PacketQueue *pq) { if (ssn == NULL) return -1; SCLogDebug("ssn %p: pkt received: %s", ssn, PKT_IS_TOCLIENT(p) ? "toclient":"toserver"); /* RST */ if (...
vuln
Vulnerable
C/C++
void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb) { struct in_pktinfo *pktinfo = PKTINFO_SKB_CB(skb); bool prepare = (inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO) || ipv6_sk_rxinfo(sk); if (prepare && skb_rtable(skb)) { /* skb->cb is overloaded: prior to this point it is IP{6}CB * wh...
vuln
Safe
Unknown
private DataSchemaContextNode<?> nextContextNode(final DataSchemaContextNode<?> parent, final QName qname, final List<PathArgument> path) { final var found = parent.getChild(qname); if (found == null) { // FIXME: why are we making this special case here, especially with ... ...
vuln
Safe
Java
static int drawgrid_filter_frame(AVFilterLink *inlink, AVFrame *frame) { DrawBoxContext *drawgrid = inlink->dst->priv; int plane, x, y; uint8_t *row[4]; if (drawgrid->have_alpha && drawgrid->replace) { for (y = 0; y < frame->height; y++) { row[0] = frame->data[0] + y * frame->linesiz...
vuln
Safe
C/C++
png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette) { png_uint_32 max_palette_length; png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PAL...
vuln
Vulnerable
C/C++
SslServer::SslServer(QObject* parent) : QTcpServer(parent) { // Keep track if the SSL warning has been mentioned at least once before static bool sslWarningShown = false; if (Quassel::isOptionSet("ssl-cert")) { _sslCertPath = Quassel::optionValue("ssl-cert"); } else { _sslCertPa...
vuln
Safe
C/C++
static inline int __tcp_mtu_to_mss(struct sock *sk, int pmtu) { const struct tcp_sock *tp = tcp_sk(sk); const struct inet_connection_sock *icsk = inet_csk(sk); int mss_now; /* Calculate base mss without TCP options: It is MMS_S - sizeof(tcphdr) of rfc1122 */ mss_now = pmtu - icsk->icsk_af_ops->net_header_le...
vuln
Vulnerable
Unknown
public function getValidator() { $validator = []; $fieldName = $this->getName(); switch ($fieldName) { case 'birthday': $funcName = ['name' => 'lessThanToday']; $validator[] = $funcName; break; case 'targetenddate': case 'actualenddate': case 'enddate': $funcName = ['name' => 'greater...
vuln
Vulnerable
PHP
long vt_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { struct vc_data *vc = tty->driver_data; struct console_font_op op; /* used in multiple places here */ void __user *up = compat_ptr(arg); int perm; /* * To have permissions to do most of the vt ioctls, we either have * to ...
vuln
Vulnerable
Unknown
public IdImpl(String id) { this.id = id; }
vuln
Vulnerable
Java
# -*- coding: utf-8 -*- # # (c) Cornelius Kölbel # License: AGPLv3 # contact: http://www.privacyidea.org # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # License as published by the Free Software Foundation; either # version 3 of ...
vuln
Safe
Python
public static int getReBuffer() { return SettingsEnum.MAX_PLAYBACK_BUFFER_AFTER_REBUFFER_INTEGER.getInt(); }
vuln
Vulnerable
Java
boolean writePacket(byte[] buffer, int count);
vuln
Safe
Java
void FoFiType1::parse() { char *line, *line1, *p, *p2; char buf[256]; char c; int n, code, i, j; char *tokptr; for (i = 1, line = (char *)file; i <= 100 && line && (!name || !encoding); ++i) { if (!name && !strncmp(line, "/FontName", 9)) { strncpy(buf, line, 255); buf[255] = ...
vuln
Safe
C/C++
int Jsi_ObjArraySizer(Jsi_Interp *interp, Jsi_Obj *obj, uint len) { uint nsiz = len + 1, mod = ALLOC_MOD_SIZE; assert(obj->isarrlist); if (mod>1) nsiz = nsiz + ((mod-1) - (nsiz + mod - 1)%mod); if (len >= interp->maxArrayList || nsiz > interp->maxArrayList) { Jsi_LogError("array size too...
vuln
Safe
Unknown
static void gf_dump_vrml_dyn_field(GF_SceneDumper *sdump, GF_Node *node, GF_FieldInfo field, Bool has_sublist) { u32 i, sf_type; void *slot_ptr; if (gf_sg_vrml_is_sf_field(field.fieldType)) { DUMP_IND(sdump); if (sdump->XMLDump) { if (sdump->X3DDump) { gf_fprintf(sdump->trace, "<field name=\"%s\" type=\"...
vuln
Safe
C/C++
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse....
vuln
Vulnerable
Java
otError Commissioner::GeneratePskc(const char * aPassPhrase, const char * aNetworkName, const Mac::ExtendedPanId &aExtPanId, Pskc & aPskc) { otError error =...
vuln
Safe
C/C++
private void cveAttackChanged() { JCheckBox jcb = jwtST.getCVEAttackCheckBox(); cveAttackMode = jcb.isSelected(); jwtST.getNoneAttackComboBox().setEnabled(!cveAttackMode); jwtST.getRdbtnDontModify().setEnabled(!cveAttackMode); jwtST.getRdbtnOriginalSignature().setEnabled(!cveAttackMode); jwtST.getRdbtnRand...
vuln
Safe
Java
private boolean removeEscrowToken(long handle, int userId) { synchronized (mSpManager) { if (handle == getCurrentLskfBasedProtectorId(userId)) { Slog.w(TAG, "Escrow token handle equals LSKF-based protector ID"); return false; } if (mSpManager.r...
vuln
Safe
Java
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) { size_t retlen; int truncated; _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); if (truncated) /* * In case of truncation, return -1 like traditional snprintf. * (Current drafts for ISO/IEC 989...
vuln
Vulnerable
Unknown
package defaults import ( "time" ) const ( // these requests take at _least_ two minutes at the moment. ProvideTimeout = time.Minute * 3 ProvSearchDelay = time.Second // Number of concurrent workers in decision engine that process requests to the blockstore BitswapEngineBlockstoreWorkerCount = 128 // the tot...
vuln
Vulnerable
Go
import { validatePassword } from 'nocodb-sdk' export default { data: () => ({ passwordProgress: 0, passwordValidateMsg: '', formUtil: { formErr: false, formErrMsg: '', valid: false, valid1: false, recpatcha: true, e3: true, e4: true, passwordProgress: 0, ...
vuln
Safe
JavaScript
public function gc($force = false) { if ($force || mt_rand(0, 1000000) < $this->gcProbability) { $this->db->createCommand() ->delete($this->cacheTable, '[[expire]] > 0 AND [[expire]] < ' . time()) ->execute(); } }
vuln
Vulnerable
PHP
static bool blit_is_unsafe(struct CirrusVGAState *s) { /* should be the case, see cirrus_bitblt_start */ assert(s->cirrus_blt_width > 0); assert(s->cirrus_blt_height > 0); if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) { return true; } if (blit_region_is_unsafe(s, s->cirrus_blt_dstpi...
vuln
Safe
C/C++
int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) { struct scsi_device *SDev; struct scsi_sense_hdr sshdr; int result, err = 0, retries = 0; unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE], *senseptr = NULL; SDev = cd->device; if (cgc->sense) senseptr = sense_buffer; retry: if (!scsi_...
vuln
Safe
C/C++
xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3) { xmlChar *buffer = NULL; int buffer_size = 0; xmlChar *current = NULL; xmlChar *rep = NULL; const xmlChar *last; xmlEntityPtr ent; int c,l; int nbc...
vuln
Vulnerable
C/C++
int ff_rtsp_send_cmd_with_content(AVFormatContext *s, const char *method, const char *url, const char *header, RTSPMessageHeader *reply, unsigned char **content_ptr, ...
vuln
Safe
C/C++
TfLiteStatus SoftmaxPrepare(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteSoftmaxParams*>(node->builtin_data); SoftmaxOpData* data = reinterpret_cast<SoftmaxOpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node)...
vuln
Safe
C/C++
size_t bit_wcs2nlen (const BITCODE_TU restrict wstr, const size_t maxlen) { size_t len; if (!wstr) return 0; len = 0; # ifdef HAVE_ALIGNED_ACCESS_REQUIRED // for strict alignment CPU's like sparc only. also for UBSAN. if ((uintptr_t)wstr % SIZEOF_SIZE_T) { unsigned char *b = (unsigned char *)w...
vuln
Safe
C/C++
XListFonts( register Display *dpy, _Xconst char *pattern, /* null-terminated */ int maxNames, int *actualCount) /* RETURN */ { register long nbytes; register unsigned i; register int length; char **flist = NULL; char *ch = NULL; char *chstart; char *chend; int count = 0; xListFontsR...
vuln
Safe
Unknown
package org.linlinjava.litemall.wx.web; import org.linlinjava.litemall.core.storage.StorageService; import org.linlinjava.litemall.core.util.CharUtil; import org.linlinjava.litemall.core.util.ResponseUtil; import org.linlinjava.litemall.db.domain.LitemallStorage; import org.linlinjava.litemall.db.service.LitemallStora...
vuln
Vulnerable
Java
private Triple<CType, IASTInitializer, String> convert(IASTDeclarator d, CType specifier) { while (d != null && d.getClass() == CASTDeclarator.class && d.getPointerOperators().length == 0 && d.getAttributes().length == 0 && d.getAttributeSpecifiers().length == 0 && d.getIniti...
vuln
Safe
Java
// Pitchfork ctx defines the context that is passed through Pitchfork pertaining primarily to the logged in, selected user/group package pitchfork import ( "errors" "fmt" "math" "net" "strconv" "strings" useragent "github.com/mssola/user_agent" i18n "github.com/nicksnyder/go-i18n/i18n" ) // ErrLoginIncorrect...
vuln
Vulnerable
Go
package org.jenkinsci.plugins.api; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Logger; import org.acegisecurity.userdetails.UserDetails; import org.apache.commons.collect...
vuln
Safe
Java
ssl_do_connect (server * serv) { char buf[128]; g_sess = serv->server_session; if (SSL_connect (serv->ssl) <= 0) { char err_buf[128]; int err; g_sess = NULL; if ((err = ERR_get_error ()) > 0) { ERR_error_string (err, err_buf); snprintf (buf, sizeof (buf), "(%d) %s", err, err_buf); EMIT_SIGNAL (...
vuln
Safe
C/C++
void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr, struct tipc_mon_state *state, int bearer_id) { struct tipc_monitor *mon = tipc_monitor(net, bearer_id); struct tipc_mon_domain *arrv_dom = data; struct tipc_mon_domain dom_bef; struct tipc_mon_domain *dom; struct tipc_peer *peer; u16 new_membe...
vuln
Vulnerable
Unknown
@OperationMethod public DocumentModel run(DocumentModel doc) { run(); // refetch the input document if any using the new session // otherwise using document methods that are delegating the call to the // session that created the document will call the old session. CoreSession...
vuln
Safe
Java
static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64) { VhostUserMsg msg = { .request = request, .flags = VHOST_USER_VERSION, }; if (vhost_user_one_time_request(request) && dev->vq_index != 0) { return 0; } vhost_user_write(dev, &msg, NULL, 0); ...
vuln
Vulnerable
C/C++
def get_jinja_environment(allow_undefined=False, trim_blocks=True, lstrip_blocks=True): """ jinja2.Environment object that is setup with right behaviors and custom filters. :param strict_undefined: If should allow undefined variables in templates :type strict_undefined: ``bool`` """ # Late imp...
vuln
Vulnerable
Python
static void zynq_xadc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) { ZynqXADCState *s = (ZynqXADCState *)opaque; int reg = offset / 4; int xadc_reg; int xadc_cmd; int xadc_data; if (!zynq_xadc_check_offset(reg, false)) { qemu_log_mask(LOG_GU...
vuln
Vulnerable
C/C++
WebGLObject::WebGLObject(WebGLRenderingContext* context) WebGLObject::WebGLObject(WebGLRenderingContext*) : m_object(0) , m_attachmentCount(0) , m_deleted(false) { }
vuln
Safe
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif /* Return value from call to function will is not used. */ bool Jsi_FunctionReturnIgnored(Jsi_Interp *interp, Jsi_Func *funcPtr) { return funcPtr->callflags.bits.isdiscard; } bool Jsi_FunctionIsConstructor(Jsi_Func *funcPtr) { return (f...
vuln
Vulnerable
C/C++
static int cloop_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVCloopState *s = bs->opaque; uint32_t offsets_size, max_compressed_block_size = 1, i; int ret; bs->read_only = 1; /* read header */ ret = bdrv_pread(bs->file, 128, &s->block_size, 4)...
vuln
Vulnerable
Unknown
package com.zrlog.web.util; import com.zrlog.util.ZrLogUtil; import javax.servlet.http.HttpServletRequest; /** * 存放与Web相关的工具代码 */ public class WebTools { /** * 处理由于浏览器使用透明代理,或者是WebServer运行在诸如 nginx/apache 这类 HttpServer后面的情况,通过获取请求头真实IP地址 * * @param request * @return */ public stat...
vuln
Vulnerable
Java
static int coroutine_fn v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path) { int err; V9fsState *s = pdu->s; V9fsFidState *fidp, head_fid; head_fid.next = s->fid_list; for (fidp = s->fid_list; fidp; fidp = fidp->next) { if (fidp->path.size != path->size) { continue; ...
vuln
Vulnerable
Unknown
void Scrollbar::moveThumb(int pos) { int thumbPos = theme()->thumbPosition(this); int thumbLen = theme()->thumbLength(this); int trackLen = theme()->trackLength(this); int maxPos = trackLen - thumbLen; int delta = pos - m_pressedPos; if (delta > 0) delta = min(maxPos - thumbPos, delta); ...
vuln
Safe
C/C++
public SSLContextAndOptions createSSLContextAndOptionsFromConfig(ZKConfig config) throws SSLContextException { KeyManager[] keyManagers = null; TrustManager[] trustManagers = null; String keyStoreLocationProp = config.getProperty(sslKeystoreLocationProperty, ""); String keyStorePassword...
vuln
Safe
Java
static int tcp_v6_rcv(struct sk_buff *skb) { const struct tcphdr *th; const struct ipv6hdr *hdr; bool refcounted; struct sock *sk; int ret; struct net *net = dev_net(skb->dev); if (skb->pkt_type != PACKET_HOST) goto discard_it; /* * Count it even if it's bad. */ __TCP_INC_STATS(net, TCP_MIB_INSEGS); ...
vuln
Vulnerable
Unknown
pango_log2vis_get_embedding_levels (const gchar *text, int length, PangoDirection *pbase_dir) { glong n_chars, i; guint8 *embedding_levels_list; const gchar *p; FriBidiParType fribidi_base_dir; FriBidiCharType *bidi_types; #ifdef USE_FRIBIDI_EX_API FriBidiBracketType *bracket_...
vuln
Safe
C/C++
registerEvents(container) { container.find('.js-modal__save').on('click', (e) => { let progress = $.progressIndicator({ position: 'html', blockInfo: { enabled: true } }); let params = container.find('form').serializeFormData(); AppConnector.request(params) .done(function (da...
vuln
Vulnerable
JavaScript
static void rekey_seq_generator(struct work_struct *work) static int __init random_int_secret_init(void) {
vuln
Safe
C/C++
private static boolean packageHasCarrierPrivileges(TelephonyManager tm, String packageName) { final long token = Binder.clearCallingIdentity(); try { return tm.checkCarrierPrivilegesForPackageAnyPhone(packageName) == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS; ...
vuln
Safe
Java
void console_select(unsigned int index) { TextConsole *s; if (index >= MAX_CONSOLES) return; if (active_console) { active_console->g_width = ds_get_width(active_console->ds); active_console->g_height = ds_get_height(active_console->ds); } s = consoles[index]; if (s) { ...
vuln
Safe
C/C++
static Jsi_Value *jsi_treeFmtKey(Jsi_MapEntry* h, struct Jsi_MapOpts *opts, int flags) { Jsi_TreeEntry* hPtr = (Jsi_TreeEntry*)h; void *key = Jsi_TreeKeyGet(hPtr); if (opts->keyType == JSI_KEYS_ONEWORD) return Jsi_ValueNewNumber(opts->interp, (Jsi_Number)(intptr_t)key); char nbuf[100]; snpri...
vuln
Vulnerable
C/C++
@NonNull public Drawable getDrawable(@NonNull String iconResString) { try { return ResourceUtil.getResourceFromName(mPackageManager, iconResString).getDrawable(requireActivity().getTheme()); } catch (PackageManager.NameNotFoundException | Resources.NotFoundException ignore) { ...
vuln
Safe
Java
ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name, ram_addr_t size, void *host) { RAMBlock *new_block, *block; size = TARGET_PAGE_ALIGN(size); new_block = qemu_mallocz(sizeof(*new_block)); if (dev && dev->parent_bus && dev->parent_bus->info->get_dev...
vuln
Vulnerable
C/C++
CollationCreate(const char *collname, Oid collnamespace, Oid collowner, char collprovider, int32 collencoding, const char *collcollate, const char *collctype, const char *collversion, bool if_not_exists, bool quiet) { Relation rel; TupleDesc tupDesc; HeapTuple tup; Datum values[Natts_pg...
vuln
Vulnerable
Unknown
@SuppressLint("StringFormatInvalid") @Override public void run() { try { while (!isInterrupted()) { Thread.sleep(500); runOnUiThread(() -> { String installationStatus = Utils.getString...
vuln
Safe
Java
static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, const struct io_uring_sqe *sqe, struct io_submit_state *state) { unsigned int sqe_flags; int id, ret; req->opcode = READ_ONCE(sqe->opcode); req->user_data = READ_ONCE(sqe->user_data); req->async_data = NULL; req->file = NULL;...
vuln
Safe
C/C++
QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) { // This function calculates the ordering of objects, divides them // into the appropriate parts, and computes some values for the // linearization parameter dictionary and hint tables. The file // must be optimized (via ca...
vuln
Vulnerable
Unknown
public ResponseEntity<Resource> fetch(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { ResponseEntity.notFound(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.parseMed...
vuln
Vulnerable
Java
public static void start(Live live, String text) { int number = 0; if (live.getGroups().size() > 0) return; if (text.startsWith("#EXTM3U")) m3u(live, text); else txt(live, text); for (Group group : live.getGroups()) { for (Channel channel : group.getChannel()) { ...
vuln
Vulnerable
Java
static int htab_save_later_pass(QEMUFile *f, sPAPREnvironment *spapr, int64_t max_ns) { bool final = max_ns < 0; int htabslots = HTAB_SIZE(spapr) / HASH_PTE_SIZE_64; int examined = 0, sent = 0; int index = spapr->htab_save_index; int64_t starttime = qemu_clock_get_ns(...
vuln
Safe
C/C++
static void __xen_evtchn_do_upcall(void) { struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); int cpu = smp_processor_id(); read_lock(&evtchn_rwlock); do { vcpu_info->evtchn_upcall_pending = 0; xen_evtchn_handle_events(cpu); BUG_ON(!irqs_disabled()); virt_rmb(); /* Hypervisor can set upcall pendi...
vuln
Vulnerable
C/C++
tooltipBind: function(_elem, _html) { if (_html != '') { _elem.bind('mouseenter.tooltip', function(e) { if (_elem != current_elem) { //Prepare the tooltip prepare(_html); // Set the current element the mouse is over and // initialize the position variables current_elem...
vuln
Vulnerable
JavaScript
@Override public String getAuthRole() throws AuthenticationException { return provider.getPrincipal(jwt); }
vuln
Vulnerable
Java
void update(TLVReader reader) { // NOTES: // - Due to all configuration parameters being optional, pre-conditions are evaluated // in each section on-the-fly rather than all prior to execution. // - To save on validation code, any boolean value is just stored as a byte and any // non-zero value...
vuln
Safe
Java
"""Part database model definitions.""" from __future__ import annotations import decimal import hashlib import logging import os from datetime import datetime from decimal import Decimal, InvalidOperation from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core....
vuln
Safe
Python
WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID( int window_id, std::string* error) { Browser* browser = NULL; if (!GetBrowserFromWindowID(chrome_details_, window_id, &browser, error)) return nullptr; WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); if (!c...
vuln
Safe
C/C++
static void vnc_client_cache_auth(VncState *client) { if (!client->info) { return; } #ifdef CONFIG_VNC_TLS if (client->tls.session && client->tls.dname) { client->info->has_x509_dname = true; client->info->x509_dname = g_strdup(client->tls.dname); } #endif #ifdef CONFIG_V...
vuln
Vulnerable
C/C++
function XMLRPCremoveNode($nodeID){ require_once(".ht-inc/privileges.php"); global $user; if(!in_array("nodeAdmin", $user['privileges'])){ return array( 'status' => 'error', 'errorcode' => 56, 'errormsg' => 'User cannot administer nodes'); } if(!checkUserH...
vuln
Vulnerable
PHP
void helper_rsm(CPUX86State *env) { X86CPU *cpu = x86_env_get_cpu(env); CPUState *cs = CPU(cpu); target_ulong sm_state; int i, offset; uint32_t val; sm_state = env->smbase + 0x8000; #ifdef TARGET_X86_64 cpu_load_efer(env, x86_ldq_phys(cs, sm_state + 0x7ed0)); env->gdt.base = x86_ldq_phys...
vuln
Safe
C/C++
bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr) { unsigned long *p = map + BIT_WORD(start); const long size = start + nr; int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); unsigned long dirty = 0; ...
vuln
Safe
C/C++
get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf) { int tmp; struct usb_host_interface *alt; struct usb_host_endpoint *in, *out; struct usb_host_endpoint *iso_in, *iso_out; struct usb_host_endpoint *int_in, *int_out; struct usb_device *udev; for (tmp = 0; tmp < intf->num_altsetting; tmp++) ...
vuln
Safe
C/C++
static struct rds_connection *__rds_conn_create(struct net *net, const struct in6_addr *laddr, const struct in6_addr *faddr, struct rds_transport *trans, gfp_t gfp, u8 tos, int is_outgoing, int dev_if) { struct rds_connection *conn, *parent = NULL; struct hlist_head *head = rds_con...
vuln
Safe
C/C++
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * 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 co...
vuln
Safe
C/C++
# # Copyright (c) 2013 Red Hat, Inc. # # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy ...
vuln
Safe
Python
FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t options) { const unsigned channels = e->info.channels; const unsigned bps = e->info.bits_per_sample - e->info.shift; const unsigned sample_rate = e->info.sample_rate; FLACDecoderData *flac_decoder_data = (e->format == FORMAT_FLAC || e->forma...
vuln
Safe
Unknown
renderCoTable(struct table *tbl, int maxlimit) { struct readbuffer obuf; struct html_feed_environ h_env; struct environment envs[MAX_ENV_LEVEL]; struct table *t; int i, col, row; int indent, maxwidth; if (cotable_level >= MAX_COTABLE_LEVEL) return; /* workaround to prevent infinite recursi...
vuln
Safe
C/C++
public boolean equals(final Object obj) { if (! (obj instanceof SimpleDigestPasswordImpl)) { return false; } SimpleDigestPasswordImpl other = (SimpleDigestPasswordImpl) obj; return algorithm.equals(other.algorithm) && Arrays.equals(digest, other.digest); }
vuln
Vulnerable
Java
static long aio_read_events_ring(struct kioctx *ctx, struct io_event __user *event, long nr) { struct aio_ring *ring; unsigned head, tail, pos; long ret = 0; int copy_ret; mutex_lock(&ctx->ring_lock); /* Access to ->ring_pages here is protected by ctx->ring_lock. */ ring = kmap_atomic(ctx->ring_pages[0]);...
vuln
Safe
C/C++
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * 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.apach...
vuln
Vulnerable
Java
current_quote( oparg_T *oap, long count, int include, // TRUE == include quote char int quotechar) // Quote character { char_u *line = ml_get_curline(); int col_end; int col_start = curwin->w_cursor.col; int inclusive = FALSE; int vis_empty = TRUE; // Visual selection <= 1 char...
vuln
Vulnerable
C/C++