code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
private String queryForApplicationTableName(final String datatable) {
SQLInjectionValidator.validateSQLInput(datatable);
final String sql = "SELECT application_table_name FROM x_registered_table where registered_table_name = ?";
String applicationTableName = "";
final SqlRowSet rowSet ... | vuln | Safe | Java |
char *QuotedString::extractFrom(char *input, char **endPtr) {
char *startPtr = input + 1; // skip the quote
char *readPtr = startPtr;
char *writePtr = startPtr;
char c;
char firstChar = *input;
char stopChar = firstChar; // closing quote is the same as opening quote
if (!isQuote(firstChar)) goto ERROR... | vuln | Safe | C/C++ |
void fp_write_str(char *str, size_t len, const fp_t a, unsigned int radix) {
bn_t t;
bn_null(t);
RLC_TRY {
bn_new(t);
fp_prime_back(t, a);
bn_write_str(str, len, t, radix);
} | vuln | Safe | C/C++ |
/*
* This file is part of the KubeVirt project
*
* 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 | Go |
PlainPasswd::PlainPasswd(size_t len) : CharArray(len) {
} | vuln | Safe | C/C++ |
public String execute(String[] args) {
NoCloseModule module = (NoCloseModule) FamilyFunPack.getModules().getByName("Silent close");
GuiScreen screen = module.getOpenedContainer();
if(screen == null) return "No container is currently opened";
MinecraftForge.EVENT_BUS.register(new GuiOpener(screen));
... | vuln | Vulnerable | Java |
run(code, filename) {
let dirname;
let resolvedFilename;
let script;
if (code instanceof VMScript) {
script = this.options.strict ? code._compileNodeVMStrict() : code._compileNodeVM();
resolvedFilename = pa.resolve(code.filename);
dirname = pa.dirname(resolvedFilename);
} else {
const unresolvedF... | vuln | Vulnerable | JavaScript |
public void destroy() {
submit(() -> {
QuickJSContext.destroy(ctx);
QuickJSContext.destroyRuntime(ctx);
});
} | vuln | Vulnerable | Java |
function layout_navbar() {
$t_logo_url = config_get('logo_url');
echo '<div id="navbar" class="navbar navbar-default navbar-collapse navbar-fixed-top noprint">';
echo '<div id="navbar-container" class="navbar-container">';
echo '<button id="menu-toggler" type="button" class="navbar-toggle menu-toggler pull-left h... | vuln | Vulnerable | PHP |
static void vnc_dpy_setdata(DisplayChangeListener *dcl,
DisplayState *ds)
{
VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(ds->surface->image);
vd->guest.format = ds->surface->format;
vnc_dpy_upd... | vuln | Safe | C/C++ |
import React from 'react';
import Immutable, { Map } from 'immutable';
import { format } from 'util';
import sync from './sync';
import * as l from './core/index';
import { dataFns } from './utils/data_utils';
const { get, set } = dataFns(['i18n']);
import enDictionary from './i18n/en';
import { load, preload } from '.... | vuln | Vulnerable | JavaScript |
/*
* Copyright 2007-8 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
*
* 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
* t... | vuln | Safe | C/C++ |
async function encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) {
const { V, Z } = await genPublicEphemeralKey(oid, cipher_algo, hash_algo, Q, fingerprint);
return {
V: new BN(V),
C: aes_kw.wrap(Z, m.toString())
};
} | vuln | Vulnerable | JavaScript |
static av_cold int atrac3_decode_init(AVCodecContext *avctx)
{
int i, ret;
int version, delay, samples_per_frame, frame_factor;
const uint8_t *edata_ptr = avctx->extradata;
ATRAC3Context *q = avctx->priv_data;
if (avctx->channels <= 0 || avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR, "Ch... | vuln | Vulnerable | C/C++ |
public function __construct($app = null)
{
if (is_object($app)) {
$this->app = $app;
} else {
$this->app = mw();
}
} | vuln | Safe | PHP |
dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *ppi_tree = NULL, *ppi_flags_tree = NULL, *seg_tree = NULL, *ampdu_tree = NULL;
proto_tree *agg_tree = NULL;
proto_item *ti = NULL;
tvbuff_t *next_tvb;
int offset = 0;
guint... | vuln | Vulnerable | C/C++ |
static int
_archive_write_disk_close(struct archive *_a)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
struct fixup_entry *next, *p;
int fd, ret;
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
"archive_write_disk_close");
ret = _... | vuln | Vulnerable | C/C++ |
public static void requestBlacklistsUpdate() {
if(INSTANCE != null) {
INSTANCE.mBlacklistsUpdateRequested = true;
// Wake the update thread to run the blacklist thread
INSTANCE.mPendingUpdates.push(new Pair<>(new ConnectionDescriptor[0], new ConnectionUpdate[0]));
}
... | vuln | Vulnerable | Java |
RCoreSymCacheElement *r_coresym_cache_element_new(RBinFile *bf, RBuffer *buf, ut64 off, int bits, char * file_name) {
RCoreSymCacheElement *result = NULL;
ut8 *b = NULL;
RCoreSymCacheElementHdr *hdr = r_coresym_cache_element_header_new (buf, off, bits);
if (!hdr) {
return NULL;
}
if (hdr->version != 1) {
epri... | vuln | Safe | Unknown |
static ssize_t sdp_svc_search(struct bt_l2cap_sdp_state_s *sdp,
uint8_t *rsp, const uint8_t *req, ssize_t len)
{
ssize_t seqlen;
int i, count, start, end, max;
int32_t handle;
for (i = 0; i < sdp->services; i ++)
sdp->service_list[i].match = 0;
if (len < 1)
retur... | vuln | Safe | C/C++ |
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
import import_export.widgets as widgets
from build.models import Build, BuildItem
from InvenTree.admin import InvenTreeResource
import part.models
class BuildResource(InvenTreeResource):
... | vuln | Safe | Python |
void fp48_read_bin(fp48_t a, const uint8_t *bin, size_t len) {
if (len != 32 * RLC_FP_BYTES && len != 48 * RLC_FP_BYTES) {
RLC_THROW(ERR_NO_BUFFER);
return;
}
if (len == 32 * RLC_FP_BYTES) {
fp8_zero(a[0][0]);
fp8_read_bin(a[0][1], bin, 8 * RLC_FP_BYTES);
fp8_read_bin(a[0][2], bin + 8 * RLC_FP_BYTES, 8 * R... | vuln | Safe | C/C++ |
MemTxResult gicv3_redist_write(void *opaque, hwaddr offset, uint64_t data,
unsigned size, MemTxAttrs attrs)
{
GICv3State *s = opaque;
GICv3CPUState *cs;
MemTxResult r;
int cpuidx;
assert((offset & (size - 1)) == 0);
cpuidx = offset / 0x20000;
offset %= 0x2... | vuln | Safe | C/C++ |
BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N)
{
/* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */
BIGNUM *u;
unsigned char cu[SHA_DIGEST_LENGTH];
unsigned char *cAB;
EVP_MD_CTX ctxt;
int longN;
if ((A == NULL) ||(B == NULL) || (N == NULL))
return NULL;
if ((A == NULL) ||(B == NULL) || (N... | vuln | Vulnerable | C/C++ |
static void svg_parse_preserveaspectratio(SVG_PreserveAspectRatio *par, char *attribute_content, GF_Err *out_e)
{
char *content = attribute_content;
while (*content == ' ') content++;
if (strstr(content, "defer")) {
par->defer = 1;
content += 5;
} else {
content = attribute_content;
}
while (*content == ' '... | vuln | Safe | C/C++ |
static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
Image *image)
{
ExceptionInfo
*exception;
MagickBooleanType
status;
MagickOffsetType
currentOffset,
offset,
scene;
MagickSizeType
cc;
PixelPacket
transpix;
QuantizeInfo
*quantize_info;
register Ind... | vuln | Vulnerable | C/C++ |
.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l-v,x));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(l-v),x-p));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x-p));return c};z.prototype.getConstraints=function(c,l,x){c=[];var p=x*Math.max(0,Math.min(1,parseFloat(mxUt... | vuln | Vulnerable | JavaScript |
main(int argc, char *argv[])
{
T_ASC_Parameters *params = NULL;
const char *opt_peer;
OFCmdUnsignedInt opt_port = 104;
DIC_NODENAME localHost;
DIC_NODENAME peerHost;
T_ASC_Association *assoc = NULL;
const char *opt_peerTitle = PEERAPPLICATIONTITLE;
const char *opt_ourTitle = APPLICATIONT... | vuln | Vulnerable | C/C++ |
CURLcode Curl_close(struct Curl_easy *data)
{
struct Curl_multi *m;
if(!data)
return CURLE_OK;
Curl_expire_clear(data); /* shut off timers */
m = data->multi;
if(m)
/* This handle is still part of a multi handle, take care of this first
and detach this handle from there. */
curl_multi_... | vuln | Vulnerable | C/C++ |
package udsserver
import (
"encoding/json"
"errors"
"fmt"
"k8s.io/klog/v2"
beehiveContext "github.com/kubeedge/beehive/pkg/core/context"
"github.com/kubeedge/beehive/pkg/core/model"
hubmodel "github.com/kubeedge/kubeedge/cloud/pkg/cloudhub/common/model"
"github.com/kubeedge/kubeedge/common/constants"
)
// S... | vuln | Safe | Go |
void acpi_ns_terminate(void)
{
acpi_status status;
ACPI_FUNCTION_TRACE(ns_terminate);
#ifdef ACPI_EXEC_APP
{
union acpi_operand_object *prev;
union acpi_operand_object *next;
/* Delete any module-level code blocks */
next = acpi_gbl_module_code_list;
while (next) {
prev = next;
next = next->... | vuln | Vulnerable | C/C++ |
void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
{
char buf[4096];
if (!mon)
return;
if (monitor_ctrl_mode(mon)) {
return;
}
vsnprintf(buf, sizeof(buf), fmt, ap);
monitor_puts(mon, buf);
} | vuln | Vulnerable | C/C++ |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { saveAs } from 'file-saver'
import { NullXlsx } from '@neovici/nullxlsx'
import './dailytimetable.html'
import './pagination.js'
import './limitpicker.js'
import {
getGlobalSetting,
numb... | vuln | Safe | JavaScript |
def get_crm_mon_dom(auth_user)
begin
stdout, _, retval = run_cmd(
auth_user, CRM_MON, '--one-shot', '-r', '--as-xml'
)
if retval == 0
return REXML::Document.new(stdout.join("\n"))
end
rescue
$logger.error 'Failed to parse crm_mon.'
end
return nil
end | vuln | Safe | Ruby |
public void setShouldShowLM_Nametag(final boolean doShow){
if (!getPDCLock()) return;
try {
if (doShow && getPDC().has(main.namespaced_keys.denyLM_Nametag, PersistentDataType.INTEGER))
getPDC().remove(main.namespaced_keys.denyLM_Nametag);
else if (!doShow && !get... | vuln | Safe | Java |
"""
Slixmpp: The Slick XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of Slixmpp.
See the file LICENSE for copying permissio
"""
import logging
import slixmpp
from slixmpp.stanza import Message, Iq
from slixmpp.xmlstream.handler import Callback
from slixmpp.xml... | vuln | Safe | Python |
int
obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
expr_ty context_expr;
expr_ty optional_vars;
if (_PyObject_HasAttrId(obj, &PyId_context_expr)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_context_expr);
if (tmp == NULL) goto faile... | vuln | Vulnerable | C/C++ |
@Override
public boolean onLongClick(View v) {
int pos = getAdapterPosition();
if (pos == RecyclerView.NO_POSITION)
return false;
NavMenuItem menu = items.get(pos);
return menu.onLongClick();
} | vuln | Vulnerable | Java |
void Logger::addPeer(const QString &ip, bool blocked, const QString &reason)
{
QWriteLocker locker(&lock);
Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip, blocked, reason };
m_peers.push_back(temp);
if (m_peers.size() >= MAX_LOG_MESSAGES)
m_peers.pop_front();
em... | vuln | Vulnerable | Unknown |
static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ThrowPNMException(exception,message) \
{ \
if (comment_info.comment != (char *) NULL) \
comment_info.comment=DestroyString(comment_info.comment); \
ThrowReaderException((exception),(message)); \
}
char
format;
... | vuln | Safe | Unknown |
bool PermissionsData::CanCaptureVisiblePage(int tab_id,
bool PermissionsData::CanCaptureVisiblePage(const GURL& document_url,
const Extension* extension,
int tab_id,
std::string* error) c... | vuln | Safe | C/C++ |
static bool nfc_worker_read_bank_card(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx) {
bool read_success = false;
EmvApplication emv_app = {};
EmvData* result = &nfc_worker->dev_data->emv_data;
nfc_debug_pcap_prepare_tx_rx(nfc_worker->debug_pcap_worker, tx_rx, false);
do {
// Read car... | vuln | Vulnerable | C/C++ |
public function validate() {
header("Content-Type: application/json");
$id = $this->input->post('id', TRUE);
$type = $this->input->post('type', TRUE);
//The above parameters could cause an SQL injection vulnerability due to the non standard
//SQL query in leave_model::detectOverl... | vuln | Vulnerable | PHP |
void Compute(OpKernelContext* context) override {
const Tensor& tensor_in = context->input(0);
PoolParameters params{context,
ksize_,
stride_,
padding_,
/*explicit_paddings=*/{},
FO... | vuln | Vulnerable | Unknown |
Status InferenceContext::Multiply(DimensionHandle first,
DimensionOrConstant second,
DimensionHandle* out) {
const int64_t first_value = Value(first);
const int64_t second_value = Value(second);
// Special cases.
if (first_value == 0) {
*ou... | vuln | Vulnerable | C/C++ |
public synchronized void unmount(String path) {
this.mounts.remove(sanitizePath(path));
} | vuln | Vulnerable | Java |
def file(path):
if app.interface.encrypt and isinstance(app.interface.examples, str) and path.startswith(app.interface.examples):
with open(safe_join(app.cwd, path), "rb") as encrypted_file:
encrypted_data = encrypted_file.read()
file_data = encryptor.decrypt(
app.interface.e... | vuln | Safe | Python |
static int attach_child_main(void* data)
{
struct attach_clone_payload* payload = (struct attach_clone_payload*)data;
int ipc_socket = payload->ipc_socket;
int procfd = payload->procfd;
lxc_attach_options_t* options = payload->options;
struct lxc_proc_context_info* init_ctx = payload->init_ctx;
#if HAVE_SYS_PERSON... | vuln | Safe | Unknown |
#include <math.h>
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
bool Jsi_NumberIsSubnormal(Jsi_Number a) { return fpclassify(a) == FP_SUBNORMAL; }
bool Jsi_NumberIsNormal(Jsi_Number a) { return (fpclassify(a) == FP_ZERO || isnormal(a)); }
bool Jsi_NumberIsNaN(Jsi_Number n)
{
return isnan(n);
}
int Jsi_Num... | vuln | Vulnerable | C/C++ |
static int dxv_decompress_dxt1(AVCodecContext *avctx)
{
DXVContext *ctx = avctx->priv_data;
GetByteContext *gbc = &ctx->gbc;
uint32_t value, prev, op;
int idx = 0, state = 0;
int pos = 2;
AV_WL32(ctx->tex_data, bytestream2_get_le32(gbc));
AV_WL32(ctx->tex_data + 4, bytestream2_get_le32(... | vuln | Safe | C/C++ |
private byte[] parseBulkString(ByteBuf buffer) throws RedisCommandParserException {
int bulkStringLength = parseCurrentNumber(buffer);
if (bulkStringLength == Integer.MIN_VALUE) {
return null;
}
if (bulkStringLength > MAX_BULK_STRING_LENGTH) {
throw new RedisCommandParserException(
... | vuln | Vulnerable | Java |
@Override
public int getMetaField(int index, String field) {
checkStack(1);
return C.luaL_getmetafield(L, index, field);
} | vuln | Safe | Java |
package helm
import (
"fmt"
"io/ioutil"
"net/url"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/ghodss/yaml"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-cd/v2/util/config"
executil "github.com/argoproj/argo-cd/v2/util/exec"
pathutil "github.com/argoproj/argo-cd/v2/util/io/path"
)
t... | vuln | Safe | Go |
void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels,
int line_size)
{
const DCTELEM *p;
uint8_t *pix;
p = block;
pix = pixels;
__asm__ volatile (
"movq %3, %%mm0 \n\t"
"movq 8%3, %%mm1 \n\t"
... | vuln | Vulnerable | C/C++ |
@Inject(at=@At("HEAD"),method="Lnet/minecraft/world/entity/player/Player;travel(Lnet/minecraft/world/phys/Vec3;)V", cancellable = true)
private void plrTravel(CallbackInfo ci){
var thisPlr = ((Player)(Object)this);
if (!thisPlr.isLocalPlayer())
return;
if (RemoteMCharHandler.getI... | vuln | Safe | Java |
public static void redirectSpell(ServerWorld world, BlockPos pos, EntityProjectileSpell spell){
IPosition iposition = getDispensePosition(new ProxyBlockSource(world, pos));
Direction direction = world.getBlockState(pos).getValue(DispenserBlock.FACING);
spell.setPos(iposition.x(), iposition.y(), ... | vuln | Safe | Java |
static jpc_dec_cp_t *jpc_dec_cp_create(uint_fast16_t numcomps)
{
jpc_dec_cp_t *cp;
jpc_dec_ccp_t *ccp;
int compno;
if (!(cp = jas_malloc(sizeof(jpc_dec_cp_t)))) {
return 0;
}
cp->flags = 0;
cp->numcomps = numcomps;
cp->prgord = 0;
cp->numlyrs = 0;
cp->mctid = 0;
cp->csty = 0;
if (!(cp->ccps = jas_malloc(... | vuln | Vulnerable | Unknown |
/*
* Copyright (c) 2014-2018 Hayaki Saito
*
* 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, modify, merge, p... | vuln | Safe | C/C++ |
public String addAutomaticZenRule(String pkg, AutomaticZenRule automaticZenRule,
String reason) {
if (!ZenModeConfig.SYSTEM_AUTHORITY.equals(pkg)) {
PackageItemInfo component = getServiceInfo(automaticZenRule.getOwner());
if (component == null) {
component = g... | vuln | Safe | Java |
void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth)
{
depth++;
bool bFirst = true ;
// buffer
const size_t dirSize = 32;
DataBuf dir(dirSize);
bool bPrint = option == kpsBasic... | vuln | Vulnerable | C/C++ |
static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
{
CharDriverState *chr = opaque;
MuxDriver *d = chr->opaque;
int m = d->focus;
int i;
mux_chr_accept_input (opaque);
for(i = 0; i < size; i++)
if (mux_proc_byte(chr, d, buf[i])) {
if (d->prod[m] == d->cons... | vuln | Vulnerable | Unknown |
composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
{
struct usb_composite_dev *cdev = get_gadget_data(gadget);
struct usb_request *req = cdev->req;
int value = -EOPNOTSUPP;
int status = 0;
u16 w_index = le16_to_cpu(ctrl->wIndex);
u8 intf = w_index & 0xFF;
u16 w_value =... | vuln | Safe | C/C++ |
def filter_archived(list, user, archived: true)
# Executing an extra query instead of a sub-query because it is more
# efficient for the PG planner. Caution should be used when changing the
# query here as it can easily lead to an inefficient query.
group_ids = group_with_messages_ids(user)
... | vuln | Safe | Ruby |
/*
* Driver for IMS Passenger Control Unit Devices
*
* Copyright (C) 2013 The IMS Company
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*/
#include <linux/completion.h>
#i... | vuln | Safe | C/C++ |
e: function (str) {
return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
}, | vuln | Vulnerable | JavaScript |
static inline int array_roll(array_t* array,int index_to,int index_from,int count)
{
char* buf;
char* from;
char* to;
int is;
if(!array ||
index_to<0 || index_to>=array->next ||
index_from<0 || index_from>=array->next)
return -1;
if(index_to==index_from)
return 0;
is=array->item_... | vuln | Vulnerable | C/C++ |
@EventHandler
public void onArrow(ProjectileLaunchEvent evt) {
if (plugin.getConfig().getBoolean("PreventBowBombExploit")) {
if (evt.getEntity() instanceof Arrow) {
if (evt.getEntity().getVelocity().lengthSquared() > plugin.getConfig().getInt("MaxBowSquaredVelocity")) {
... | vuln | Vulnerable | Java |
func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig, mountFds []int) (err error) {
config := iConfig.Config
if err := prepareRoot(config); err != nil {
return fmt.Errorf("error preparing rootfs: %w", err)
}
if mountFds != nil && len(mountFds) != len(config.Mounts) {
return fmt.Errorf("malformed mountFds... | vuln | Safe | Go |
private boolean requestForbidden(HttpServletRequest request) {
if (!xsrfProtectionEnabled) {
return false;
}
HttpSession session = request.getSession(false);
if (session == null) {
return false;
}
String csrfTokenInSession = (String) session
... | vuln | Vulnerable | Java |
def usage(args=None):
'''
Return usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.usage
'''
if __grains__['kernel'] == 'Linux':
cmd = 'df -P'
elif __grains__['kernel'] == 'OpenBSD':
cmd = 'df -kP'
else:
... | vuln | Vulnerable | Python |
static int
updateDevice(const struct header * headers, time_t t)
{
struct device ** pp = &devlist;
struct device * p = *pp; /* = devlist; */
while(p)
{
if( p->headers[HEADER_NT].l == headers[HEADER_NT].l
&& (0==memcmp(p->headers[HEADER_NT].p, headers[HEADER_NT].p, headers[HEADER_NT].l))
&& p->headers[HEA... | vuln | Vulnerable | C/C++ |
private void applyTransaction(@NonNull WindowContainerTransaction t, int syncId,
@Nullable Transition transition, @NonNull CallerInfo caller,
@Nullable Transition finishTransition) {
if (t.getTaskFragmentOrganizer() != null && !mTaskFragmentOrganizerController
.isOrganize... | vuln | Safe | Java |
int tls1_set_server_sigalgs(SSL *s)
{
int al;
size_t i;
/* Clear any shared sigtnature algorithms */
if (s->cert->shared_sigalgs) {
OPENSSL_free(s->cert->shared_sigalgs);
s->cert->shared_sigalgs = NULL;
s->cert->shared_sigalgslen = 0;
}
/* Clear certificate digests a... | vuln | Safe | C/C++ |
private void onPinContact(TupleMessageEx message) {
try {
ShortcutInfoCompat.Builder builder =
Shortcuts.getShortcut(context, (InternetAddress) message.from[0]);
ShortcutManagerCompat.requestPinShortcut(context, builder.build(), null);
} ca... | vuln | Safe | Java |
int
cib_remote_msg(gpointer data)
{
const char *value = NULL;
xmlNode *command = NULL;
cib_client_t *client = data;
crm_trace("%s callback", client->encrypted ? "secure" : "clear-text");
command = crm_recv_remote_msg(client->session, client->encrypted);
if (command == NULL) {
return -1... | vuln | Vulnerable | C/C++ |
function insertRank(name, description, connection)
{
var strQuery = "INSERT INTO rank VALUES('"+name+"', '" + description + "', 'NULL')";
connection.query( strQuery, function(err, rows)
{if(err) {
throw err;
}else{
if(debug)
{console.log("insertRank \n"+rows[0]+"\n");}
return rows[0];
}
... | vuln | Vulnerable | JavaScript |
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head)
{
Error *local_err = NULL;
Object *obj;
uint32_t h;
int i;
for (i = 0; i < nb_consoles; i++) {
if (!consoles[i]) {
continue;
}
obj = object_property_get_link(OBJECT(consoles[i]),
... | vuln | Vulnerable | C/C++ |
char *compose_path(ctrl_t *ctrl, char *path)
{
struct stat st;
static char rpath[PATH_MAX];
char *name, *ptr;
char dir[PATH_MAX] = { 0 };
strlcpy(dir, ctrl->cwd, sizeof(dir));
DBG("Compose path from cwd: %s, arg: %s", ctrl->cwd, path ?: "");
if (!path || !strlen(path))
goto check;
if (path) {
if (path[0] ... | vuln | Vulnerable | C/C++ |
void NavigatorImpl::DiscardPendingEntryIfNeeded(int expected_pending_entry_id) {
NavigationEntry* pending_entry = controller_->GetPendingEntry();
bool pending_matches_fail_msg =
pending_entry &&
expected_pending_entry_id == pending_entry->GetUniqueID();
if (!pending_matches_fail_msg)
return;
bo... | vuln | Vulnerable | C/C++ |
static void
sysUpTime_handler(snmp_varbind_t *varbind, snmp_oid_t *oid)
{
snmp_api_set_time_ticks(varbind, oid, clock_seconds() * 100);
} | vuln | Safe | C/C++ |
TfLiteStatus EvalHashtable(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE(context, node->user_data != nullptr);
const auto* params =
reinterpret_cast<const TfLiteHashtableParams*>(node->user_data);
// The resource id is generated based on the given table name.
const int resource_id = std::has... | vuln | Safe | C/C++ |
package com.salesmanager.shop.admin.controller.customers;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService;
import com.salesmanager.core.business.services.customer.attribute.CustomerOptionSetService;
import com.salesmanager.core... | vuln | Vulnerable | Java |
function AJchangeResourcePrivs() {
global $user;
$node = processInputVar("activeNode", ARG_NUMERIC);
if(! checkUserHasPriv("resourceGrant", $user["id"], $node)) {
$text = "You do not have rights to modify resource privileges at this node.";
print "alert('$text');";
return;
}
$resourcegrp = processInputVar("i... | vuln | Safe | PHP |
static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square, int chroma_height, int delta, int list,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
int src_x_offset, int src_y_offset,
qpel_mc_func *qpix_op, h264_ch... | vuln | Vulnerable | C/C++ |
enum ndr_err_code ndr_push_dns_string_list(struct ndr_push *ndr,
struct ndr_token_list *string_list,
int ndr_flags,
const char *s)
{
const char *start = s;
if (!(ndr_flags & NDR_SCALARS)) {
return NDR_ERR_SUCCESS;
}
while (s && *s) {
enum ndr_err_code ndr_err;
char *compname;
size_... | vuln | Vulnerable | Unknown |
static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)
{
MemoryRegion *mr = NULL;
AssignStorage *assign_info = (AssignStorage *) sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
ram_addr_t unassign_addr;
MemoryRegion *sysmem = get_system_memory();
if (!mhd) {
sccb->h.... | vuln | Safe | C/C++ |
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
... | vuln | Safe | C/C++ |
private void drawTroops(Graphics2D g, int troopCount, boolean attack, int x, int y) {
// log("DrawTroops. count:"+troopCount+" attacker?"+attack+" x:"+x+" y:"+y);
int MAX_PER_ROW = 25;
int NUM_ROWS = 6;
int MAX_ROWS = 20;
// try to do 6 rows evenly, only go to more when more th... | vuln | Vulnerable | Java |
elFinder.prototype.commands.getfile = function() {
var self = this,
fm = this.fm,
filter = function(files) {
var o = self.options;
files = $.map(files, function(file) {
return (file.mime != 'directory' || o.folders) && file.read ? file : null;
});
return o.multiple || files.length == 1 ? fi... | vuln | Safe | JavaScript |
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;
/* No path traversal */
if (strstr(name, "..") || strchr(name, '/'))
retur... | vuln | Safe | C/C++ |
int __kvm_set_memory_region(struct kvm *kvm,
struct kvm_userspace_memory_region *mem,
int user_alloc)
{
int r;
gfn_t base_gfn;
unsigned long npages;
struct kvm_memory_slot *memslot, *slot;
struct kvm_memory_slot old, new;
struct kvm_memslots *slots, *old_memslots;
r = check_memory_region_flags(mem... | vuln | Safe | C/C++ |
static void php_array_replace_recursive(PointerSet &seen, bool check,
Array &arr1, const Array& arr2) {
if (check) {
if (seen.find((void*)arr1.get()) != seen.end()) {
raise_warning("array_replace_recursive(): recursion detected");
return;
}
seen.insert((... | vuln | Vulnerable | C/C++ |
public List<File> call() {
try {
Random random = new Random();
while (MemoryManager.Type.JMX_BASED.equals(memoryManager.getType()) && !registerWithMemoryManager()) {
int sleepDuration = 1000 + random.nextInt(500);
log.info("{} Could not register to memory ... | vuln | Vulnerable | Java |
HRESULT Http::HrReadHeaders()
{
HRESULT hr;
std::string strBuffer;
ULONG n = 0;
std::map<std::string, std::string>::iterator iHeader = mapHeaders.end();
static constexpr std::size_t MAX_HEADER_LENGTH = 65536;
std::size_t numOfBytesRead = 0;
ec_log_debug("Receiving headers:");
do
{
hr = m_lpChannel->HrReadLi... | vuln | Safe | C/C++ |
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
var statistics = literal("statistics").requires(src -> PermissionManager.hasPermission(src, "command.statistics", 2));
statistics.executes(ctx -> displayOverview(ctx.getSource()));
for (int i = 0; i < SUB_COMMANDS.l... | vuln | Safe | Java |
package command
import (
"time"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zitadel/internal/repository/user"
)
type HumanRefreshTokenWriteModel struct {
eventstore.WriteModel
TokenID string
RefreshToken string
UserState domai... | vuln | Vulnerable | Go |
/*
* Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main director... | vuln | Vulnerable | C/C++ |
static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct au1200fb_device *fbdev = info->par;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */
return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len);
} | vuln | Safe | C/C++ |
ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
{
ngx_int_t overwrite;
ngx_str_t uri, args;
ngx_table_elt_t *location;
ngx_http_core_loc_conf_t *clcf;
overwrite = err_page->overwrite;
if (overwrite && overwrite != NGX_... | vuln | Safe | C/C++ |
public void cycle(boolean forwards) {
var allChildren = new ArrayList<Component>();
this.root.collectChildren(allChildren);
allChildren.removeIf(component -> !component.canFocus(Component.FocusSource.KEYBOARD_CYCLE));
if (allChildren.isEmpty()) return;
int index = (this.focused... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.