code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int cleanup_pathname(struct archive_write_disk *a) { struct archive_string error_string; int error_number; int rc; archive_string_init(&error_string); rc = cleanup_pathname_fsobj(a->name, &error_number, &error_string, a->flags); if (rc != ARCHIVE_OK) { archive_set_error(&a->archive, error_number, "%s", e...
vuln
Safe
C/C++
private void sendPacket(byte[] raw) { if(VoiceClient.socketUDP == null) { this.running = false; return; } try { if(!VoiceClient.socketUDP.isClosed()) { VoiceClient.socketUDP.send(new VoiceClientPacket(encoder.encode(raw), sequenceNumber++, ...
vuln
Vulnerable
Java
side_in_cb (GSocket *socket, GIOCondition condition, gpointer user_data) { ProxySide *side = user_data; FlatpakProxyClient *client = side->client; GError *error = NULL; Buffer *buffer; gboolean retval = G_SOURCE_CONTINUE; g_object_ref (client); while (!side->closed) { if (!side->got_first_byte...
vuln
Vulnerable
C/C++
static int parseFileInner(MaState *state, cchar *path) { MaDirective *directive; char *tok, *key, *line, *value; assert(state); assert(path && *path); if (openConfig(state, path) < 0) { return MPR_ERR_CANT_OPEN; } for (state->lineNumber = 1; state->file && (line = mprRea...
vuln
Vulnerable
C/C++
static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, u16 flags) { struct tcamsg *t; struct nlmsghdr *nlh; struct sk_buff *skb; struct rtattr *x; unsigned char *b; int err = 0; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb) return -ENOBUFS; b = (unsig...
vuln
Vulnerable
Unknown
static void l2tp_proto_ver_print(netdissect_options *ndo, const uint16_t *dat) { ND_PRINT((ndo, "%u.%u", (EXTRACT_16BITS(dat) >> 8), (EXTRACT_16BITS(dat) & 0xff))); }
vuln
Vulnerable
C/C++
private void putNotifications(List<Notification> notifications, boolean onlyMentions, boolean clear){ runOnDbThread((db)->{ String table=onlyMentions ? "notifications_mentions" : "notifications_all"; if(clear) db.delete(table, null, null); ContentValues values=new ContentValues(3); for(Notification n:...
vuln
Safe
Java
const Chapters::Atom* Chapters::Edition::GetAtom(int index) const { if (index < 0) return NULL; if (index >= m_atoms_count) return NULL; return m_atoms + index; }
vuln
Vulnerable
C/C++
/** * Copyright (c) 2014-present, The osquery authors * * This source code is licensed as defined by the LICENSE file found in the * root directory of this source tree. * * SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only) */ #include <boost/algorithm/string.hpp> #include <osquery/core/core.h> #include <os...
vuln
Vulnerable
C/C++
/* 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
Vulnerable
Python
static int vvfat_open(BlockDriverState *bs, QDict *options, int flags) { BDRVVVFATState *s = bs->opaque; int cyls, heads, secs; bool floppy; const char *dirname; QemuOpts *opts; Error *local_err = NULL; int ret; #ifdef DEBUG vvv = s; #endif DLOG(if (stderr == NULL) { stderr = fopen("...
vuln
Safe
C/C++
log2vis_utf8 (PyObject * string, int unicode_length, FriBidiParType base_direction, int clean, int reordernsm) { FriBidiChar *logical = NULL; /* input fribidi unicode buffer */ FriBidiChar *visual = NULL; /* output fribidi unicode buffer */ char *visual_utf8 = NULL; /* output fribidi UTF-8 buffer */ FriB...
vuln
Vulnerable
C/C++
ext4_xattr_put_super(struct super_block *sb)
vuln
Safe
C/C++
isis_print_extd_ip_reach(netdissect_options *ndo, const uint8_t *tptr, const char *ident, uint16_t afi) { char ident_buffer[20]; uint8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for IPv4 and IPv6 prefixes */ u_int metric, status_byte, bit_length, byte_length, sublen, p...
vuln
Safe
C/C++
QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg, QCryptoCipherMode mode, const uint8_t *key, size_t nkey, Error **errp) { QCryptoCipher *cipher; QCryptoCipherNettle *ctx; uint8_t *rfbkey; s...
vuln
Vulnerable
C/C++
static void armv7m_bitband_init(void) { DeviceState *dev; dev = qdev_create(NULL, "ARM,bitband-memory"); qdev_prop_set_uint32(dev, "base", 0x20000000); qdev_init(dev); sysbus_mmio_map(sysbus_from_qdev(dev), 0, 0x22000000); dev = qdev_create(NULL, "ARM,bitband-memory"); qdev_prop_set_uint32(d...
vuln
Vulnerable
C/C++
@EventHandler private void onTickPost(TickEvent.Post event) { // Delay if (delay.get() != 0 && ticksWaited < delay.get() - 1) { ticksWaited++; return; } if (spawns.isEmpty()) return; // Find slot FindItemResult block = InvUtils.findInHotbar(i...
vuln
Safe
Java
static void quantize(SnowContext *s, SubBand *b, DWTELEM *src, int stride, int bias){ const int level= b->level; const int w= b->width; const int h= b->height; const int qlog= clip(s->qlog + b->qlog, 0, 128); const int qmul= qexp[qlog&7]<<(qlog>>3); int x,y; assert(QROOT==8); bias= bias ...
vuln
Vulnerable
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
Safe
JavaScript
static void copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell) { int h, w, mv_x, mv_y, offset, offset_dst; uint8_t *src, *dst; offset_dst = (cell->ypos << 2) * plane->pitch + (cell->xpos << 2); dst = plane->pixels[ctx->buf_sel] + offset_dst; if(cell->mv_ptr){ mv_y ...
vuln
Safe
C/C++
webSocketsHasDataInBuffer(rfbClientPtr cl) { ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; if (wsctx && wsctx->readlen) return TRUE; return (cl->sslctx && rfbssl_pending(cl) > 0); }
vuln
Safe
Unknown
static int thp_probe(AVProbeData *p) { if (AV_RL32(p->buf) == MKTAG('T', 'H', 'P', '\0')) return AVPROBE_SCORE_MAX; else return 0; }
vuln
Vulnerable
C/C++
bytesPerDeepLineTable (const Header &header, int minY, int maxY, const char* base, int xStride, int yStride, vector<size_t> &bytesPerLine) { const Box2i &dataWindow = header.dataWindow(); const Cha...
vuln
Safe
C/C++
# # 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
Vulnerable
Python
public function update_item_permissions_check( $request ) { $post = get_post( $request['id'] ); $post_type = get_post_type_object( $this->post_type ); if ( $post && ! $this->check_update_permission( $post ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this post.' ), ar...
vuln
Vulnerable
PHP
long do_rt_sigreturn(CPUMIPSState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; sigset_t blocked; frame_addr = env->active_tc.gpr[29]; trace_user_do_rt_sigreturn(env, frame_addr); if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { goto badframe; } targe...
vuln
Vulnerable
C/C++
set_cs_start(char *line) { char *p, *q, *r; if ((p = strstr(line, "string currentfile"))) { /* enforce presence of `readstring' -- 5/29/99 */ if (!strstr(line, "readstring")) return; /* locate the name of the charstring start command */ *p = '\0'; /* damage line[] */ q = strrchr(lin...
vuln
Vulnerable
C/C++
/* Copyright 2017 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
set_interface_var(const char *iface, const char *var, const char *name, uint32_t val) { FILE *fp; char spath[64+IFNAMSIZ]; /* XXX: magic constant */ if (snprintf(spath, sizeof(spath), var, iface) >= sizeof(spath)) return -1; if (access(spath, F_OK) != 0) return -1; fp = fopen(spath, "w"); if (...
vuln
Vulnerable
C/C++
@Override protected void onCreate( Bundle savedInstanceState ) { super.onCreate(savedInstanceState); Log.d(Const.LOG_TAG, "Launching the provisioning mode choice activity"); binding = DataBindingUtil.setContentView(this, R.layout.activity_mdm_choice); Intent intent = getIntent(); ...
vuln
Safe
Java
static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offset, struct inode **i) { squashfs_dir_header_2 dirh; char buffer[sizeof(squashfs_dir_entry_2) + SQUASHFS_NAME_LEN + 1] __attribute__((aligned)); squashfs_dir_entry_2 *dire = (squashfs_dir_entry_2 *) buffer; long long start; int bytes ...
vuln
Vulnerable
Unknown
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; if (scale_d ...
vuln
Safe
C/C++
psutil_ppid_map(PyObject *self, PyObject *args) { PyObject *py_pid = NULL; PyObject *py_ppid = NULL; PyObject *py_retdict = PyDict_New(); HANDLE handle = NULL; PROCESSENTRY32 pe = {0}; pe.dwSize = sizeof(PROCESSENTRY32); if (py_retdict == NULL) return NULL; handle = CreateToolhe...
vuln
Vulnerable
Unknown
TiledInputFile::TiledInputFile (const char fileName[], int numThreads): _data (new Data (numThreads)) { _data->_streamData=NULL; _data->_deleteStream=true; // // This constructor is called when a user // explicitly wants to read a tiled file. // IStream* is = 0; try { ...
vuln
Vulnerable
Unknown
public void switchToConversation(Conversation conversation, String text) { switchToConversation(conversation, text, false, null, false, false); }
vuln
Safe
Java
inline bool checkNoWait(int length) { return check(length, 1, false)!=0; }
vuln
Vulnerable
C/C++
static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb, RMDemuxContext *rm, RMStream *vst, AVPacket *pkt, int len, int *pseq) { int hdr, seq, pic_num, len2, pos; int type; hdr = get_byte(pb); len--; type = hdr >> 6; ...
vuln
Safe
C/C++
static int mmap_read_frame(struct video_data *s, void *frame, int64_t *ts) { struct v4l2_buffer buf; int res; memset(&buf, 0, sizeof(struct v4l2_buffer)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; while ((res = ioctl(s->fd, VIDIOC_DQBUF, &buf)) < 0 && ...
vuln
Safe
C/C++
public void incrementInTicksFromCondition(DataKey<Float> dataKey, boolean condition, float ticksToIncrement, float ticksToDecrement){ Variable<Float> data = this.get(dataKey); data.set(Mth.clamp((data.get()) + (condition ? 1/ticksToIncrement : -1/ticksToDecrement), 0, 1)); }
vuln
Vulnerable
Java
AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new( AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const char *domain, AvahiLookupFlags flags, AvahiSServiceTypeBrowserCallback callback, void* userdata) { AvahiSServiceTypeBrowser *b; b = avahi_s_...
vuln
Safe
Unknown
@Override public Arguments getLaunchArguments(LaunchOptions options) throws IOException { if (!options.isDaemon()) return null; server = new YggdrasilServer(0); server.start(); try { server.addCharacter(new YggdrasilServer.Character(uuid, usernam...
vuln
Vulnerable
Java
bool ParamTraits<FilePath>::Read(const Message* m, PickleIterator* iter, param_type* r) { FilePath::StringType value; if (!ParamTraits<FilePath::StringType>::Read(m, iter, &value)) return false; // Reject embedded NULs as they can cause secu...
vuln
Safe
C/C++
static CACHE_BITMAP_ORDER* update_read_cache_bitmap_order(rdpUpdate* update, wStream* s, BOOL compressed, UINT16 flags) { CACHE_BITMAP_ORDER* cache_bitmap; if (!update || !s) return NULL; cache_bitmap = calloc(1, sizeof(CACHE_BITMAP_ORDER)); if (!cache_...
vuln
Safe
Unknown
libvirt_vmessage(xentoollog_logger *logger_in, xentoollog_level level, int errnoval, const char *context, const char *format, va_list args) { xentoollog_logger_libvirt *lg = (xentoollog_logger_libvirt *)logger_in; FILE *logFile...
vuln
Vulnerable
Unknown
static int raw_getname(struct socket *sock, struct sockaddr *uaddr, int *len, int peer) { struct sockaddr_can *addr = (struct sockaddr_can *)uaddr; struct sock *sk = sock->sk; struct raw_sock *ro = raw_sk(sk); if (peer) return -EOPNOTSUPP; memset(addr, 0, sizeof(*addr)); addr->can_family = AF_CAN; ...
vuln
Safe
Unknown
static gboolean listener_event(GIOChannel *channel, GIOCondition condition, gpointer user_data) { GDHCPClient *dhcp_client = user_data; struct sockaddr_in dst_addr = { 0 }; struct dhcp_packet packet = { 0 }; struct dhcpv6_packet *packet6 = NULL; uint8_t *message_type = NULL, *client_id = NULL, *option, *s...
vuln
Safe
Unknown
mxResources.get("loading"))&&(c.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",J)})})}):mxscript("js/extensions.min.js",J...
vuln
Safe
JavaScript
TPMI_DH_CONTEXT_Unmarshal(TPMI_DH_CONTEXT *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; TPMI_DH_CONTEXT orig_target = *target; // libtpms added if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { BOOL isNotHmacSession =...
vuln
Safe
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Safe
C/C++
@Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_GRANT_TRUST: if (!isConnected()) { Log.w(TAG, "Agent is not connected, cannot grant trust: " + mName.flattenToShortString()); ...
vuln
Vulnerable
Java
bool initiate_stratum(struct pool *pool) { char s[RBUFSIZE], *sret = NULL, *nonce1, *sessionid; json_t *val = NULL, *res_val, *err_val; bool ret = false, recvd = false; json_error_t err; int n2size; if (!setup_stratum_curl(pool)) goto out; resend: if (pool->sessionid) sprintf(s, "{\"id\": %d, \"method\": \...
vuln
Vulnerable
C/C++
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_settings); setTitle(R.string.settings); ((TextView) findViewById(R.id.title_text)).setText(R.string.settings); // Set language SharedPrefere...
vuln
Safe
Java
initialize(int argc, VALUE argv[], VALUE self) { ffi_cif * cif; ffi_type **arg_types; ffi_status result; VALUE ptr, args, ret_type, abi, kwds; long i; rb_scan_args(argc, argv, "31:", &ptr, &args, &ret_type, &abi, &kwds); if(NIL_P(abi)) abi = INT2NUM(FFI_DEFAULT_ABI); Check_Type(args, T...
vuln
Vulnerable
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
Vulnerable
Python
ProcXChangeFeedbackControl(ClientPtr client) { unsigned len; DeviceIntPtr dev; KbdFeedbackPtr k; PtrFeedbackPtr p; IntegerFeedbackPtr i; StringFeedbackPtr s; BellFeedbackPtr b; LedFeedbackPtr l; int rc; REQUEST(xChangeFeedbackControlReq); REQUEST_AT_LEAST_SIZE(xChangeFeedbac...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.orders; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.salesmanager.core.business.services.order.OrderService; import com.salesmanager.core.business.services.system.ModuleConfigurationService; import com.salesmanager.core.business.utils.ProductPriceUti...
vuln
Vulnerable
Java
public function getBranches() { if (null === $this->branches) { $branches = array(); $this->process->execute('git branch --no-color --no-abbrev -v', $output, $this->repoDir); foreach ($this->process->splitLines($output) as $branch) { if ($branch && !Preg:...
vuln
Safe
PHP
/* * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, Tom Huybrechts * * 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 ...
vuln
Vulnerable
Java
void Compute(OpKernelContext* context) override { const Tensor& contents = context->input(0); OP_REQUIRES(context, TensorShapeUtils::IsScalar(contents.shape()), errors::InvalidArgument("contents must be scalar, got shape ", contents.shape().DebugString()))...
vuln
Vulnerable
C/C++
int ff_unlock_avcodec(const AVCodec *codec) { if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init) return 0; av_assert0(ff_avcodec_locked); ff_avcodec_locked = 0; atomic_fetch_add(&entangled_thread_counter, -1); if (lockmgr_cb) { if ((*lockmgr_cb)(&codec_mutex, AV...
vuln
Vulnerable
C/C++
QUERY_REC *irc_query_find(IRC_SERVER_REC *server, const char *nick) { GSList *tmp; for (tmp = server->queries; tmp != NULL; tmp = tmp->next) { QUERY_REC *rec = tmp->data; if (server->nick_comp_func(rec->name, nick) == 0) return rec; } return NULL; }
vuln
Vulnerable
Unknown
package golf import ( "crypto/rand" "encoding/hex" ) const chars = "abcdefghijklmnopqrstuvwxyz0123456789" func randomBytes(strlen int) []byte { b := make([]byte, strlen) _, err := rand.Read(b) if err != nil { // panic on failure since this indicates a failure of the system's // CSPRNG panic(err) } retur...
vuln
Safe
Go
void migration_bitmap_extend(ram_addr_t old, ram_addr_t new) { if (migration_bitmap_rcu) { struct BitmapRcu *old_bitmap = migration_bitmap_rcu, *bitmap; bitmap = g_new(struct BitmapRcu, 1); bitmap->bmap = bitmap_new(new); qemu_mutex_lock(&migration_bitmap_mutex); ...
vuln
Safe
C/C++
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
vuln
Safe
Java
@NonNull private RoleMap getRoleMap(RoleType roleType) { switch (roleType) { case Global: return globalRoles; case Project: return itemRoles; case Slave: return agentRoles; default: throw new IllegalArgumentException("Unknown RoleType: " + roleType); } ...
vuln
Vulnerable
Java
void GetPreviewDataForIndex(int index, scoped_refptr<base::RefCountedBytes>* data) { if (IsInvalidIndex(index)) return; PreviewPageDataMap::iterator it = page_data_map_.find(index); if (it != page_data_map_.end()) *data = it->second.get(); }
vuln
Safe
C/C++
@Override public void onMessage(@NotNull WebSocket webSocket, @NotNull ByteString byteString) { String message = byteString.utf8(); JsonElement messageElement = JsonParser.parseString(message); checkState(messageElement instanceof JsonObject, "Message must be a JsonObject! Received: %s", me...
vuln
Safe
Java
int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, uint8_t* buf, int buf_size) { int size, i; uint8_t *ppcm[4] = {0}; if (buf_size < DV_PROFILE_BYTES || !(c->sys = dv_frame_profile(buf)) || buf_size < c->sys->frame_size) { return -1; } ...
vuln
Vulnerable
C/C++
static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int log2w, int log2h, int stride) { const int index = size2index[log2h][log2w]; const int h = 1 << log2h; int code = get_vlc2(&f->gb, block_type_vlc[1 - (f->version > ...
vuln
Safe
C/C++
static ssize_t status_show(struct device *dev, struct device_attribute *attr, char *buf) { char *status; switch (to_devlink(dev)->status) { case DL_STATE_NONE: status = "not tracked"; break; case DL_STATE_DORMANT: status = "dormant"; break; case DL_STATE_AVAILABLE: status = "available"; break; case DL...
vuln
Vulnerable
Unknown
static void skel(const char *homedir, uid_t u, gid_t g) { char *fname; if (!arg_shell_none && (strcmp(cfg.shell,"/usr/bin/zsh") == 0 || strcmp(cfg.shell,"/bin/zsh") == 0)) { if (asprintf(&fname, "%s/.zshrc", homedir) == -1) errExit("asprintf"); struct stat s; if (stat(fname, &s) == 0) return; if (st...
vuln
Safe
C/C++
$scope.deleteNode = function(node) { bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) { if (ok) { RequisitionsService.startTiming(); RequisitionsService.deleteNode(node).then( function() { // success var index = ...
vuln
Vulnerable
JavaScript
TfLiteStatus PrepareHashtableSize(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input_resource_id_tensor = GetInput(context, node, kInputResourceIdTensor); TF_LITE_ENSURE_EQ(context, input_r...
vuln
Vulnerable
C/C++
@Override public boolean finishReceiverLocked(@NonNull ProcessRecord app, int resultCode, @Nullable String resultData, @Nullable Bundle resultExtras, boolean resultAbort, boolean waitForServices) { final BroadcastProcessQueue queue = getProcessQueue(app); final BroadcastRecor...
vuln
Vulnerable
Java
def _get_chap_secret_for_host(self, host_name): """Return the CHAP secret for the given host.""" LOG.debug(_('enter: _get_chap_secret_for_host: host name %s') % host_name) ssh_cmd = ['svcinfo', 'lsiscsiauth', '-delim', '!'] out, err = self._run_ssh(ssh_cmd) i...
vuln
Safe
Python
static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s) { AVIOContext *pb; WtvFile *wf; uint8_t *buffer; if (avio_seek(s->pb, (int64_t)first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0) return NULL; wf = av_mallocz(sizeof(WtvFile)); if (!wf...
vuln
Safe
C/C++
public Map<Object, Object> uploadMDImg(MultipartFile image, Long gid) throws StatusFailException, StatusSystemErrorException, StatusForbiddenException { Session session = SecurityUtils.getSubject().getSession(); UserRolesVo userRolesVo = (UserRolesVo) session.getAttribute("userInfo"); boolean i...
vuln
Vulnerable
Java
def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None: pd = import_pandas() from arize.utils.types import ( EmbeddingColumnNames, Environments, ModelTypes, Schema, ) # Safe check if 'llm_output' and 'token_usage' exist i...
vuln
Safe
Python
void GpuProcessHost::OnProcessCrashed(int exit_code) { int process_crash_exit_code = exit_code; base::debug::Alias(&process_crash_exit_code); if (activity_flags_.IsFlagSet( gpu::ActivityFlagsBase::FLAG_LOADING_PROGRAM_BINARY)) { for (auto cache_key : client_id_to_shader_cache_) { GetShader...
vuln
Vulnerable
C/C++
long SeekHead::Parse() { IMkvReader* const pReader = m_pSegment->m_pReader; long long pos = m_start; const long long stop = m_start + m_size; int entry_count = 0; int void_element_count = 0; while (pos < stop) { long long id, size; const long status = ParseElementHeader(pReader, pos, stop, id, size); if ...
vuln
Safe
C/C++
bool Crypto::get_random_values(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = CallArgsFromVp(argc, vp); if (!args.requireAtLeast(cx, "crypto.getRandomValues", 1)) return false; if (!args[0].isObject() || !is_int_typed_array(&args[0].toObject())) { JS_ReportErrorUTF8(cx, "crypto.getRan...
vuln
Vulnerable
Unknown
package com.salesmanager.shop.admin.controller.user; import com.salesmanager.core.business.services.user.GroupService; import com.salesmanager.core.model.user.Group; import com.salesmanager.core.model.user.GroupType; import com.salesmanager.shop.admin.model.web.Menu; import org.springframework.stereotype.Controller; i...
vuln
Safe
Java
static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata) { struct nfs4_state *state = opendata->state; struct nfs_inode *nfsi = NFS_I(state->inode); struct nfs_delegation *delegation; int open_mode = opendata->o_arg.open_flags & (FMODE_READ|FMODE_WRITE|O_EXCL); nfs4_stateid stateid; int ret ...
vuln
Vulnerable
C/C++
@Override protected BakedModel bake() { Map<Direction, ImmutableList.Builder<Vertex>> faceVertexesBuilder = new EnumMap<>(Direction.class); Arrays.stream(values()).forEach(direction -> faceVertexesBuilder.put(direction, ImmutableList.builder())); ImmutableList.Builder<Vertex> vertexes = Immu...
vuln
Vulnerable
Java
def render_POST(self, request): send_cors(request) if self.require_auth: authV2(self.sydent, request) args = get_args(request, ("medium", "address", "room_id", "sender",)) medium = args["medium"] address = args["address"] roomId = args["room_id"] sen...
vuln
Vulnerable
Python
/* Copyright 2017 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
Vulnerable
Python
void CLASS rollei_load_raw() { uchar pixel[10]; unsigned iten=0, isix, i, buffer=0, todo[16]; isix = raw_width * raw_height * 5 / 8; while (fread (pixel, 1, 10, ifp) == 10) { #ifdef LIBRAW_LIBRARY_BUILD checkCancel(); #endif for (i=0; i < 10; i+=2) { todo[i] = iten++; todo[i+1] = pixel[i]...
vuln
Vulnerable
Unknown
void eb_read_bin(eb_t a, const uint8_t *bin, int len) { if (len == 1) { if (bin[0] == 0) { eb_set_infty(a); return; } else { RLC_THROW(ERR_NO_BUFFER); return; } } if (len != (RLC_FB_BYTES + 1) && len != (2 * RLC_FB_BYTES + 1)) { RLC_THROW(ERR_NO_BUFFER); return; } a->coord = BASIC; fb_set_...
vuln
Vulnerable
C/C++
void Compute(OpKernelContext* context) override { typedef Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>> ConstEigenMatrixMap; typedef Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>> EigenMatrixMap; constexpr int tensor_in_and_out_dims = 4; const Tensor&...
vuln
Safe
C/C++
userauth_hostbased(struct ssh *ssh) { Authctxt *authctxt = ssh->authctxt; struct sshbuf *b; struct sshkey *key = NULL; char *pkalg, *cuser, *chost; u_char *pkblob, *sig; size_t alen, blen, slen; int r, pktype, authenticated = 0; /* XXX use sshkey_froms() */ if ((r = sshpkt_get_cstring(ssh, &pkalg, &alen)) != ...
vuln
Safe
C/C++
public function view($id = FALSE) { $this->template->header->this_page = 'reports'; $this->template->content = new View('reports/detail'); // Load Akismet API Key (Spam Blocker) $api_akismet = Kohana::config('settings.api_akismet'); // Sanitize the report id before proceeding $id = intval($id); if ($i...
vuln
Vulnerable
PHP
evbuffer_chain_new(size_t size) { struct evbuffer_chain *chain; size_t to_alloc; if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE) return (NULL); size += EVBUFFER_CHAIN_SIZE; /* get the next largest memory that can hold the buffer */ if (size < EVBUFFER_CHAIN_MAX / 2) { to_alloc = MIN_BUFFER_SIZE; whi...
vuln
Safe
Unknown
public V1AccessPermission build() { return new V1AccessPermission(resource, operations); }
vuln
Safe
Java
z(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){null!=this.textarea&&(0<=this.textarea.innerHTML.indexOf("<o:OfficeDocumentSettings>")||0<=this.textarea.innerHTML.indexOf("\x3c!--[if !mso]>")?B(this.textarea,M):Graph.removePasteFormatting(this.textarea))}),0)}))};mxCellEditor...
vuln
Vulnerable
JavaScript
av_cold int ff_dcaadpcm_init(DCAADPCMEncContext *s) { if (!s) return -1; s->private_data = av_malloc(sizeof(premultiplied_coeffs) * DCA_ADPCM_VQCODEBOOK_SZ); precalc(s->private_data); return 0; }
vuln
Vulnerable
C/C++
public synchronized void pruneAvatars() { android.util.Log.i("IRCCloud", "Pruning avatar cache"); for (HashMap<String, Avatar> cid : avatars.values()) { ArrayList<Avatar> avs = new ArrayList<>(cid.values()); try { Collections.sort(avs, new Comparator<Avatar>() { ...
vuln
Safe
Java
def _convert_states_v46_dict_to_v47_dict(cls, states_dict): """Converts from version 46 to 47. Version 52 deprecates oppia-noninteractive-svgdiagram tag and converts existing occurences of it to oppia-noninteractive-image tag. Args: states_dict: dict. A dict where each key-v...
vuln
Vulnerable
Python
static inline void hcscale_fast_c(SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc) { int i; unsigned int xpos=0; for (i=0;i<dstWidth;i++) { register unsigned in...
vuln
Vulnerable
C/C++
static void dump_qobject(fprintf_function func_fprintf, void *f, int comp_indent, QObject *obj) { switch (qobject_type(obj)) { case QTYPE_QINT: { QInt *value = qobject_to_qint(obj); func_fprintf(f, "%" PRId64, qint_get_int(value)); break; ...
vuln
Safe
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