code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static Image *ReadWPGImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
typedef struct
{
size_t FileId;
MagickOffsetType DataOffset;
unsigned int ProductType;
unsigned int FileType;
unsigned char MajorVersion;
unsigned char MinorVersion;
unsigned int EncryptKey;
unsigne... | cwe | CWE-119 | Unknown |
var apply = function(color, disableUpdate, forceUpdate)
{
if (!applying)
{
var defaultValue = (defaultColor == 'null') ? null : defaultColor;
applying = true;
color = (/(^#?[a-zA-Z0-9]*$)/.test(color)) ? color : defaultValue;
var tempColor = (color != null && color != mxConstants.NONE) ? color : defau... | cwe | CWE-94 | JavaScript |
function set(part, value, fn) {
var url = this;
switch (part) {
case 'query':
if ('string' === typeof value && value.length) {
value = (fn || qs.parse)(value);
}
url[part] = value;
break;
case 'port':
url[part] = value;
if (!required(value, url.protocol)) {
... | cwe | CWE-639 | JavaScript |
void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
const TensorShape& input_shape = input.shape();
const Tensor& out_backprop = context->input(2);
const TensorShape& out_backprop_shape = out_backprop.shape();
TensorShape filter_shape;
if (takes_shape_) {... | cwe | CWE-703 | Unknown |
_nc_find_entry(const char *string,
const HashValue * hash_table)
{
bool termcap = (hash_table != _nc_get_hash_table(FALSE));
const HashData *data = _nc_get_hash_info(termcap);
int hashvalue;
struct name_table_entry const *ptr = 0;
struct name_table_entry const *real_table;
hashvalue = d... | cwe | CWE-125 | Unknown |
TPMI_DH_PARENT_Unmarshal(TPMI_DH_PARENT *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
BOOL isNotTransient = (*target < TRANSIENT_FIRST) || (*target > T... | cwe | CWE-787 | Unknown |
int cap_bprm_set_creds(struct linux_binprm *bprm)
{
const struct cred *old = current_cred();
struct cred *new = bprm->cred;
bool effective, has_cap = false;
int ret;
effective = false;
ret = get_file_caps(bprm, &effective, &has_cap);
if (ret < 0)
return ret;
if (!issecure(SECURE_NOROOT)) {
/*
* If the ... | cwe | CWE-264 | C/C++ |
QPDFNameTreeObjectHelper::updateMap(QPDFObjectHandle oh)
{
if (this->m->seen.count(oh.getObjGen()))
{
return;
}
this->m->seen.insert(oh.getObjGen());
QPDFObjectHandle names = oh.getKey("/Names");
if (names.isArray())
{
size_t nitems = names.getArrayNItems();
size_t i ... | cwe | CWE-787 | Unknown |
mojo::ScopedSharedBufferHandle GamepadProvider::GetSharedBufferHandle() {
base::SharedMemoryHandle handle = base::SharedMemory::DuplicateHandle(
gamepad_shared_buffer_->shared_memory()->handle());
return mojo::WrapSharedMemoryHandle(handle, sizeof(GamepadHardwareBuffer),
... | cwe | CWE-787 | C/C++ |
Status ValidateInputsGenerateOutputs(
OpKernelContext* ctx, const Tensor** inputs, const Tensor** seq_len,
Tensor** log_prob, OpOutputList* decoded_indices,
OpOutputList* decoded_values, OpOutputList* decoded_shape) const {
Status status = ctx->input("inputs", inputs);
if (!status.ok()) return... | cwe | CWE-369 | C/C++ |
static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts)
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
if (!strcmp(name, EL_PACKET)) {
int i;
if (atts) for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VERSION)) {
/* nothing for now */
}
}
} el... | cwe | CWE-502 | Unknown |
Pl_AES_PDF::finish()
{
if (this->encrypt)
{
if (this->offset == this->buf_size)
{
flush(false);
}
if (! this->disable_padding)
{
// Pad as described in section 3.5.1 of version 1.7 of the PDF
// specification, including providing an entire block of padding
... | cwe | CWE-787 | Unknown |
function systemEndpoints(app) {
if (!app) return;
app.get("/ping", (_, response) => {
response.status(200).json({ online: true });
});
app.get("/migrate", async (_, response) => {
const execSync = require("child_process").execSync;
execSync("npx prisma migrate deploy --schema=./prisma/schema.prism... | cwe | CWE-284 | JavaScript |
void HeapAllocator::backingFree(void* address) {
if (!address)
return;
ThreadState* state = ThreadState::current();
if (state->sweepForbidden())
return;
ASSERT(!state->isInGC());
BasePage* page = pageFromObject(address);
if (page->isLargeObjectPage() || page->arena()->getThreadState() != state)
... | cwe | CWE-787 | C/C++ |
bool IsFullyConnectedOpSupported(const TfLiteRegistration* registration,
const TfLiteNode* node,
TfLiteContext* context) {
if (node->builtin_data == nullptr) return false;
const auto* fc_params =
reinterpret_cast<const TfLiteFullyConnectedParam... | cwe | CWE-125 | C/C++ |
int dd_exist(const struct dump_dir *dd, const char *path)
{
char *full_path = concat_path_file(dd->dd_dirname, path);
int ret = exist_file_dir(full_path);
free(full_path);
return ret;
} | cwe | CWE-22 | 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... | cwe | CWE-269 | Java |
static const uint MaxVolumes=65535;
RecVolumes5::RecVolumes5(bool TestOnly)
{
RealBuf=NULL;
RealReadBuffer=NULL;
DataCount=0;
RecCount=0;
TotalCount=0;
RecBufferSize=0;
for (uint I=0;I<ASIZE(ThreadData);I++)
{
ThreadData[I].RecRSPtr=this;
ThreadData[I].RS=NULL;
}
if (TestOnly)
{
#ifdef... | cwe | CWE-787 | C/C++ |
static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
int parse_extradata)
{
AVCodecContext *const avctx = h->avctx;
H264Context *hx; ///< thread context
int buf_index;
int context_count;
int next_avc;
int pass = !(avctx->active_thread_type & F... | cwe | CWE-787 | Unknown |
function handleValidateAuthToken({ body }, meetingId) {
const {
userId,
valid,
authToken,
waitForApproval,
registeredOn,
authTokenValidatedOn,
reasonCode,
} = body;
check(userId, String);
check(authToken, String);
check(valid, Boolean);
check(waitForApproval, Boolean);
check(r... | cwe | CWE-79 | JavaScript |
package org.platformlambda.automation.util;
import org.platformlambda.automation.models.HeaderInfo;
import org.platformlambda.core.util.Utility;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SimpleHtt... | cwe | CWE-611 | Java |
/********************************************************************************/
/* */
/* NVRAM File Abstraction Layer */
/* Written by Ken Goldman ... | cwe | CWE-125 | C/C++ |
pq_getstring(StringInfo s)
{
int i;
resetStringInfo(s);
/* Read until we get the terminating '\0' */
for (;;)
{
while (PqRecvPointer >= PqRecvLength)
{
if (pq_recvbuf()) /* If nothing in buffer, then recv some */
return EOF; /* Failed to recv data */
}
for (i = PqRecvPointer; i < PqRecvLength;... | cwe | CWE-89 | Unknown |
static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
FILE
*file;
Image
*image,
*next_image,
*pwp_image;
ImageInfo
*read_info;
int
c,
unique_file;
MagickBooleanType
status;
register Image
*p;
register ssize_t
i;
size_t
files... | cwe | CWE-416 | Unknown |
constructor(url) {
let progressIndicatorElement = $.progressIndicator({
position: 'html',
blockInfo: {
enabled: true
}
});
app.showModalWindow(null, url, () => {
this.contentsCotainer = $('.js-filter-modal__container');
this.advanceFilterInstance = new Vtiger_ConditionBuilder_Js(
this.conte... | cwe | CWE-79 | JavaScript |
static int mount_entry_on_relative_rootfs(struct mntent *mntent,
const char *rootfs)
{
char path[MAXPATHLEN];
int ret;
/* relative to root mount point */
ret = snprintf(path, sizeof(path), "%s/%s", rootfs, mntent->mnt_dir);
if (ret >= sizeof(path)) {
ERROR("path name too long");
return -1;
}
return ... | cwe | CWE-61 | Unknown |
png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
int num)
{
png_debug(1, "in png_free_data");
if (png_ptr == NULL || info_ptr == NULL)
return;
#ifdef PNG_TEXT_SUPPORTED
/* Free text item num or (if num == -1) all text items */
if (info_ptr->text != NULL &&
... | cwe | CWE-476 | C/C++ |
const std::string& get_id() const {
ceph_assert(t != Wildcard && t != Tenant);
return u.id;
} | cwe | CWE-617 | Unknown |
static Frame* ReuseExistingWindow(LocalFrame& active_frame,
LocalFrame& lookup_frame,
const AtomicString& frame_name,
NavigationPolicy policy,
const KURL& destination_url) {
if (!fra... | cwe | CWE-20 | C/C++ |
main (int argc, char **argv)
{ STATE state ;
SF_INFO sfinfo ;
char pathname [512], ext [32], *cptr ;
int ch, double_split ;
if (argc != 2)
{ if (argc != 1)
puts ("\nError : need a single input file.\n") ;
usage_exit () ;
} ;
memset (&state, 0, sizeof (state)) ;
memset (&sfinfo, 0, sizeof (sfinfo)) ;
i... | cwe | CWE-476 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-190 | C/C++ |
u.insertBefore(N,u.firstChild):u.appendChild(N)):N=N[0];u=null!=W.createElementNS?W.createElementNS(mxConstants.NS_SVG,"style"):W.createElement("style");u.setAttribute("type","text/css");mxUtils.setTextContent(u,J);N.appendChild(u)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCan... | cwe | CWE-20 | JavaScript |
MagickExport Image *AdaptiveThresholdImage(const Image *image,
const size_t width,const size_t height,const double bias,
ExceptionInfo *exception)
{
#define AdaptiveThresholdImageTag "AdaptiveThreshold/Image"
CacheView
*image_view,
*threshold_view;
Image
*threshold_image;
MagickBooleanType
... | cwe | CWE-125 | Unknown |
void gps_tracker( void )
{
ssize_t unused;
int gpsd_sock;
char line[256], *temp;
struct sockaddr_in gpsd_addr;
int ret, is_json, pos;
fd_set read_fd;
struct timeval timeout;
/* attempt to connect to localhost, port 2947 */
pos = 0;
gpsd_sock = socket( AF_INET, SOCK_STREAM, 0 );
... | cwe | CWE-787 | C/C++ |
protected function _validateSecretKey()
{
if (is_array($this->_publicActions) && in_array($this->getRequest()->getActionName(), $this->_publicActions)) {
return true;
}
if (!($secretKey = $this->getRequest()->getParam(Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME, null))
... | cwe | CWE-352 | PHP |
static void fpm_child_resources_use(struct fpm_child_s *child) /* {{{ */
{
struct fpm_worker_pool_s *wp;
for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
if (wp == child->wp || wp == child->wp->shared) {
continue;
}
fpm_scoreboard_free(wp->scoreboard);
}
fpm_scoreboard_child_use(child->wp->scoreboard,... | cwe | CWE-787 | Unknown |
private boolean tryUnpackZipFile(final File importSandboxDirectory, final MultipartFile multipartFile) {
/* Extract ZIP contents */
ZipEntry zipEntry = null;
InputStream inputStream = null;
ZipInputStream zipInputStream = null;
boolean foundEntry = false;
try {
... | cwe | CWE-22 | Java |
static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
uint chip;
ulong addr;
int alen;
int count;
uchar byte;
ulong crc;
ulong err;
int ret = 0;
#if CONFIG_IS_ENABLED(DM_I2C)
struct udevice *dev;
#endif
if (argc < 4)
return CMD_RET_USAGE;
/*
* Chip is always spe... | cwe | CWE-787 | Unknown |
static Jsi_RC NumberToStringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
char buf[500];
int radix = 10, skip = 0, argc = Jsi_ValueGetLength(interp, args);
Jsi_Number num;
Jsi_Value *v;
ChkStringN(_this, funcPtr, v);
Jsi_GetDoubleFromValue(i... | cwe | CWE-120 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre, Cyril Concolato
* Copyright (c) Telecom ParisTech 2000-2022
* All rights reserved
*
* This file is part of GPAC / Scene Management sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms ... | cwe | CWE-404 | C/C++ |
static int chacha20_poly1305_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
void *ptr)
{
EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
switch(type) {
case EVP_CTRL_INIT:
if (actx == NULL)
actx = ctx->cipher_data
= OPENSSL_zalloc(sizeof(*act... | cwe | CWE-327 | Unknown |
function $(t){return u&&y(t,p)} | cwe | CWE-1333 | JavaScript |
/* Copyright 2021 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... | cwe | CWE-787 | Python |
public AESCMAC()
{
super(new CMac(new AESFastEngine()));
} | cwe | CWE-310 | Java |
vhost_scsi_make_tpg(struct se_wwn *wwn,
struct config_group *group,
const char *name)
{
struct vhost_scsi_tport *tport = container_of(wwn,
struct vhost_scsi_tport, tport_wwn);
struct vhost_scsi_tpg *tpg;
unsigned long tpgt;
int ret;
if (strstr(name, "tpgt_") != name)
return ERR_PTR(-EINVAL)... | cwe | CWE-119 | C/C++ |
xfs_attr_shortform_list(xfs_attr_list_context_t *context)
{
attrlist_cursor_kern_t *cursor;
xfs_attr_sf_sort_t *sbuf, *sbp;
xfs_attr_shortform_t *sf;
xfs_attr_sf_entry_t *sfe;
xfs_inode_t *dp;
int sbsize, nsbuf, count, i;
int error;
ASSERT(context != NULL);
dp = context->dp;
ASSERT(dp != NULL);
ASSERT(dp->i... | cwe | CWE-400 | C/C++ |
var CommentsWindow=function(b,f,l,d,t,u){function E(){for(var H=N.getElementsByTagName("div"),F=0,J=0;J<H.length;J++)"none"!=H[J].style.display&&H[J].parentNode==N&&F++;K.style.display=0==F?"block":"none"}function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}... | cwe | CWE-94 | JavaScript |
// Package hamt implements a Hash Array Mapped Trie over ipfs merkledag nodes.
// It is implemented mostly as described in the wikipedia article on HAMTs,
// however the table size is variable (usually 256 in our usages) as opposed to
// 32 as suggested in the article. The hash function used is currently
// Murmur3, b... | cwe | CWE-400 | Go |
TfLiteStatus LessEval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
bool requires_broadcast = !HaveSameShapes(in... | cwe | CWE-125 | C/C++ |
Array.prototype.push.apply(N.shape.customProperties,Editor.commonEdgeProperties)),T(N.shape.customProperties));u=u.getAttribute("customProperties");if(null!=u)try{T(JSON.parse(u))}catch(Q){}}};var x=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var u=this.editorUi.getSelectionState();"image... | cwe | CWE-20 | JavaScript |
brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params, u64 *cookie)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct ieee80211_channel *chan = params->chan;
const u8 *buf = params->buf;
size_t len = params->len;
const struct ieee80211_... | cwe | CWE-119 | C/C++ |
int imap_subscribe(char *path, bool subscribe)
{
struct ImapData *idata = NULL;
char buf[LONG_STRING];
char mbox[LONG_STRING];
char errstr[STRING];
struct Buffer err, token;
struct ImapMbox mx;
if (!mx_is_imap(path) || imap_parse_path(path, &mx) || !mx.mbox)
{
mutt_error(_("Bad mailbox name")... | cwe | CWE-77 | 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... | cwe | CWE-681 | Python |
public function saveOption(Request $request) {
$cleanFromXss = true;
$option = $request->all();
// Allow for this keys
if (isset($option['option_key'])) {
if ($option['option_key'] == 'website_head') {
$cleanFromXss = false;
}
if ($op... | cwe | CWE-79 | PHP |
static void usb_ehci_pci_exit(PCIDevice *dev)
{
EHCIPCIState *i = PCI_EHCI(dev);
static void usb_ehci_pci_reset(DeviceState *dev)
{
PCIDevice *pci_dev = PCI_DEVICE(dev);
EHCIPCIState *i = PCI_EHCI(pci_dev);
EHCIState *s = &i->ehci;
ehci_reset(s);
}
static void usb_ehci_pci_write_config(PCIDevice... | cwe | CWE-772 | Unknown |
double ConvolverNode::latencyTime() const
{
return m_reverb ? m_reverb->latencyFrames() / static_cast<double>(sampleRate()) : 0;
} | cwe | CWE-362 | C/C++ |
func MigratePost(c *context.Context, f form.MigrateRepo) {
c.Data["Title"] = c.Tr("new_migrate")
ctxUser := checkContextUser(c, f.Uid)
if c.Written() {
return
}
c.Data["ContextUser"] = ctxUser
if c.HasError() {
c.Success(MIGRATE)
return
}
remoteAddr, err := f.ParseRemoteAddr(c.User)
if err != nil {
... | cwe | CWE-918 | Go |
'select': function(e) {
if((e.hasAttribute('multiple') === false) && $(e).hasClass('nosearch') === false) {
$(e).select2({
dropdownAutoWidth : true,
// break a select option item into multi lines
templateResult: function(item) {
var selectionText = item.text.split('\n');
var returnString = $... | cwe | CWE-79 | JavaScript |
function A(){function ea(ra,ia){var Da=mxResources.get(ra);null==Da&&(Da=ra.substring(0,1).toUpperCase()+ra.substring(1));18<Da.length&&(Da=Da.substring(0,18)+"…");return Da+" ("+ia.length+")"}function ta(ra,ia,Da){mxEvent.addListener(ia,"click",function(){Ea!=ia&&(Ea.style.backgroundColor="",Ea=ia,Ea.style.back... | cwe | CWE-94 | JavaScript |
nm_wildcard_match_check(const char *str, const char *const *patterns, guint num_patterns)
{
gboolean has_optional = FALSE;
gboolean has_any_optional = FALSE;
guint i;
for (i = 0; i < num_patterns; i++) {
gboolean is_inverted;
gboolean is_mandatory;
gboolean match... | cwe | CWE-20 | C/C++ |
EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var b=this.editor.graph,e=document.createElement("div");e.style.position="relative";e.style.display="inline-block";e.style.verticalAlign="top";e.style.height=this.tabContainer.style.height;e.style.whiteSpace="nowrap";e.style.... | cwe | CWE-94 | JavaScript |
GlyphCache::Loader::Loader(const Face & face, const bool dumb_font)
: _head(face, Tag::head),
_hhea(face, Tag::hhea),
_hmtx(face, Tag::hmtx),
_glyf(face, Tag::glyf),
_loca(face, Tag::loca),
_long_fmt(false),
_has_boxes(false),
_num_glyphs_graphics(0),
_num_glyphs_attributes(0),
_num_attrs(0)
{
if ... | cwe | CWE-476 | C/C++ |
BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* rect)
{
const RECTANGLE_16* srcExtents;
RECTANGLE_16* dstExtents;
const RECTANGLE_16* currentBand, *endSrcRect, *nextBand;
REGION16_DATA* newItems = NULL;
RECTANGLE_16* dstRect = NULL;
UINT32 usedRects, srcNbRects;
UINT16 topInterBa... | cwe | CWE-401 | Unknown |
int bus_verify_polkit_async(
sd_bus_message *call,
int capability,
const char *action,
const char **details,
bool interactive,
uid_t good_user,
Hashmap **registry,
sd_bus_error *ret_error) {
... | cwe | CWE-416 | Unknown |
Aa.style.padding="0px";Aa.style.boxShadow="none";Aa.className="geMenuItem";Aa.style.display="inline-block";Aa.style.width="40px";Aa.style.height="12px";Aa.style.marginBottom="-2px";Aa.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")";Aa.style.backgroundPosition="top center";Aa.style.backgroundRepeat="n... | cwe | CWE-94 | JavaScript |
void NavigatorImpl::DidNavigate(
RenderFrameHostImpl* render_frame_host,
const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
std::unique_ptr<NavigationHandleImpl> navigation_handle) {
FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree();
bool oopifs_possible = SiteIsolation... | cwe | CWE-254 | C/C++ |
static ssize_t snd_seq_write(struct file *file, const char __user *buf,
size_t count, loff_t *offset)
{
struct snd_seq_client *client = file->private_data;
int written = 0, len;
int err = -EINVAL;
struct snd_seq_event event;
if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT))
return -ENXIO;
/* ch... | cwe | CWE-119 | Unknown |
local block_state deflate_slow(s, flush)
deflate_state *s;
int flush;
{
IPos hash_head; /* head of hash chain */
int bflush; /* set if current block must be flushed */
/* Process the input block. */
for (;;) {
/* Make sure that we always have enough lookahead, exce... | cwe | CWE-284 | Unknown |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <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 the
* <a href="http://www.apache... | cwe | CWE-91 | Java |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2012
*
* This file is part of GPAC / MPEG2-TS sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as publishe... | cwe | CWE-125 | C/C++ |
function initEnv() {
$iParams = array("reqURI" => array(tlInputParameter::STRING_N,0,4000));
$pParams = G_PARAMS($iParams);
$args = new stdClass();
$args->ssodisable = getSSODisable();
// CWE-79:
// Improper Neutralization of Input
// During Web Page Generation ('Cross-site Scripting')
//
// ht... | cwe | CWE-79 | PHP |
static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
MagickBooleanType
status;
MagickOffsetType
offset,
*page_table,
scene;
MemoryInfo
*pixel_info;
PCXInfo
pcx_info;
register const Quantum
*p;
register ssize_t
i,
... | cwe | CWE-703 | C/C++ |
void *memslot_get_virt(RedMemSlotInfo *info, QXLPHYSICAL addr, uint32_t add_size,
int group_id)
{
int slot_id;
int generation;
unsigned long h_virt;
MemSlot *slot;
if (group_id > info->num_memslots_groups) {
spice_critical("group_id too big");
return NULL;
... | cwe | CWE-193 | C/C++ |
explicit DataFormatVecPermuteOp(OpKernelConstruction* context)
: OpKernel(context) {
string src_format;
OP_REQUIRES_OK(context, context->GetAttr("src_format", &src_format));
string dst_format;
OP_REQUIRES_OK(context, context->GetAttr("dst_format", &dst_format));
src_format_ = src_format;
d... | cwe | CWE-125 | Unknown |
# Copyright (c) 2017 Ansible, Inc.
# All Rights Reserved.
from django.conf.urls import url
from oauthlib import oauth2
from oauth2_provider import views
from awx.api.views import (
ApiOAuthAuthorizationRootView,
)
class TokenView(views.TokenView):
def create_token_response(self, request):
try:
... | cwe | CWE-613 | Python |
function prepareInputForAdd($input) {
//If it's the first ldap directory then set it as the default directory
if (!self::getNumberOfServers()) {
$input['is_default'] = 1;
}
if (isset($input["rootdn_passwd"]) && !empty($input["rootdn_passwd"])) {
$input["rootdn_passwd"] = Tool... | cwe | CWE-327 | PHP |
gss_wrap( OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
gss_buffer_t input_message_buffer,
int *conf_state,
gss_buffer_t output_message_buffer)
{
/* EXPORT DELETE START */
OM_uint32 status;
... | cwe | CWE-415 | C/C++ |
static int gtco_probe(struct usb_interface *usbinterface,
const struct usb_device_id *id)
{
struct gtco *gtco;
struct input_dev *input_dev;
struct hid_descriptor *hid_desc;
char *report;
int result = 0, retry;
int error;
struct usb_endpoint_d... | cwe | CWE-703 | C/C++ |
function renderSelectTemplates(formElement, template) {
var appendMultiValue, defaultValue, multiValueTemplateContent, propertyPath, propertyValue;
multiValueTemplateContent = $(
getHelper().getDomElementDataIdentifierSelector('multiValueContainer'),
$(template)
).clone();
$(get... | cwe | CWE-79 | JavaScript |
static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
{
struct sockaddr_rc *sa = (struct sockaddr_rc *) addr;
struct sock *sk = sock->sk;
int chan = sa->rc_channel;
int err = 0;
BT_DBG("sk %p %pMR", sk, &sa->rc_bdaddr);
if (!addr || addr->sa_family != AF_BLUETOOTH)
return -... | cwe | CWE-476 | C/C++ |
from dataclasses import dataclass
from typing import Dict, List, Optional, Type
import graphene
from django.core.exceptions import ValidationError
from django.db import transaction
from django.db.models import Model
from ...core.permissions import MenuPermissions, SitePermissions
from ...core.tracing import traced_at... | cwe | CWE-863 | Python |
static BROTLI_INLINE void GetBlockLengthPrefixCode(uint32_t len, size_t* code,
uint32_t* n_extra, uint32_t* extra) {
*code = BlockLengthPrefixCode(len);
*n_extra = kBlockLengthPrefixCode[*code].nbits;
*extra = len - kBlockLengthPrefixCode[*code].offset;
} | cwe | CWE-120 | Unknown |
void enter_network_namespace(pid_t pid) {
// in case the pid is that of a firejail process, use the pid of the first child process
pid_t child = switch_to_child(pid);
// exit if no permission to join the sandbox
check_join_permission(child);
// check network namespace
char *name;
if (asprintf(&name, "/run/fire... | cwe | CWE-269 | Unknown |
GET_DCC_REC *dcc_get_create(IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
const char *nick, const char *arg)
{
GET_DCC_REC *dcc;
dcc = g_new0(GET_DCC_REC, 1);
dcc->orig_type = module_get_uniq_id_str("DCC", "SEND");
dcc->type = module_get_uniq_id_str("DCC", "GET");
dcc->fhandle = -1;
dcc_init_rec(DCC(dcc), ... | cwe | CWE-416 | Unknown |
/*
* L2TPv3 IP encapsulation support for IPv6
*
* Copyright (c) 2012 Katalix Systems Ltd
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your ... | cwe | CWE-264 | C/C++ |
find_add_addrs(struct module_env* env, uint16_t qclass,
struct regional* region, struct delegpt* dp, time_t now,
struct dns_msg** msg)
{
struct delegpt_ns* ns;
struct msgreply_entry* neg;
struct ub_packed_rrset_key* akey;
for(ns = dp->nslist; ns; ns = ns->next) {
akey = rrset_cache_lookup(env->rrset_cache, ns... | cwe | CWE-400 | Unknown |
tiff_document_get_thumbnail (EvDocument *document,
EvRenderContext *rc)
{
TiffDocument *tiff_document = TIFF_DOCUMENT (document);
int width, height;
int scaled_width, scaled_height;
float x_res, y_res;
gint rowstride, bytes;
guchar *pixels = NULL;
GdkPixbuf *pixbuf;
GdkPixbuf *scaled_pixbuf;
GdkPi... | cwe | CWE-754 | C/C++ |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
from cryptography.exceptions i... | cwe | CWE-20 | Python |
static int date_from_ISO8601 (const char *text, time_t * value) {
struct tm tm;
* Begin Time Functions *
***********************/
static int date_from_ISO8601 (const char *text, time_t * value) {
struct tm tm;
int n;
int i;
char buf[18];
if (strchr (text, '-')) {
cha... | cwe | CWE-119 | Unknown |
package secretservice
/*
#cgo pkg-config: libsecret-1
#include "secretservice_linux.h"
#include <stdlib.h>
*/
import "C"
import (
"errors"
"unsafe"
"github.com/docker/docker-credential-helpers/credentials"
)
// Secretservice handles secrets using Linux secret-service as a store.
type Secretservice struct{}
// A... | cwe | CWE-415 | Go |
package com.salesmanager.core.business.services.catalog.product.attribute;
import java.util.List;
import javax.inject.Inject;
import org.springframework.stereotype.Service;
import com.salesmanager.core.business.exception.ServiceException;
import com.salesmanager.core.business.repositories.catalog.product.attribute.... | cwe | CWE-639 | Java |
import re
from pathlib import Path
from urllib.parse import unquote
import base64
import json
import os
import requests
import time
import pytz
import pymongo
from shutil import rmtree
from requests.exceptions import ConnectionError
from os.path import join, exists
from django.shortcuts import render
from django.core.s... | cwe | CWE-77 | Python |
void PrintingMessageFilter::OnUpdatePrintSettingsReply(
scoped_refptr<printing::PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_PrintPages_Params params;
if (printer_query->last_status() != printing::PrintingContext::OK) {
params.Reset();
} else {
RenderParamsFromPrintSettin... | cwe | CWE-416 | C/C++ |
Status V2UserDocumentParser::checkValidUserDocument(const BSONObj& doc) const {
BSONElement userElement = doc[AuthorizationManager::USER_NAME_FIELD_NAME];
BSONElement userDBElement = doc[AuthorizationManager::USER_DB_FIELD_NAME];
BSONElement credentialsElement = doc[CREDENTIALS_FIELD_NAME];
BSONElement ... | cwe | CWE-613 | Unknown |
void color_cmyk_to_rgb(opj_image_t *image)
{
float C, M, Y, K;
float sC, sM, sY, sK;
unsigned int w, h, max, i;
w = image->comps[0].w;
h = image->comps[0].h;
if(image->numcomps < 4) return;
max = w * h;
sC = 1.0F / (float)((1 << image->comps[0].prec) - 1);
sM = 1.0F / (float)((1 << image->comps[1].p... | cwe | CWE-119 | C/C++ |
win_redr_status(win_T *wp, int ignore_pum UNUSED)
{
int row;
char_u *p;
int len;
int fillchar;
int attr;
int this_ru_col;
static int busy = FALSE;
// It's possible to get here recursively when 'statusline' (indirectly)
// invokes ":redrawstatus". Simply ignore the call then.
... | cwe | CWE-200 | C/C++ |
public static Map<String, String> genHeaderMapByRequest(HttpServletRequest request) {
Map<String, String> map = new HashMap<>();
AdminTokenVO adminTokenVO = AdminTokenThreadLocal.getUser();
if (adminTokenVO != null) {
User user = User.dao.findById(adminTokenVO.getUserId());
... | cwe | CWE-863 | Java |
psutil_pids(PyObject *self, PyObject *args) {
kinfo_proc *proclist = NULL;
kinfo_proc *orig_address = NULL;
size_t num_processes;
size_t idx;
PyObject *py_pid = NULL;
PyObject *py_retlist = PyList_New(0);
if (py_retlist == NULL)
return NULL;
if (psutil_get_proc_list(&proclist, ... | cwe | CWE-415 | Unknown |
package com.salesmanager.core.business.repositories.catalog.product.attribute;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.salesmanager.core.model.catalog.product.attribute.ProductOptionSet;
public interface Pr... | cwe | CWE-79 | Java |
static void *zrle_convert_fb(VncState *vs, int x, int y, int w, int h,
int bpp)
{
Buffer tmp;
buffer_reset(&vs->zrle.fb);
buffer_reserve(&vs->zrle.fb, w * h * bpp + bpp);
tmp = vs->output;
vs->output = vs->zrle.fb;
vnc_raw_send_framebuffer_update(vs, x, y, w, h);
... | cwe | CWE-401 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.