code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int asf_read_value(AVFormatContext *s, const uint8_t *name, uint16_t name_len,
uint16_t val_len, int type, AVDictionary **met)
{
int ret;
uint8_t *value;
uint16_t buflen = 2 * val_len + 1;
AVIOContext *pb = s->pb;
value = av_malloc(buflen);
if (!value)
re... | vuln | Safe | C/C++ |
static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,
AVFormatContext *s)
{
int pos = url_ftell(pb);
int i;
put_be32(pb, 0);
put_tag(pb, "udta");
mov_write_meta_tag(pb, mov, s);
for (i=0; i<MAX_STREAMS; i++) {
if(mov->tracks[i].entry <... | vuln | Safe | C/C++ |
void Start() {
DVLOG(2) << "Starting SafeBrowsing download check for: "
<< item_->DebugString(true);
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DownloadCheckResultReason reason = REASON_MAX;
if (!IsSupportedDownload(
*item_, item_->GetTargetFilePath(), &reason, &type_)) {
switch ... | vuln | Safe | C/C++ |
@Override
public boolean useItem(UseItemParams params) {
if (GameData.getAvatarCostumeDataMap().containsKey(this.i)) {
params.player.addCostume(this.i);
}
return true;
} | vuln | Safe | Java |
query_for_targets(struct module_qstate* qstate, struct iter_qstate* iq,
struct iter_env* ie, int id, int maxtargets, int* num)
{
int query_count = 0;
struct delegpt_ns* ns;
int missing;
int toget = 0;
if(iq->depth == ie->max_dependency_depth)
return 0;
if(iq->depth > 0 && iq->target_count &&
iq->targ... | vuln | Safe | Unknown |
foreach ($elem[2] as $field) {
echo '
<tr class="tr_cf tr_fields hidden" id="cf_tr_'.$field[0].'">
<td valign="top" class="td_title"> <i class="fa fa-caret-right"></i> <i>'.$field[1].'</i> :</td>
<td>';
if ($fiel... | vuln | Vulnerable | PHP |
jbig2_decode_mmr_init(Jbig2MmrCtx *mmr, int width, int height, const byte *data, size_t size)
{
int i;
uint32_t word = 0;
mmr->width = width;
mmr->size = size;
mmr->data_index = 0;
mmr->bit_index = 0;
for (i = 0; i < size && i < 4; i++)
word |= (data[i] << ((3 - i) << 3));
... | vuln | Vulnerable | C/C++ |
static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
{
AResampleContext *aresample = inlink->dst->priv;
const int n_in = insamplesref->audio->nb_samples;
int n_out = FFMAX(n_in * aresample->ratio * 2, 1);
AVFilterLink *const outlink = inlink->dst->outputs[0];
AVFil... | vuln | Vulnerable | C/C++ |
getword(f, word, newlinep, filename)
FILE *f;
char *word;
int *newlinep;
char *filename;
{
int c, len, escape;
int quoted, comment;
int value, digit, got, n;
#define isoctal(c) ((c) >= '0' && (c) < '8')
*newlinep = 0;
len = 0;
escape = 0;
comment = 0;
quoted = 0;
/... | vuln | Vulnerable | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* lookup = GetInput(context, node, 0);
TF_LITE_ENSURE_EQ(context, NumDimensions(lookup), 1);
TF_LITE_ENSURE_EQ(context, lookup->t... | vuln | Vulnerable | C/C++ |
@RequestMapping(value = "/event-types/{name}/partitions", method = RequestMethod.GET)
public List<EventTypePartitionView> listPartitions(
@PathVariable("name") final String eventTypeName,
@RequestParam(value = "cursors", required = false) final String cursorsString
) throws NoSuchEventTy... | vuln | Vulnerable | Java |
@Override
public void push(@NotNull Number number) {
checkStack(1);
C.lua_pushnumber(L, number.doubleValue());
} | vuln | Safe | Java |
@Override
public void setConfigFlag(int flag, boolean value) throws RemoteException {
mEventLogger.logRadioEvent("Set ConfigFlag %s = %b", ConfigFlag.toString(flag), value);
synchronized (mLock) {
checkNotClosedLocked();
int halResult = mHwSession.setConfigFlag(flag, value);... | vuln | Vulnerable | Java |
@OnlyIn(Dist.CLIENT)
private void updatePassengerOffsets(Entity passenger)
{
int seatIndex = this.getSeatTracker().getSeatIndex(passenger.getUUID());
float seatYawOffset = seatIndex != -1 ? this.getProperties().getSeats().get(seatIndex).getYawOffset() : 0F;
this.passengerPitchOffset = Ma... | vuln | Safe | Java |
private int calculateOctreeOrigin(Collection<ChunkPosition> chunksToLoad, boolean centerOctree) {
int xmin = Integer.MAX_VALUE;
int xmax = Integer.MIN_VALUE;
int zmin = Integer.MAX_VALUE;
int zmax = Integer.MIN_VALUE;
for (ChunkPosition cp : chunksToLoad) {
if (cp.x < xmin) {
xmin = cp... | vuln | Vulnerable | Java |
text: () => TooltipContent
): { destroy: () => void; update: (t: () => TooltipContent) => void } { | vuln | Safe | JavaScript |
GF_Err gf_hinter_track_finalize(GF_RTPHinter *tkHint, Bool AddSystemInfo)
{
u32 Width, Height;
GF_ESD *esd;
char sdpLine[20000];
char mediaName[30], payloadName[30];
u32 mtype;
Width = Height = 0;
gf_isom_sdp_clean_track(tkHint->file, tkHint->TrackNum);
mtype = gf_isom_get_media_type(tkHint->file, tkHint... | vuln | Safe | Unknown |
int _our_safe_pcap_next_ex(pcap_t *pcap, struct pcap_pkthdr **pkthdr,
const u_char **pktdata, const char *funcname,
const int line, const char *file)
{
int res = pcap_next_ex(pcap, pkthdr, pktdata);
if (*pktdata && *pkthdr) {
if ((*pkthdr)->len > MAXPACKET) {
fprintf(stderr,... | vuln | Vulnerable | C/C++ |
static rpmfi initIter(rpmfiles files, int itype, int link)
{
rpmfi fi = NULL;
if (files && itype>=0 && itype<=RPMFILEITERMAX) {
fi = xcalloc(1, sizeof(*fi));
fi->i = -1;
fi->j = -1;
fi->files = link ? rpmfilesLink(files) : files;
fi->next = nextfuncs[itype];
if (itype == RPMFI_ITER_BACK) {
fi->i = ... | vuln | Safe | C/C++ |
public function downloadfile() {
if (empty($this->params['fileid'])) {
flash('error', gt('There was an error while trying to download your file. No File Specified.'));
expHistory::back();
}
$fd = new filedownload(intval($this->params['fileid']));
if (empty($this... | vuln | Safe | PHP |
RenderFrameObserverNatives::RenderFrameObserverNatives(ScriptContext* context)
: ObjectBackedNativeHandler(context), weak_ptr_factory_(this) {
RouteFunction(
"OnDocumentElementCreated",
base::Bind(&RenderFrameObserverNatives::OnDocumentElementCreated,
base::Unretained(this)));
} | vuln | Safe | C/C++ |
def match?(name, ip)
ip? ? pattern.include?(IPAddr.new(ip)) : matchname?(name)
end | vuln | Vulnerable | Ruby |
static void copyStereo8(
short *dst,
const int * src[FLACParser::kMaxChannels],
unsigned nSamples,
unsigned /* nChannels */) {
for (unsigned i = 0; i < nSamples; ++i) {
*dst++ = src[0][i] << 8;
*dst++ = src[1][i] << 8;
}
} | vuln | Safe | C/C++ |
protected void doProxy(HttpServletRequest req, HttpServletResponse resp) throws IOException {
ZimbraLog.clearContext();
boolean isAdmin = isAdminRequest(req);
AuthToken authToken = isAdmin ?
getAdminAuthTokenFromCookie(req, resp, true) : getAuthTokenFromCookie(req, resp, true);
... | vuln | Safe | Java |
#
# Registration dialog/wizard
#
# Copyright (c) 2011 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... | vuln | Vulnerable | Python |
const bootbox = require('bootbox');
const Requisition = require('../model/Requisition');
require('../services/Requisitions');
require('../services/Synchronize');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
angular.module('onms-req... | vuln | Safe | Java |
int64_t qdict_get_int(const QDict *qdict, const char *key)
{
QObject *obj = qdict_get_obj(qdict, key, QTYPE_QINT);
return qint_get_int(qobject_to_qint(obj));
} | vuln | Vulnerable | C/C++ |
/*
Copyright The containerd 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... | vuln | Vulnerable | Go |
function clone( $container ) {
var $last = $container.children( '.rwmb-clone' ).last(),
$clone = $last.clone(),
nextIndex = cloneIndex.nextIndex( $container );
// Reset value for fields
var $inputs = $clone.find( rwmb.inputSelectors );
$inputs.each( cloneValue.reset );
// Insert Clone
$clone.insertA... | vuln | Vulnerable | JavaScript |
private void walkAllSuitableFiles(File dirPath, final Collection<File> collectResult,
int maxNum) throws IOException {
if (collectResult.size() > maxNum) {
LOGGER.warn("max num of files is {}, please check", maxNum);
return;
}
if (dirPath.isFile() && dateForma... | vuln | Safe | Java |
static void celt_denormalize(CeltFrame *f, CeltBlock *block, float *data)
{
int i, j;
for (i = f->start_band; i < f->end_band; i++) {
float *dst = data + (ff_celt_freq_bands[i] << f->size);
float norm = exp2f(block->energy[i] + ff_celt_mean_energy[i]);
for (j = 0; j < ff_celt_freq_range[... | vuln | Vulnerable | C/C++ |
static void qtrle_decode_24bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change)
{
int rle_code;
int pixel_ptr;
int row_inc = s->frame.linesize[0];
unsigned char r, g, b;
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
while ... | vuln | Vulnerable | C/C++ |
block_crypto_open_opts_init(QCryptoBlockFormat format,
QemuOpts *opts,
Error **errp)
{
OptsVisitor *ov;
QCryptoBlockOpenOptions *ret = NULL;
Error *local_err = NULL;
ret = g_new0(QCryptoBlockOpenOptions, 1);
ret->format = format;
ov = opts_... | vuln | Vulnerable | C/C++ |
void isis_notif_authentication_type_failure(const struct isis_circuit *circuit,
const char *raw_pdu,
size_t raw_pdu_len)
{
const char *xpath = "/frr-isisd:authentication-type-failure";
struct list *arguments = yang_data_list_new();
char xpath_arg[XPATH_MAXLEN];
struct yang_data *data;
struct isis... | vuln | Safe | Unknown |
MOBI_RET mobi_trie_insert_infl(MOBITrie **root, const MOBIIndx *indx, size_t i) {
MOBIIndexEntry e = indx->entries[i];
char *inflected = e.label;
for (size_t j = 0; j < e.tags_count; j++) {
MOBIIndexTag t = e.tags[j];
if (t.tagid == INDX_TAGARR_INFL_PARTS_V1) {
for (size_t k = 0;... | vuln | Vulnerable | C/C++ |
bool Channel::ChannelImpl::ProcessOutgoingMessages() {
DCHECK(!waiting_connect_); // Why are we trying to send messages if there's
is_blocked_on_write_ = false;
if (output_queue_.empty()) {
return true;
}
if (pipe_ == -1) {
return false;
}
while (!output_queue_.empty()) {
Message* msg = ou... | vuln | Vulnerable | C/C++ |
static int coroutine_fn bdrv_mirror_top_flush(BlockDriverState *bs)
{
if (bs->backing == NULL) {
return 0;
}
return bdrv_co_flush(bs->backing->bs);
} | vuln | Safe | C/C++ |
private static void getPageResources(Context ctx) {
try (InputStream filestream = DataLoader.load(ctx.path())) {
String possibleFilename = ctx.path();
ContentType fromExtension = ContentType.getContentTypeByExtension(possibleFilename.substring(possibleFilename.lastIndexOf(".") + 1));
... | vuln | Vulnerable | Java |
dse_bind(Slapi_PBlock *pb) /* JCM There should only be one exit point from this function! */
{
ber_tag_t method; /* The bind method */
struct berval *cred; /* The bind credentials */
Slapi_Value **bvals;
struct dse *pdse;
Slapi_Attr *attr;
Slapi_DN *sdn = NULL;
Slapi_Entry *ec = NULL;
... | vuln | Vulnerable | C/C++ |
private static Thread newThread(Runnable r, @Nullable String name, boolean daemon){
Thread thread = name == null ? new Thread(r) : new Thread(r, name);
thread.setDaemon(daemon);
thread.setUncaughtExceptionHandler((t, e) -> Log.err(e));
return thread;
} | vuln | Safe | Java |
static bool snd_ctl_remove_numid_conflict(struct snd_card *card,
unsigned int count)
{
struct snd_kcontrol *kctl;
/* Make sure that the ids assigned to the control do not wrap around */
if (card->last_numid >= UINT_MAX - count)
card->last_numid = 0;
list_for_each_entry(kctl, &card->controls, list) {
... | vuln | Safe | C/C++ |
public void startWebView(View view) {
String username = prefs.getString("username", "");
Log.d(TAG, "startWebView creating myWebView for user="+username);
myWebView = (WebView)view;
WebSettings webSettings = myWebView.getSettings();
userAgentString = webSettings.getUserAgentString();
Log.d(TAG, "st... | vuln | Vulnerable | Java |
static int
_Unpickler_MemoPut(UnpicklerObject *self, Py_ssize_t idx, PyObject *value)
{
PyObject *old_item;
if (idx >= self->memo_size) {
if (_Unpickler_ResizeMemoList(self, idx * 2) < 0)
return -1;
assert(idx < self->memo_size);
}
Py_INCREF(value);
old_item = self->memo... | vuln | Vulnerable | C/C++ |
static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
const uint8_t *src, int width)
{
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: ... | vuln | Vulnerable | C/C++ |
static void hashkey(struct connectdata *conn, char *buf,
size_t len, /* something like 128 is fine */
const char **hostp)
{
const char *hostname;
long port = conn->remote_port;
#ifndef CURL_DISABLE_PROXY
if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) {
hostname ... | vuln | Safe | Unknown |
private void initWindow() {
profileName.setText(profile.getName());
mainProfile.setSelected(profile.isMainProfile());
focusBackOnLost.setSelected(profile.isFocusBackOnLost());
focusOnListListController.setPickType(PickProcessesController.PickType.process).setSelection(profile.getActivat... | vuln | Vulnerable | Java |
@Override
public IMqttToken subscribe(MqttSubscription[] subscriptions, Object userContext, MqttActionListener callback,
IMqttMessageListener messageListener, MqttProperties subscriptionProperties) throws MqttException {
int subId = subscriptionProperties.getSubscriptionIdentifiers().get(0);
// Automatic Subs... | vuln | Vulnerable | Java |
static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
{
OMAContext *oc = s->priv_data;
ID3v2ExtraMetaGEOB *geob = NULL;
uint8_t *gdata;
oc->encrypted = 1;
av_log(s, AV_LOG_INFO, "File is encrypted\n");
while (em) {
if (!strcmp(em->tag, "GEOB") &&
... | vuln | Vulnerable | C/C++ |
static inline int parse_command_line(AVFormatContext *s, const char *line,
int linelen, char *uri, int urisize,
char *method, int methodsize,
enum RTSPMethod *methodcode)
{
RTSPState *rt = s->priv_data;
... | vuln | Safe | C/C++ |
func (g DashboardHandler) Append(router *mux.Router) {
if g.Assets == nil {
log.WithoutContext().Error("No assets for dashboard")
return
}
// Expose dashboard
router.Methods(http.MethodGet).
Path("/").
HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
http.Redirect(response, reques... | vuln | Vulnerable | Go |
kssl_keytab_is_available(KSSL_CTX *kssl_ctx)
{
krb5_context krb5context = NULL;
krb5_keytab krb5keytab = NULL;
krb5_keytab_entry entry;
krb5_principal princ = NULL;
krb5_error_code krb5rc = KRB5KRB_ERR_GENERIC;
int rc = 0;
if ((krb5rc = krb5_init_context(&krb5co... | vuln | Vulnerable | Unknown |
public static function explode_url($url)
{
$protocol = "";
$host = "";
$path = "";
$file = "";
$arr = parse_url($url);
if ( isset($arr["scheme"]) ) {
$arr["scheme"] = mb_strtolower($arr["scheme"]);
}
// Exclude windows drive letters...
... | vuln | Vulnerable | PHP |
void ff_xvmc_decode_mb(MpegEncContext *s)
{
XvMCMacroBlock *mv_block;
struct xvmc_pix_fmt *render;
int i, cbp, blocks_per_mb;
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
if (s->encoding) {
av_log(s->avctx, AV_LOG_ERROR, "XVMC doesn't support encoding!!!\n");
return;
}
... | vuln | Safe | C/C++ |
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
{
const int angle_rounded = (int)floor(angle * 100);
if (bgcolor < 0 || (!src->trueColor && bgcolor >= gdMaxColors)) {
return NULL;
}
/* impact perf a bit, but not that much. Implementation for palette
images can be d... | vuln | Vulnerable | Unknown |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
/*
* Vim originated fro... | vuln | Safe | C/C++ |
void *g_try_realloc(void *ptr, size_t size)
{
return g_try_realloc_n(ptr, 1, size);
} | vuln | Safe | C/C++ |
static void hmp_logfile(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
qemu_set_log_filename(qdict_get_str(qdict, "filename"), &err);
if (err) {
error_report_err(err);
}
} | vuln | Safe | C/C++ |
xfs_attr_node_addname(xfs_da_args_t *args)
{
xfs_da_state_t *state;
xfs_da_state_blk_t *blk;
xfs_inode_t *dp;
xfs_mount_t *mp;
int committed, retval, error;
trace_xfs_attr_node_addname(args);
/*
* Fill in bucket of arguments/results/context to carry around.
*/
dp = args->dp;
mp = dp->i_mount;
restart:
s... | vuln | Safe | C/C++ |
static double bessel(double x){
double v=1;
double lastv=0;
double t=1;
int i;
static const double inv[100]={
1.0/( 1* 1), 1.0/( 2* 2), 1.0/( 3* 3), 1.0/( 4* 4), 1.0/( 5* 5), 1.0/( 6* 6), 1.0/( 7* 7), 1.0/( 8* 8), 1.0/( 9* 9), 1.0/(10*10),
1.0/(11*11), 1.0/(12*12), 1.0/(13*13), 1.0/(14*14), 1.0/(1... | vuln | Safe | C/C++ |
public void shutdown() {
if (jitterWatchdog != null) {
jitterWatchdog.interrupt();
}
if (cpuWatchdog != null) {
cpuWatchdog.stop();
}
for (PluginRunData plugin : runData) {
plugin.shutdown();
}
eventLoopGroup.shutdownGracefully(0, 10, TimeUnit.SECONDS... | vuln | Safe | Java |
void Http2Stream::SubmitRstStream(const uint32_t code) {
CHECK(!this->is_destroyed());
code_ = code;
auto is_stream_cancel = [](const uint32_t code) {
return code == NGHTTP2_CANCEL;
};
// If RST_STREAM frame is received with error code NGHTTP2_CANCEL,
// add it to the pending list and don't force purg... | vuln | Safe | Unknown |
static int io_files_update_with_index_alloc(struct io_kiocb *req,
unsigned int issue_flags)
{
__s32 __user *fds = u64_to_user_ptr(req->rsrc_update.arg);
unsigned int done;
struct file *file;
int ret, fd;
for (done = 0; done < req->rsrc_update.nr_args; done++) {
if (copy_from_user(&fd, &fds[done], sizeo... | vuln | Vulnerable | C/C++ |
void isor_reader_get_sample(ISOMChannel *ch)
{
GF_Err e;
u32 sample_desc_index;
if (ch->sample) return;
if (ch->next_track) {
ch->track = ch->next_track;
ch->next_track = 0;
}
if (ch->to_init) {
init_reader(ch);
sample_desc_index = ch->last_sample_desc_index;
} else if (ch->speed < 0) {
if (ch->last_... | vuln | Safe | Unknown |
static int parse_uint16(DeviceState *dev, Property *prop, const char *str)
{
uint16_t *ptr = qdev_get_prop_ptr(dev, prop);
const char *fmt;
fmt = strncasecmp(str, "0x",2) == 0 ? "%" PRIx16 : "%" PRIu16;
if (sscanf(str, fmt, ptr) != 1)
return -EINVAL;
return 0;
} | vuln | Vulnerable | C/C++ |
static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
const uint8_t *payload, int payload_size,
int64_t pts, int64_t dts, int key)
{
MpegTSWriteStream *ts_st = st->priv_data;
MpegTSWrite *ts = s->priv_data;
uint8_t buf[TS_PACKET_SIZE];
u... | vuln | Safe | C/C++ |
static void ax25_kill_by_device(struct net_device *dev)
{
ax25_dev *ax25_dev;
ax25_cb *s;
struct sock *sk;
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
return;
spin_lock_bh(&ax25_list_lock);
again:
ax25_for_each(s, &ax25_list) {
if (s->ax25_dev == ax25_dev) {
sk = s->sk;
sock_hold(sk);
spin_unlo... | vuln | Safe | C/C++ |
static int
send_results(struct iperf_test *test)
{
int r = 0;
cJSON *j;
cJSON *j_streams;
struct iperf_stream *sp;
cJSON *j_stream;
int sender_has_retransmits;
iperf_size_t bytes_transferred;
int retransmits;
j = cJSON_CreateObject();
if (j == NULL) {
i_errno = IEPACKAGERESULTS... | vuln | Safe | C/C++ |
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_);
}
size += unknownFie... | vuln | Safe | Java |
irc_mode_channel_update (struct t_irc_server *server,
struct t_irc_channel *channel,
char set_flag,
char chanmode,
const char *argument)
{
char *pos_args, *str_modes, **argv, *pos, *ptr_arg;
char *new_modes, *new... | vuln | Safe | C/C++ |
size_t util_path_encode(char *s, size_t len)
{
char t[(len * 3)+1];
size_t i, j;
for (i = 0, j = 0; s[i] != '\0'; i++) {
if (s[i] == '/') {
memcpy(&t[j], "\\x2f", 4);
j += 4;
} else if (s[i] == '\\') {
memcpy(&t[j], "\\x5c", 4);
j += 4;
} else {
t[j] = s[i];
j++;
}
}
if (len == 0)
retu... | vuln | Vulnerable | Unknown |
/*
Copyright (c) 2013, David C Horton
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, publish, distribute,... | vuln | Safe | C/C++ |
private function LoadData()
{
$this->dataLoaded = true;
$args = array();
$args[] = '-s';
$args[] = '-l';
$args[] = $this->commitHash;
$args[] = '--';
$args[] = $this->path;
$blamelines = explode("\n", $this->exe->Execute($this->project->GetPath(), GIT_BLAME, $args));
$lastcommit = '';
foreach ($... | vuln | Vulnerable | PHP |
void DrachtioController::initializeLogging() {
try {
if( m_bNoConfig || m_Config->getConsoleLogTarget() || m_bConsoleLogging ) {
m_sinkConsole.reset(
new sinks::synchronous_sink< sinks::text_ostream_backend >()
);
m_sinkCo... | vuln | Safe | C/C++ |
int dd_exist(const struct dump_dir *dd, const char *path)
{
if (!str_is_correct_filename(path))
error_msg_and_die("Cannot test existence. '%s' is not a valid file name", path);
char *full_path = concat_path_file(dd->dd_dirname, path);
int ret = exist_file_dir(full_path);
free(full_path);
re... | vuln | Safe | C/C++ |
void BiquadDSPKernel::getFrequencyResponse(int nFrequencies,
const float* frequencyHz,
float* magResponse,
float* phaseResponse)
{
bool isGood = nFrequencies > 0 && frequencyHz && magResp... | vuln | Vulnerable | C/C++ |
@Override
public void onUpdate() {
if (!iniz) {
ObfuscationReflectionHelper.setPrivateValue(GuiIngame.class, Minecraft.getMinecraft().ingameGUI, new NewChat(Minecraft.getMinecraft()), "field_73840_e");
iniz = true;
}
} | vuln | Vulnerable | Java |
static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, int remote_argc,
int *f_in_p, int *f_out_p)
{
int i, argc = 0;
char *args[MAX_ARGS], *need_to_free = NULL;
pid_t pid;
int dash_l_set = 0;
if (!read_batch && !local_server) {
char *t, *f, in_quote = '\0';
char *rsh_env = getenv... | vuln | Safe | Unknown |
dns_cache_find_delegation(struct module_env* env, uint8_t* qname,
size_t qnamelen, uint16_t qtype, uint16_t qclass,
struct regional* region, struct dns_msg** msg, time_t now,
int noexpiredabove, uint8_t* expiretop, size_t expiretoplen)
{
/* try to find closest NS rrset */
struct ub_packed_rrset_key* nskey;
stru... | vuln | Safe | Unknown |
protected void checkTarget() {
if (this.isKnockback()) {
return;
}
Vector3 target = this.target;
if (!(target instanceof EntityCreature) || (!((EntityCreature) target).closed && !this.targetOption((EntityCreature) target, this.distanceSquared(target))) || !((Entity) target).... | vuln | Safe | Java |
def loads(s, **kwargs):
"""Unserialize a JSON object from a string ``s`` by using the application's
configured decoder (:attr:`~flask.Flask.json_decoder`) if there is an
application on the stack.
"""
_load_arg_defaults(kwargs)
if isinstance(s, bytes):
s = s.decode(kwargs.pop('encoding', ... | vuln | Vulnerable | Python |
int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)
{
int len;
if(size<0)
return -1;
len = s->buf_end - s->buf_ptr;
if (len == 0) {
fill_buffer(s);
len = s->buf_end - s->buf_ptr;
}
if (len > size)
len = size;
memcpy(buf, s->buf_ptr, len... | vuln | Safe | C/C++ |
static pyc_object *get_list_object(RBuffer *buffer) {
pyc_object *ret = NULL;
bool error = false;
ut32 n = 0;
n = get_ut32 (buffer, &error);
if (n > ST32_MAX) {
eprintf ("bad marshal data (list size out of range)\n");
return NULL;
}
if (error) {
return NULL;
}
ret = get_array_object_generic (buffer, n);... | vuln | Vulnerable | Unknown |
import { DEV } from 'esm-env';
import { base } from '__sveltekit/paths';
import { is_endpoint_request, render_endpoint } from './endpoint.js';
import { render_page } from './page/index.js';
import { render_response } from './page/render.js';
import { respond_with_error } from './page/respond_with_error.js';
import { is... | vuln | Vulnerable | JavaScript |
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if ("poll_interval".equals(key) && cbAlways != null)
cbAlways.setChecked(ServiceSynchronize.getPollInterval(getContext()) == 0);
} | vuln | Safe | Java |
public void setSheetNums(String[] sheetNums) {
this.sheetNums = sheetNums != null ? sheetNums.clone() : null;
} | vuln | Safe | Java |
get_filter(
Operation *op,
BerElement *ber,
Filter **filt,
const char **text )
{
return get_filter0( op, ber, filt, text, 0 );
} | vuln | Safe | Unknown |
PHP_FUNCTION(enchant_broker_request_dict)
{
zval *broker;
enchant_broker *pbroker;
enchant_dict *dict;
EnchantDict *d;
char *tag;
int taglen;
int pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
if (taglen == 0... | vuln | Safe | C/C++ |
GC_debug_malloc_ignore_off_page(size_t lb, GC_EXTRA_PARAMS)
{
void * result = GC_malloc_ignore_off_page(SIZET_SAT_ADD(lb, DEBUG_BYTES));
if (result == 0) {
GC_err_printf("GC_debug_malloc_ignore_off_page(%lu)"
" returning NULL (%s:%d)\n", (unsigned long)lb, s, i);
return(0)... | vuln | Safe | Unknown |
main_get_appheader (xd3_stream *stream, main_file *ifile,
main_file *output, main_file *sfile)
{
uint8_t *apphead;
usize_t appheadsz;
int ret;
/* The user may disable the application header. Once the appheader
* is set, this disables setting it again. */
if (! option_use_appheader) { return; }
r... | vuln | Safe | Unknown |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_alarmset.c -- A set of alarms
*/
#include <assert.h>
#include <string.h>
#include "lsquic_types.h"
#include "lsquic_packet_common.h"
#include "lsquic_alarmset.h"
#define LSQUIC_LOGGER_MODULE LSQLM_ALARMSET
#define LSQUIC_LOG_CONN... | vuln | Safe | C/C++ |
package cz.metacentrum.perun.core.impl;
import cz.metacentrum.perun.core.api.ExtSource;
import cz.metacentrum.perun.core.api.GroupsManager;
import cz.metacentrum.perun.core.api.exceptions.ExtSourceUnsupportedOperationException;
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentr... | vuln | Vulnerable | Java |
static Bigint * Balloc(int k)
{
int x;
Bigint *rv;
if (k > Kmax) {
zend_error(E_ERROR, "Balloc() allocation exceeds list boundary");
}
_THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex);
if ((rv = freelist[k])) {
freelist[k] = rv->next;
} else {
x = 1 << k;
rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)... | vuln | Safe | C/C++ |
int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length)
{
switch (mem->type) {
case RXE_MEM_TYPE_DMA:
return 0;
case RXE_MEM_TYPE_MR:
case RXE_MEM_TYPE_FMR:
return ((iova < mem->iova) ||
((iova + length) > (mem->iova + mem->length))) ?
-EFAULT : 0;
default:
return -EFAULT;
}
} | vuln | Vulnerable | C/C++ |
PHPAPI char *php_escape_shell_arg(char *str)
{
int x, y = 0, l = strlen(str);
char *cmd;
size_t estimate = (4 * l) + 3;
TSRMLS_FETCH();
cmd = safe_emalloc(4, l, 3); /* worst case */
#ifdef PHP_WIN32
cmd[y++] = '"';
#else
cmd[y++] = '\'';
#endif
for (x = 0; x < l; x++) {
int mb_len = php_mblen(str + x, (l ... | vuln | Vulnerable | C/C++ |
public static void applyCooldown(PlayerEntity player, IModifierToolStack toolStack, int cooldownTime) {
applyCooldown(player, Math.round(cooldownTime / toolStack.getStats().getFloat(ToolStats.ATTACK_SPEED)));
} | vuln | Safe | Java |
char *parse_tags(ASS_Renderer *render_priv, char *p, char *end, double pwr)
{
for (char *q; p < end; p = q) {
while (*p != '\\' && p != end)
++p;
if (*p != '\\')
break;
++p;
if (p != end)
skip_spaces(&p);
q = p;
while (*q != '(' &&... | vuln | Safe | Unknown |
public boolean saveDocument(final boolean forceSaveEmpty) {
// Document is written iff writeable && content has changed
final CharSequence text = _hlEditor.getText();
if (_document != null && !_document.isContentSame(text) && checkPermissions() && isAdded()) {
if (_document.saveConte... | vuln | Safe | Java |
TEST_F(SingleAllowMissingInOrListTest, MissingIssToken) {
EXPECT_CALL(mock_cb_, onComplete(Status::JwtUnknownIssuer));
auto headers = Http::TestRequestHeaderMapImpl{{kExampleHeader, ES256WithoutIssToken}};
context_ = Verifier::createContext(headers, parent_span_, &mock_cb_);
verifier_->verify(context_);
EXPEC... | vuln | Safe | Unknown |
public void update()
{
if (client.getGameState() != GameState.LOGGED_IN)
{
return;
}
if (hotswapScheduled)
{
hotswapScheduled = false;
Path lightsConfigPath = Env.getPath(ENV_LIGHTS_CONFIG);
if (lightsConfigPath != null && lightsConfigPath.toFile().exists())
{
reloadLightConfiguration(lig... | vuln | Vulnerable | Java |
int socket_accept(int fd, uint16_t port)
{
#ifdef WIN32
int addr_len;
#else
socklen_t addr_len;
#endif
int result;
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(port);
addr_len = sizeof(addr);
result = acce... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.