code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
int setTypeAdd(robj *subject, sds value) {
long long llval;
if (subject->encoding == OBJ_ENCODING_HT) {
dict *ht = subject->ptr;
dictEntry *de = dictAddRaw(ht,value,NULL);
if (de) {
dictSetKey(ht,de,sdsdup(value));
dictSetVal(ht,de,NULL);
return 1;
... | vuln | Safe | C/C++ |
async def query_devices(
self,
query_body: JsonDict,
timeout: int,
from_user_id: str,
from_device_id: Optional[str],
) -> JsonDict:
"""Handle a device key query from a client
{
"device_keys": {
"<user_id>": ["<device_id>"]
... | vuln | Vulnerable | Python |
def render_prefs_panel(self, panelid, action=None, **kwargs): # @UnusedVariable
# Process the parameters.
if cherrypy.request.method == 'POST' and action == "set_notification_info":
self._handle_set_notification_info(**kwargs)
params = {
'email': self.app.currentuser.em... | vuln | Safe | Python |
document.createElement("link");N.setAttribute("rel","preload");N.setAttribute("href",T);N.setAttribute("as","font");N.setAttribute("crossorigin","");E.parentNode.insertBefore(N,E)}}}};Editor.trimCssUrl=function(u){return u.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="h... | vuln | Vulnerable | JavaScript |
_gnutls_asn1_get_structure_xml(ASN1_TYPE structure,
gnutls_datum_t * res, int detail)
{
node_asn *p, *root;
int k, indent = 0, len, len2, len3;
opaque tmp[1024];
char nname[256];
int ret;
gnutls_string str;
if (res == NULL || structure == NULL) {
gnutls_assert();
return GNUTLS_E... | vuln | Safe | Unknown |
public static void sendMessageToClient(Component component) {
player().sendMessage(component, Util.NIL_UUID);
} | vuln | Vulnerable | Java |
@Override
public boolean onCommandEssentials(final CommandSender cSender, final Command command, final String commandLabel, final String[] args, final ClassLoader classLoader, final String commandPath, final String permissionPrefix, final IEssentialsModule module) {
// Allow plugins to override the command ... | vuln | Safe | Java |
IOInstEnding s390_ccw_cmd_request(SubchDev *sch)
{
S390CCWDeviceClass *cdc = S390_CCW_DEVICE_GET_CLASS(sch->driver_data);
if (!cdc->handle_request) {
return IOINST_CC_STATUS_PRESENT;
}
return cdc->handle_request(sch);
} | vuln | Safe | C/C++ |
static void ClearMetadata(VP8LMetadata* const hdr) {
assert(hdr != NULL);
WebPSafeFree(hdr->huffman_image_);
WebPSafeFree(hdr->huffman_tables_);
VP8LHtreeGroupsFree(hdr->htree_groups_);
VP8LColorCacheClear(&hdr->color_cache_);
VP8LColorCacheClear(&hdr->saved_color_cache_);
InitMetadata(hdr);
} | vuln | Vulnerable | C/C++ |
PHP_FUNCTION(imagegammacorrect)
{
zval *IM;
gdImagePtr im;
int i;
double input, output;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) {
return;
}
if ( input <= 0.0 || output <= 0.0 ) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positi... | vuln | Safe | C/C++ |
static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
struct hrtimer_clock_base *base,
struct hrtimer *timer, ktime_t *now)
{
enum hrtimer_restart (*fn)(struct hrtimer *);
int restart;
lockdep_assert_held(&cpu_base->lock);
debug_deactivate(timer);
cpu_base->running = timer;
/*
* Separate the... | vuln | Safe | Unknown |
package controller_admin
import (
"github.com/answerdev/answer/internal/base/handler"
"github.com/answerdev/answer/internal/base/middleware"
"github.com/answerdev/answer/internal/schema"
"github.com/answerdev/answer/internal/service/user_admin"
"github.com/gin-gonic/gin"
)
// UserAdminController user controller
... | vuln | Vulnerable | Go |
@SuppressWarnings("unused")
public static boolean replaceShellCommand(IBinder obj, int code, long dataObj, long replyObj, int flags) {
Parcel data = ParcelUtils.fromNativePointer(dataObj);
Parcel reply = ParcelUtils.fromNativePointer(replyObj);
if (data == null || reply == null) {
... | vuln | Safe | Java |
public static Optional<List<String>> readData() {
try {
//if data.txt does not exist it will be created and filled with initial values
if (!DataFile.dataFile().exists()) {
Files.createFile(Paths.get(DataFile.dataFile().getPath()));
initFile(DataFile.dataFi... | vuln | Safe | Java |
static void sample_to_timespec(const clockid_t which_clock,
union cpu_time_count cpu,
struct timespec *tp)
{
if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED)
*tp = ns_to_timespec(cpu.sched);
else
cputime_to_timespec(cpu.cpu, tp);
} | vuln | Safe | C/C++ |
void svhandler_flash_pgm_blk(void) {
uint32_t beginAddr = _param_1;
uint32_t data = _param_2;
uint32_t length = _param_3;
// Verify requested address range is allowed.
if (!allow_svhandler_flash_range(beginAddr, beginAddr + length)) return;
// Unlock flash.
flash_clear_status_flags();
flash_unlock();
... | vuln | Safe | Unknown |
int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
VP56Context *s = avctx->priv_data;
AVFrame *const p = s->frames[VP56_FRAME_CURRENT];
int remaining_buf_size = avpkt->size;
int av_uninit(alpha_off... | vuln | Vulnerable | C/C++ |
def get_title_from_youtube_url(url):
try:
output = str(subprocess.check_output('youtube-dl --get-title %s --no-warnings' % url, stderr=subprocess.STDOUT,
shell=True)).strip()
except subprocess.CalledProcessError as ex:
output = str(ex.output).strip()
... | vuln | Vulnerable | Python |
func SanitizePath(path string) string {
path = strings.TrimLeft(path, "/")
path = strings.Replace(path, "../", "", -1)
return path
} | vuln | Safe | Go |
/*
Copyright The Helm Authors.
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 agreed to in writing, software
di... | vuln | Safe | Go |
from django.contrib import admin
import import_export.widgets as widgets
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
from import_export.resources import ModelResource
import part.models as models
from company.models import SupplierPart
from stock.models import StockLo... | vuln | Vulnerable | Python |
void gf_inspect_format_timecode(const u8 *data, u32 size, u32 tmcd_flags, u32 tc_num, u32 tc_den, u32 tmcd_fpt, char szFmt[100]);
void DumpTrackInfo(GF_ISOFile *file, GF_ISOTrackID trackID, Bool full_dump, Bool is_track_num, Bool dump_m4sys)
{
char szCodec[RFC6381_CODEC_NAME_SIZE_MAX];
Double scale, max_rate, rate;
... | vuln | Safe | C/C++ |
build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
const byte *buffer, size_t buflen )
{
byte *p;
int critical, hashed;
subpktarea_t *oldarea, *newarea;
size_t nlen, n, n0;
critical = (type & SIGSUBPKT_FLAG_CRITICAL);
type &= ~SIGSUBPKT_FLAG_CRITICAL;
/* Sanity check buffer si... | vuln | Safe | Unknown |
def prepare_context(self, request, context, *args, **kwargs):
""" Hook for adding additional data to the context dict """
pass | vuln | Vulnerable | JavaScript |
public static void initialize()
{
LiquidEthaneMethane = registerFluid("liquidethanemethane", 1200, 140, 90, false, "liquid_ethanemethane");
Helium3 = registerFluid("helium3", -1000, 1000, 0, true, "liquid_helium3");
Ethane = registerFluid("ethane", -1000, 1000, 0, true, "liquid_ethane");
HeliumHydrogen = re... | vuln | Vulnerable | Java |
async ls (specs) {
const cachePath = path.join(this.npm.cache, '_cacache')
const cacheKeys = Object.keys(await cacache.ls(cachePath))
if (specs.length > 0) {
// get results for each package spec specified
const results = new Set()
for (const spec of specs) {
const keySet = await se... | vuln | Vulnerable | JavaScript |
evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen)
{
struct evbuffer_chain *chain, **chainp;
struct evbuffer_chain *result = NULL;
ASSERT_EVBUFFER_LOCKED(buf);
chainp = buf->last_with_datap;
/* XXX If *chainp is no longer writeable, but has enough space in its
* misalign, this might be a bad idea... | vuln | Safe | Unknown |
int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame,
int64_t pts, AVRational pixel_aspect, int width,
int height, enum PixelFormat pix_fmt,
const char *sws_param)
{
BufferSourceContext *c = buffer_fil... | vuln | Vulnerable | C/C++ |
void CMsgReader::readExtendedClipboard(rdr::S32 len)
{
rdr::U32 flags;
rdr::U32 action;
if (len < 4)
throw Exception("Invalid extended clipboard message");
if (len > maxCutText) {
vlog.error("Extended clipboard message too long (%d bytes) - ignoring", len);
is->skip(len);
return;
}
flags =... | vuln | Vulnerable | C/C++ |
public static DocumentBuilder createDocumentBuilder()
{
final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
docFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
try
{
... | vuln | Safe | Java |
void RemoteFsDevice::unmount()
{
if (details.isLocalFile()) {
return;
}
if (!isConnected() || proc) {
return;
}
if (messageSent) {
return;
}
QString cmd;
QStringList args;
if (!details.isLocalFile()) {
QString mp=mountPoint(details, false);
... | vuln | Safe | Unknown |
# 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 applica... | vuln | Safe | Python |
@Override
public void createTable(int nArr, int nRec) {
checkStack(1);
C.lua_createtable(L, nArr, nArr);
} | vuln | Safe | Java |
main (int argc, char **argv)
{
char *keys;
size_t keycc, oldcc, keyalloc;
int with_filenames;
int opt, cc, status, prepended;
int prev_optind, last_recursive;
int default_context;
FILE *fp;
exit_failure = EXIT_TROUBLE;
initialize_main (&argc, &argv);
set_program_name (argv[0]);
program_name = arg... | vuln | Vulnerable | Unknown |
PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
{
zval **ppid;
zval **data;
char *p, *value;
int nrand;
int lensess;
if (PS(use_only_cookies)) {
PS(apply_trans_sid) = 0;
} else {
PS(apply_trans_sid) = PS(use_trans_sid);
}
switch (PS(session_status)) {
case php_session_active:
php_error(E_NOTICE, "... | vuln | Vulnerable | Unknown |
evbuffer_drain(struct evbuffer *buf, size_t len)
{
struct evbuffer_chain *chain, *next;
size_t remaining, old_len;
int result = 0;
EVBUFFER_LOCK(buf);
old_len = buf->total_len;
if (old_len == 0)
goto done;
if (buf->freeze_start) {
result = -1;
goto done;
}
if (len >= old_len && !HAS_PINNED_R(buf)) {
... | vuln | Safe | Unknown |
dns_call_found(u8_t idx, ip_addr_t* addr)
{
u8_t i;
LWIP_UNUSED_ARG(i);
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0)
for (i = 0; i < DNS_MAX_REQUESTS; i++) {
if (dns_requests[i].found && (dns_requests[i].dns_table_idx == idx)) {
(*dns_requests[i].found)(dns_table[idx].name, ad... | vuln | Safe | Unknown |
async login(ctx) {
const {
body: { password },
} = ctx.request;
const { password: storedPassword } = await strapi
.store({
environment: '',
type: 'plugin',
name: 'documentation',
key: 'config',
})
.get();
const isValid = await strapi.plugins['use... | vuln | Vulnerable | JavaScript |
void ed_map(ed_t p, const uint8_t *msg, int len) {
ed_map_dst(p, msg, len, (const uint8_t *)"RELIC", 5);
} | vuln | Vulnerable | C/C++ |
void CALLBACK host_alarm_handler(UINT uTimerID, UINT uMsg,
DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
#else
static void host_alarm_handler(int host_signum)
#endif
{
#if 0
#define DISP_FREQ 1000
{
static int64_t delta_min = INT64_MAX;
static int64_t delta_max, de... | vuln | Vulnerable | C/C++ |
PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval *rval_ref;
limit = max;
cursor = *p;
if (YYCURSOR >= YYLIMIT) {
return 0;
}
if (var_hash && (*p)[0] != 'R') {
var_push(var_hash, rval);
}
start = cursor;
#line 526 "ext/standard/var_u... | vuln | Vulnerable | Unknown |
XIQueryDevice(Display *dpy, int deviceid, int *ndevices_return)
{
XIDeviceInfo *info = NULL;
xXIQueryDeviceReq *req;
xXIQueryDeviceReq *req;
xXIQueryDeviceReply reply;
char *ptr;
int i;
char *buf;
LockDisplay(dpy);
if (_... | vuln | Vulnerable | C/C++ |
int av_grow_packet(AVPacket *pkt, int grow_by)
{
int new_size;
av_assert0((unsigned)pkt->size <= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE);
if ((unsigned)grow_by >
INT_MAX - (pkt->size + AV_INPUT_BUFFER_PADDING_SIZE))
return -1;
new_size = pkt->size + grow_by + AV_INPUT_BUFFER_PADDING_SIZE... | vuln | Safe | C/C++ |
static void get_sensor_type(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
IPMISensor *sens;
IPMI_CHECK_CMD_LEN(3);
if ((cmd[2] > MAX_SENSORS) |... | vuln | Vulnerable | C/C++ |
public static <T extends Entity> List<T> findEntitiesRough(
Class<T> entityClass,
Level world,
Vec3 center,
int radiusChunks,
Predicate<T> predicate
) {
// the minimum is 1
if (radiusChunks <= 0) {
radiusChunks = 1;
}
if (r... | vuln | Safe | Java |
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholiqu... | vuln | Vulnerable | C/C++ |
static int read_private_key(RSA *rsa)
{
int r;
sc_path_t path;
sc_file_t *file;
const sc_acl_entry_t *e;
u8 buf[2048], *p = buf;
size_t bufsize, keysize;
r = select_app_df();
if (r)
return 1;
sc_format_path("I0012", &path);
r = sc_select_file(card, &path, &file);
if (r) {
fprintf(stderr, "Unable to sel... | vuln | Safe | Unknown |
private void onDiseqcMessage(byte[] diseqcMessage) {
if (mExecutor != null && mCallback != null) {
mExecutor.execute(() -> mCallback.onDiseqcMessage(diseqcMessage));
}
} | vuln | Vulnerable | Java |
char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
static const struct {
const char *suffix;
usec_t usec;
} table[] = {
{ "y", USEC_PER_YEAR },
{ "month", USEC_PER_MONTH },
{ "w", USEC_PER_WEE... | vuln | Safe | C/C++ |
void HeaderMapImpl::addViaMove(HeaderString&& key, HeaderString&& value) {
// If this is an inline header, we can't addViaMove, because we'll overwrite
// the existing value.
auto* entry = getExistingInline(key.getStringView());
if (entry != nullptr) {
const uint64_t added_size = appendToHeader(entry->value... | vuln | Safe | C/C++ |
/* $Id$ */
/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
* the image data through additional options listed below
*
* Original code:
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
* Additions (c) Richard Nolde 2006-2010
*
* Permission to use, ... | vuln | Safe | C/C++ |
public MQProducer getInstance(String nameServerAddress, String group) throws MQClientException {
if (StringUtils.isBlank(group)) {
group = DEFAULT_GROUP;
}
String genKey = genKey(nameServerAddress, group);
MQProducer p = getProducerInstance().producerMap.get(genKey);
... | vuln | Safe | Java |
OM_uint32 KRB5_CALLCONV
gss_verify_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t *qop_state, gss_iov_buffer_desc *iov,
int iov_count)
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_unwrap_iov_args(minor_status, context_handle, NULL,
... | vuln | Safe | C/C++ |
void ComputeAsync(OpKernelContext* context, DoneCallback done) final {
const Tensor& input = context->input(0);
const Tensor& rhs = context->input(1);
const int ndims = input.dims();
const int64 n = input.dim_size(ndims - 1);
const int64 nrhs = rhs.dim_size(ndims - 1);
// Validate inputs.
OP... | vuln | Vulnerable | C/C++ |
@Override
public Collection<Header> getCustomRequestHeaders(HttpSession session, HttpServletRequest originalRequest,
String targetServiceName) {
// Don't use this provider for trusted request
if (isPreAuthorized(originalRequest) || isAnnonymous()) {
return Collections.emptyL... | vuln | Safe | Java |
public Authenticated authenticate(UsernamePasswordToken token) {
String fullName = null;
String email = null;
Collection<String> groupNames = null;
Collection<String> sshKeys = null;
Name userSearchBase;
try {
userSearchBase = new CompositeName().add(getUserSearchBase());
} catch (InvalidN... | vuln | Safe | Java |
next_line(struct archive_read *a,
const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl)
{
ssize_t len;
int quit;
quit = 0;
if (*avail == 0) {
*nl = 0;
len = 0;
} else
len = get_line_size(*b, *avail, nl);
/*
* Read bytes more while it does not reach the end of line.
*/
while (*nl == 0 && ... | vuln | Vulnerable | Unknown |
static void lo_write_buf(fuse_req_t req, fuse_ino_t ino,
struct fuse_bufvec *in_buf, off_t off,
struct fuse_file_info *fi)
{
(void)ino;
ssize_t res;
struct fuse_bufvec out_buf = FUSE_BUFVEC_INIT(fuse_buf_size(in_buf));
bool cap_fsetid_dropped = false;
... | vuln | Safe | Unknown |
strncat_from_utf8_libarchive2(struct archive_string *as,
const void *_p, size_t len, struct archive_string_conv *sc)
{
const char *s;
int n;
char *p;
char *end;
uint32_t unicode;
#if HAVE_WCRTOMB
mbstate_t shift_state;
memset(&shift_state, 0, sizeof(shift_state));
#else
/* Clear the shift state before star... | vuln | Vulnerable | C/C++ |
@Override
public void run() {
ReentrantLock active = null;
synchronized (actives) {
if (actives.containsKey(this.dstFile)) {
active = actives.get(this.dstFile);
} else {
active = new ReentrantLock();
actives.put(this.dstFile, ac... | vuln | Safe | Java |
@GetMapping(value=LICENSE.AUTOCOMPLETE_AJAX)
public @ResponseBody ResponseEntity<Object> autoCompleteAjax(
LicenseMaster licenseMaster
, HttpServletRequest req
, HttpServletResponse res
, Model model){
List<LicenseMaster> list = licenseService.getLicenseNameList();
return makeJsonResponseHeader(list... | vuln | Vulnerable | Java |
private static List<Snark> search(String search, Collection<Snark> snarks) {
List<String> searchList = null;
String[] terms = DataHelper.split(search, " ");
for (int i = 0; i < terms.length; i++) {
String term = terms[i];
if (term.length() > 0) {
if (searc... | vuln | Vulnerable | Java |
pvscsi_ring_pop_req_descr(PVSCSIRingInfo *mgr)
{
uint32_t ready_ptr = RS_GET_FIELD(mgr, reqProdIdx);
if (ready_ptr != mgr->consumed_ptr) {
uint32_t next_ready_ptr =
mgr->consumed_ptr++ & mgr->txr_len_mask;
uint32_t next_ready_page =
return mgr->req_ring_pages_pa[next_... | vuln | Vulnerable | Unknown |
Status UncompressElement(const CompressedElement& compressed,
std::vector<Tensor>* out) {
int num_components = compressed.component_metadata_size();
out->clear();
out->reserve(num_components);
// Step 1: Prepare the memory that we will uncompress into.
std::vector<struct iovec> iov(n... | vuln | Safe | C/C++ |
TPM2B_MAX_BUFFER_Marshal(TPM2B_MAX_BUFFER *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | vuln | Vulnerable | Unknown |
@Override
@SuppressWarnings("deprecation")
public void handleRequest(HttpServerExchange exchange) throws Exception {
final var sc = exchange.getSecurityContext();
if (sc != null) {
authenticatorMechanisms.stream().forEachOrdered(mechanism -> sc.addAuthenticationMechanism(new Authent... | vuln | Vulnerable | Java |
static void mov_read_chapters(AVFormatContext *s)
{
MOVContext *mov = s->priv_data;
AVStream *st = NULL;
MOVStreamContext *sc;
int64_t cur_pos;
int i;
for (i = 0; i < s->nb_streams; i++)
if (s->streams[i]->id == mov->chapter_track) {
st = s->streams[i];
break;
... | vuln | Vulnerable | C/C++ |
ast_for_with_stmt(struct compiling *c, const node *n0, bool is_async)
{
const node * const n = is_async ? CHILD(n0, 1) : n0;
int i, n_items, end_lineno, end_col_offset;
asdl_seq *items, *body;
REQ(n, with_stmt);
n_items = (NCH(n) - 2) / 2;
items = _Py_asdl_seq_new(n_items, c->c_arena);
if ... | 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 |
public LogicalTriggerExecution lookupTriggers(AlgRoot logicalRoot) {
Long tableId = logicalRoot.alg.getTable().getTable().getTableId();
List<AlgNode> algNodes = searchTriggers(tableId)
.stream()
.map(CatalogTrigger::getDefinition)
.collect(Collectors.toLis... | vuln | Vulnerable | Java |
public int getTotalUnreadCountForSupportGroup(int status) {
int count = 0;
SQLiteDatabase db = dbHelper.getWritableDatabase();
try {
String statusQuery = status == 2 ? "kmStatus in (1, 2)" : "kmStatus = ?";
String sql = "select sum(" + MobiComDatabaseHelper.UNREAD_COUNT ... | vuln | Safe | Java |
private void handleKeyguardDone() {
Trace.beginSection("KeyguardViewMediator#handleKeyguardDone");
final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
mUiBgExecutor.execute(() -> {
if (mLockPatternUtils.isSecure(currentUser)) {
mLockPatternUtils.getDeviceP... | vuln | Vulnerable | Java |
static jobject
getMethodAt(JNIEnv *env, jobject constantPoolOop, jint cpIndex, UDATA resolveFlags)
{
jobject returnValue = NULL;
J9VMThread *vmThread = (J9VMThread *) env;
J9InternalVMFunctions *vmFunctions = vmThread->javaVM->internalVMFunctions;
SunReflectCPResult result = NULL_POINTER_EXCEPTION;
jmethodID metho... | vuln | Vulnerable | C/C++ |
uint64_t qcow2_alloc_cluster_offset(BlockDriverState *bs,
uint64_t offset,
int n_start, int n_end,
int *num, QCowL2Meta *m)
{
BDRVQcowState *s = bs->opaque;
int l2_index, ret;
uint64_t l2_offset, *l2_... | vuln | Vulnerable | C/C++ |
static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
unsigned long old_addr, unsigned long old_end,
struct vm_area_struct *new_vma, pmd_t *new_pmd,
unsigned long new_addr, bool need_rmap_locks, bool *need_flush)
{
struct mm_struct *mm = vma->vm_mm;
pte_t *old_pte, *new_pte, pte;
spinlock_t *old_pt... | vuln | Vulnerable | Unknown |
@VisibleForTesting
protected static String detectXMLFileType(final InputStream in) throws XMLStreamException {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
while (eventReader.hasNext()) {
XMLEve... | vuln | Vulnerable | Java |
static void dump_map_entry(OutputFormat output_format, MapEntry *e,
MapEntry *next)
{
switch (output_format) {
case OFORMAT_HUMAN:
if ((e->flags & BDRV_BLOCK_DATA) &&
!(e->flags & BDRV_BLOCK_OFFSET_VALID)) {
error_report("File contains external, encrypt... | vuln | Vulnerable | C/C++ |
public void updateLogs(int id, List<Diagnostic<? extends JavaFileObject>> diagnostics) {
if (log == null) {
log = init();
}
MutableLiveData<List<DiagnosticWrapper>> logData = this.log.get(id);
logData.setValue(diagnostics.stream()
.map(DiagnosticWrapper::new)
... | vuln | Vulnerable | Java |
function K(n){return function(r){var t=n(r);return"number"==typeof t&&t>=0&&t<=m}} | vuln | Safe | JavaScript |
PHPAPI char *php_lookup_class_name(zval *object, zend_uint *nlen)
{
zval **val;
char *retval = NULL;
HashTable *object_properties;
TSRMLS_FETCH();
object_properties = Z_OBJPROP_P(object);
if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS) {
... | vuln | Vulnerable | C/C++ |
NTSTATUS change_notify_create(struct files_struct *fsp,
uint32_t max_buffer_size,
uint32_t filter,
bool recursive)
{
size_t len = fsp_fullbasepath(fsp, NULL, 0);
char fullpath[len+1];
NTSTATUS status = NT_STATUS_NOT_IMPLEMENTED;
/*
* Setting a changenotify needs READ/LIST access
* on... | vuln | Safe | Unknown |
protected Subject authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException {
if(isInternalOnly() && request.getAttribute(XQueryURLRewrite.RQ_ATTR) == null) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return null;
}
... | vuln | Safe | Java |
@Override
public void render(T entity, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) {
int rotation = 0;
int meta = 0;
if(MODEL_PIXIE == null){
MODEL_PIXIE = new ModelPixie();
}
if (entity !=... | vuln | Vulnerable | Java |
def get_max_task_id_for_project(project_id: int):
"""Gets the nights task id currently in use on a project"""
sql = """select max(id) from tasks where project_id = :project_id GROUP BY project_id"""
result = db.engine.execute(text(sql), project_id=project_id)
if result.rowcount == 0:
... | vuln | Safe | Python |
private WorkflowTrace loadWorkflowTrace() {
WorkflowTrace trace = null;
if (config.getWorkflowInput() != null) {
try {
trace = WorkflowTraceSerializer.secureRead(new FileInputStream(new File(config.getWorkflowInput())));
LOGGER.debug("Loaded workflow trace fr... | vuln | Safe | Java |
#
# Async wrapper module for managerlib methods, with glib integration
#
# Copyright (c) 2010 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... | vuln | Safe | Python |
void server_options(char **args, int *argc_p)
{
static char argstr[64];
int ac = *argc_p;
uchar where;
char *arg;
int i, x;
/* This should always remain first on the server's command-line. */
args[ac++] = "--server";
if (daemon_over_rsh > 0) {
args[ac++] = "--daemon";
*argc_p = ac;
/* if we're passing -... | vuln | Safe | Unknown |
inline const TfLiteTensor* GetIntermediates(TfLiteContext* context,
const TfLiteNode* node, int index) {
return &context->tensors[node->intermediates->data[index]];
} | vuln | Vulnerable | C/C++ |
static int svag_read_header(AVFormatContext *s)
{
unsigned size, align;
AVStream *st;
avio_skip(s->pb, 4);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
size = avio_rl32(s->pb);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_... | 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 | Safe | Java |
public void setImage(int index, Image image) {
checkWidget();
if (image != null && image.isDisposed()) {
error(SWT.ERROR_INVALID_ARGUMENT);
}
if (image != null && image.type == SWT.ICON) {
if (image.equals(_getImage(index))) return;
}
int count = Math.max(1, parent.getColumnCount());
if (0 > index || index >... | vuln | Vulnerable | Java |
@Override
public RunCategory valueFromString(String string) {
try {
return RunCategory.valueOf(string);
} catch (IllegalArgumentException exception) {
return RunCategory.ANY;
}
} | vuln | Safe | Java |
export function store_isFeatFlagOn(store: Store, featureFlag: St): Bo {
return _.includes(store.siteFeatureFlags, featureFlag) ||
_.includes(store.serverFeatureFlags, featureFlag);
} | vuln | Vulnerable | Scala |
ga_add_string(garray_T *gap, char_u *p)
{
if (ga_grow(gap, 1) == FAIL)
return FAIL;
((char_u **)(gap->ga_data))[gap->ga_len++] = p;
return OK;
} | vuln | Safe | C/C++ |
int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info *esp)
{
u8 *tail;
int nfrags;
int esph_offset;
struct page *page;
struct sk_buff *trailer;
int tailen = esp->tailen;
if (x->encap) {
int err = esp6_output_encap(x, skb, esp);
if (err < 0)
return err;
}
if (!skb_cloned(skb... | vuln | Vulnerable | C/C++ |
void ff_xface_generate_face(uint8_t *dst, uint8_t * const src)
{
int h, i, j, k, l, m;
for (j = 0; j < XFACE_HEIGHT; j++) {
for (i = 0; i < XFACE_WIDTH; i++) {
h = i + j * XFACE_WIDTH;
k = 0;
for (l = i - 2; l <= i + 2; l++) {
for (m = j -... | vuln | Vulnerable | C/C++ |
static inline void gen_intermediate_code_internal(CPUState *env,
TranslationBlock *tb,
int search_pc)
{
DisasContext dc1, *dc = &dc1;
CPUBreakpoint *bp;
uint16_t *gen_opc_end;
int j, lj;
target_ulong ... | vuln | Vulnerable | C/C++ |
static void usb_net_handle_dataout(USBNetState *s, USBPacket *p)
{
int sz = sizeof(s->out_buf) - s->out_ptr;
struct rndis_packet_msg_type *msg =
(struct rndis_packet_msg_type *) s->out_buf;
uint32_t len;
#ifdef TRAFFIC_DEBUG
fprintf(stderr, "usbnet: data out len %zu\n", p->iov.size);
iov... | vuln | Vulnerable | C/C++ |
function renderSimpleTemplateWithValidators(formElement, template) {
var validators, validatorsCountWithoutRequired, validatorsTemplateContent;
assert('object' === $.type(formElement), 'Invalid parameter "formElement"', 1479035674);
renderSimpleTemplate(formElement, template);
validatorsTempla... | vuln | Vulnerable | JavaScript |
main (int argc, char *argv[])
{
struct nbd_handle *nbd;
/* We will connect to a custom nbdkit sh plugin which always fails
* on reads (with a precise spelling required for older nbdkit), and
* which delays responding to writes until a witness file no longer
* exists.
*/
const char *cmd[] = { "nbdkit",... | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.