code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
kex_input_kexinit(int type, u_int32_t seq, void *ctxt) { struct ssh *ssh = ctxt; struct kex *kex = ssh->kex; const u_char *ptr; u_int i; size_t dlen; int r; debug("SSH2_MSG_KEXINIT received"); if (kex == NULL) return SSH_ERR_INVALID_ARGUMENT; ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->pee...
cwe
CWE-399
C/C++
/** * Copyright (c) 2015-present, Waysact Pty Ltd * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Template = require('webpack/lib/Template'); var util = require('./util'); function WebIntegrityJsonpMainTemplatePlugin(sriPlugin, ...
cwe
CWE-345
JavaScript
png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette) { png_uint_32 max_palette_length; png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PAL...
cwe
CWE-120
C/C++
void Compute(OpKernelContext* context) override { const Tensor& input = context->input(0); // MatrixDiagPart and MatrixDiagPartV2 both use this OpKernel. // MatrixDiagPart only has one input, so we have to check the number of // inputs before reading additional parameters in MatrixDiagV2. int32_t l...
cwe
CWE-125
C/C++
public function __construct( AuthManager $auth, Repository $config, CacheRepository $cache, UserRepositoryInterface $repository, ViewFactory $view ) { parent::__construct($auth, $config); $this->view = $view; $this->cache = $cache; $this->repo...
cwe
CWE-502
PHP
static void _rpc_prolog(slurm_msg_t *msg) { int rc = SLURM_SUCCESS; prolog_launch_msg_t *req = (prolog_launch_msg_t *)msg->data; job_env_t job_env; bool first_job_run; uid_t req_uid; if (req == NULL) return; req_uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info); if (!_slurm_authorized_user(...
cwe
CWE-20
Unknown
void SFS_ObjectMethodCall(ScriptParser *parser) { if (parser->codec->LastError) return; SFS_Expression(parser); SFS_AddString(parser, "."); SFS_Identifier(parser); SFS_AddString(parser, "("); SFS_Params(parser); SFS_AddString(parser, ")"); }
cwe
CWE-476
Unknown
async start() { if (this.server) { return } this.app = await this.createApp() if (this.port) { this.server = this.app.listen(this.port) } else { do { try { this.port = await getPort({ port: defaultWatchServerPort }) this.server = this.app.listen(this.p...
cwe
CWE-306
JavaScript
long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg) { int ret=0; switch (cmd) { case DTLS_CTRL_GET_TIMEOUT: if (dtls1_get_timeout(s, (struct timeval*) parg) != NULL) { ret = 1; } break; case DTLS_CTRL_HANDLE_TIMEOUT: ret = dtls1_handle_timeout(s); break; case DTLS_CTRL_LISTEN: ret = dtls...
cwe
CWE-310
Unknown
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
C/C++
long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct tty_struct *tty = file_tty(file); struct tty_struct *real_tty; void __user *p = (void __user *)arg; int retval; struct tty_ldisc *ld; if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl")) return -EINVAL; real_tty = tty_pair...
cwe
CWE-362
C/C++
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ package com.rebuild.core.support; import cn.devezhao.persist4j.Record; imp...
cwe
CWE-89
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-122
C/C++
duint32 dwgCompressor::litLength18(){ duint32 cont=0; duint8 ll = bufC[pos++]; //no literal length, this byte is next opCode if (ll > 0x0F) { pos--; return 0; } if (ll == 0x00) { cont = 0x0F; ll = bufC[pos++]; while (ll == 0x00){//repeat until ll != 0x00 ...
cwe
CWE-191
Unknown
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you under the Educational * Community License, Version 2.0 (the ...
cwe
CWE-863
Java
static int get_int32_le(QEMUFile *f, void *pv, size_t size) { int32_t loaded; int32_t loaded; qemu_get_sbe32s(f, &loaded); if (loaded <= *cur) { *cur = loaded; return 0; } }
cwe
CWE-119
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { TfLiteType output_type = GetOutput(context, node, kOutputTensor)->type; switch (output_type) { // Already know in/outtypes are same. case kTfLiteFloat32: EvalUnquantized<float>(context, node); break; case kTfLiteInt32: EvalUnq...
cwe
CWE-125
C/C++
sendDigest(username, lastSeenAt, email) { return ajax("/admin/email/send-digest.json", { data: { last_seen_at: lastSeenAt || oneWeekAgo(), username, email }, }); }
cwe
CWE-200
JavaScript
"use strict"; const etapiTokenService = require("./etapi_tokens"); const log = require('./log'); const sqlInit = require('./sql_init'); const utils = require('./utils'); const passwordEncryptionService = require('./password_encryption'); const config = require('./config'); const passwordService = require("./password")...
cwe
CWE-79
JavaScript
Packet *PacketTunnelPktSetup(ThreadVars *tv, DecodeThreadVars *dtv, Packet *parent, uint8_t *pkt, uint32_t len, enum DecodeTunnelProto proto, PacketQueue *pq) { int ret; SCEnter(); /* get us a packet */ Packet *p = PacketGetFromQueueOrAlloc(); ...
cwe
CWE-20
C/C++
void NavigatorImpl::DidFailProvisionalLoadWithError( RenderFrameHostImpl* render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() << ", error_code: " << params.error_code << ", erro...
cwe
CWE-20
C/C++
nf_ct_frag6_reasm(struct frag_queue *fq, struct sk_buff *prev, struct net_device *dev) { struct sk_buff *fp, *head = fq->q.fragments; int payload_len; u8 ecn; inet_frag_kill(&fq->q); WARN_ON(head == NULL); WARN_ON(head->ip_defrag_offset != 0); ecn = ip_frag_ecn_table[fq->ecn]; if (unlikely(ecn == 0xff)) ...
cwe
CWE-20
Unknown
nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct client *client = file->private_data; spinlock_t *client_list_lock = &client->lynx->client_list_lock; struct nosy_stats stats; switch (cmd) { case NOSY_IOC_GET_STATS: spin_lock_irq(client_list_lock); stats.total_packet_count = client->...
cwe
CWE-416
C/C++
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-20
Python
static int crypto_report_one(struct crypto_alg *alg, struct crypto_user_alg *ualg, struct sk_buff *skb) { memcpy(&ualg->cru_name, &alg->cra_name, sizeof(ualg->cru_name)); memcpy(&ualg->cru_driver_name, &alg->cra_driver_name, sizeof(ualg->cru_driver_name)); memcpy(&ualg->cru_module_name, module_name(a...
cwe
CWE-310
C/C++
static const char* ConvertScalar(PyObject* v, Eigen::half* out) { // NOTE(nareshmodi): Is there a way to convert to C double without the // intermediate Python double? This will help with ConvertOneFloat as well. Safe_PyObjectPtr as_float = make_safe(PyNumber_Float(v)); double v_double = PyFloat_AS_DOUB...
cwe
CWE-20
C/C++
def doLogout(request: GetRequest, redirectIfMayNotSeeUrlPath: Opt[St]): Result = { import request.{dao, requester, siteSettings} requester foreach { theRequester => request.dao.logout(theRequester, bumpLastSeen = true) } val goToNext: Opt[St] = siteSettings.effSsoLogoutAllRedirUrl orElse { ...
cwe
CWE-613
Scala
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-20
Python
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | +---------...
cwe
CWE-22
C/C++
int ContentLine_Analyzer::DoDeliverOnce(int len, const u_char* data) { const u_char* data_start = data; if ( len <= 0 ) return 0; for ( ; len > 0; --len, ++data ) { if ( offset >= buf_len ) InitBuffer(buf_len * 2); int c = data[0]; #define EMIT_LINE \ { \ buf[offset] = '\0'; \ int seq_len = data +...
cwe
CWE-787
C/C++
void DefaultEnv::Initialize() { sLog = new Log(); SetUpLog(); sEnv = new DefaultEnv(); sForkHandler = new ForkHandler(); sFileTimer = new FileTimer(); sPlugInManager = new PlugInManager(); sPlugInManager->ProcessEnvironmentSettings(); sForkHandler->RegisterF...
cwe
CWE-78
C/C++
static char *handle_new_problem(GVariant *problem_info, uid_t caller_uid, char **error) { problem_data_t *pd = problem_data_new(); GVariantIter *iter; g_variant_get(problem_info, "a{ss}", &iter); gchar *key, *value; while (g_variant_iter_loop(iter, "{ss}", &key, &value)) { problem_data_...
cwe
CWE-59
Unknown
func TestSkipUnknownTypeBinaryProtocol(t *testing.T) { var m MyTestStruct d := NewDeserializer() f := NewBinaryProtocolFactoryDefault() d.Protocol = f.GetProtocol(d.Transport) // skip over a map with invalid key/value type and 1.7B entries data := []byte("\n\x10\rO\t6\x03\n\n\n\x10\r\n\tslice\x00") start := time...
cwe
CWE-770
Go
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you under the Educational * Community License, Version 2.0 (the ...
cwe
CWE-74
Java
static Jsi_RC NumberToExponentialCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { char buf[100]; int prec = 0, skip = 0; Jsi_Number num; Jsi_Value *v; ChkStringN(_this, funcPtr, v); if (Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, ar...
cwe
CWE-120
C/C++
/* * Copyright (C) 2014-2018 Yubico AB - See COPYING */ #include "util.h" #include <u2f-server.h> #include <u2f-host.h> #include <stdlib.h> #include <fcntl.h> #include <sys/stat.h> #include <stdarg.h> #include <syslog.h> #include <pwd.h> #include <errno.h> #include <unistd.h> #include <string.h> int get_devices_...
cwe
CWE-200
C/C++
""" This module defines the things that are used in setup.py for building the notebook This includes: * Functions for finding things like packages, package data, etc. * A function for checking dependencies. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD Licens...
cwe
CWE-79
Python
decode_sequence_of(const uint8_t *asn1, size_t len, const struct atype_info *elemtype, void **seq_out, size_t *count_out) { krb5_error_code ret; void *seq = NULL, *elem, *newseq; const uint8_t *contents; size_t clen, count = 0; taginfo t; *seq_out = NULL; ...
cwe
CWE-674
Unknown
public static CloseResponseHandle getContext(String uri, String method, HttpServletRequest request, boolean disableRedirect) throws IOException, InstantiationException { String pluginServerHttp = Constants.pluginServer; CloseableHttpResponse httpResponse; CloseResponseHandle handle = new CloseRe...
cwe
CWE-863
Java
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "hermes/CompilerDriver/CompilerDriver.h" #include "hermes/AST/CommonJS.h" #include "hermes/AST/Context.h" #include "her...
cwe
CWE-681
C/C++
static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx, struct vrend_resource *res, const struct iovec *iov, int num_iovs, const struct vrend_transfer_info *info) { v...
cwe
CWE-787
Unknown
int lsm_set_label_at(int procfd, int on_exec, char* lsm_label) { int labelfd = -1; int ret = 0; const char* name; char* command = NULL; name = lsm_name(); if (strcmp(name, "nop") == 0) goto out; if (strcmp(name, "none") == 0) goto out; /* We don't support on-exec with AppArmor */ if (strcmp(...
cwe
CWE-264
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ Format = function(editorUi, container) { this.editorUi = editorUi; this.container = container; }; /** * Background color for inactive tabs. */ Format.inactiveTabBackgroundColor = '#f1f3f4'; /** * Icons for markers (24x16). */ Format.classicFilledMarkerImage = Graph...
cwe
CWE-79
JavaScript
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-754
C/C++
int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, int prediction_resistance, const unsigned char *adin, size_t adinlen) { int reseed_required = 0; if (drbg->state != DRBG_READY) { /* try to recover from previous errors */ ra...
cwe
CWE-330
Unknown
QPDFWriter::enqueueObject(QPDFObjectHandle object) { if (object.isIndirect()) { if (object.getOwningQPDF() != &(this->pdf)) { QTC::TC("qpdf", "QPDFWriter foreign object"); throw std::logic_error( "QPDFObjectHandle from different QPDF found while writing." ...
cwe
CWE-399
C/C++
static struct mnt_namespace *create_mnt_ns(struct vfsmount *m) { struct mnt_namespace *new_ns = alloc_mnt_ns(&init_user_ns); if (!IS_ERR(new_ns)) { struct mount *mnt = real_mount(m); mnt->mnt_ns = new_ns; new_ns->root = mnt; list_add(&mnt->mnt_list, &new_ns->list); } else { mntput(m); } return new_ns; }
cwe
CWE-703
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,...
cwe
CWE-125
C/C++
DECLAREContigPutFunc(putcontig8bitYCbCr21tile) { (void) y; fromskew = (fromskew * 4) / 2; do { x = w>>1; do { int32 Cb = pp[2]; int32 Cr = pp[3]; YCbCrtoRGB(cp[0], pp[0]); YCbCrtoRGB(cp[1], pp[1]); cp += 2; pp += 4; } while (--x); if( (w&1) != 0 ) { int32 Cb = pp[2]; int32 Cr = p...
cwe
CWE-119
Unknown
#include <gio/gio.h> #include <stdlib.h> #include <sys/types.h> #include <pwd.h> #include <grp.h> #include "libabrt.h" #include "abrt-polkit.h" #include "abrt_glib.h" #include <libreport/dump_dir.h> #include "problem_api.h" static GMainLoop *loop; static guint g_timeout_source; /* default, settable with -t: */ static ...
cwe
CWE-20
C/C++
/* radare - LGPL - Copyright 2019-2022 - GustavoLCR */ #include "ne.h" static char *__get_target_os(r_bin_ne_obj_t *bin) { switch (bin->ne_header->targOS) { case 1: return "OS/2"; case 2: return "Windows"; case 3: return "European MS-DOS 4.x"; case 4: return "Windows 386"; case 5: return "BOSS (Borlan...
cwe
CWE-125
C/C++
void __init xen_init_IRQ(void) { int ret = -EINVAL; evtchn_port_t evtchn; if (fifo_events) ret = xen_evtchn_fifo_init(); if (ret < 0) xen_evtchn_2l_init(); cpuhp_setup_state_nocalls(CPUHP_XEN_EVTCHN_PREPARE, "xen/evtchn:prepare", xen_evtchn_cpu_prepare, xen_evtchn_cpu_dead); evtchn_to_irq = kca...
cwe
CWE-400
Unknown
/* * DNxHD/VC-3 parser * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@free.fr> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * ...
cwe
CWE-476
C/C++
bool UsbChooserContext::HasDevicePermission( const GURL& requesting_origin, const GURL& embedding_origin, const device::mojom::UsbDeviceInfo& device_info) { if (UsbBlocklist::Get().IsExcluded(device_info)) return false; if (!CanRequestObjectPermission(requesting_origin, embedding_origin)) ...
cwe
CWE-119
C/C++
zrestore(i_ctx_t *i_ctx_p) { os_ptr op = osp; alloc_save_t *asave; bool last; vm_save_t *vmsave; int code = restore_check_operand(op, &asave, idmemory); if (code < 0) return code; if_debug2m('u', imemory, "[u]vmrestore 0x%lx, id = %lu\n", (ulong) alloc_save_clie...
cwe
CWE-78
Unknown
pcl_status_read(byte * data, uint max_data, pcl_state_t * pcs) { uint count = min(max_data, pcs->status.write_pos - pcs->status.read_pos); if (count) memcpy(data, pcs->status.buffer + pcs->status.read_pos, count); pcs->status.read_pos += count; if (pcs->status.read_pos == p...
cwe
CWE-787
Unknown
static void *gp_worker_main(void *pvt) { struct gp_thread *t = (struct gp_thread *)pvt; struct gp_query *q = NULL; char dummy = 0; int ret; while (!t->pool->shutdown) { /* initialize debug client id to 0 until work is scheduled */ gp_debug_set_conn_id(0); /* ======> COND_M...
cwe
CWE-667
C/C++
undo_time( long step, int sec, int file, int absolute) { long target; long closest; long closest_start; long closest_seq = 0; long val; u_header_T *uhp = NULL; u_header_T *last; int mark; int nomark = 0; // shut up compiler ...
cwe
CWE-787
Unknown
def get_node_status(session, cib_dom) node_status = { :cluster_name => $cluster_name, :groups => [], :constraints => { # :rsc_location => [], # :rcs_colocation => [], # :rcs_order => [] }, :cluster_settings => {}, :need_ring1_address => need_ring1_addr...
cwe
CWE-384
Ruby
static void dma_rx(struct b43_dmaring *ring, int *slot) { const struct b43_dma_ops *ops = ring->ops; struct b43_dmadesc_generic *desc; struct b43_dmadesc_meta *meta; struct b43_rxhdr_fw4 *rxhdr; struct sk_buff *skb; u16 len; int err; dma_addr_t dmaaddr; desc = ops->idx2desc(ring, *slot, &meta); sync_descbuf...
cwe
CWE-119
C/C++
void fx_DataView(txMachine* the) { txSlot* slot; txBoolean flag = 0; txInteger offset, size; txSlot* info; txSlot* instance; txSlot* view; txSlot* buffer; if (mxIsUndefined(mxTarget)) mxTypeError("call: DataView"); if ((mxArgc > 0) && (mxArgv(0)->kind == XS_REFERENCE_KIND)) { slot = mxArgv(0)->value.refere...
cwe
CWE-125
Unknown
void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride, int parity) { int bufsize = JPC_CEILDIVPOW2(numrows, 1); jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE]; jpc_fix_t *buf = splitbuf; register jpc_fix_t *srcptr; register jpc_fix_t *dstptr; register int n; register int m; int hstartcol; /* Get a buffer. *...
cwe
CWE-189
Unknown
static Image *ReadOneJNGImage(MngInfo *mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { Image *alpha_image, *color_image, *image, *jng_image; ImageInfo *alpha_image_info, *color_image_info; MagickBooleanType logging; ssize_t y; MagickBooleanType st...
cwe
CWE-772
C/C++
it 'should verify a standard RS256 token' do domain = 'example.org' sub = 'abc123' payload = { sub: sub, exp: future_timecode, iss: "https://#{domain}/", iat: past_timecode, aud: client_id, kid: jwks_kid } token = make_rs256_token(payload) ...
cwe
CWE-287
Ruby
package commands import ( "context" "fmt" "sync" tupleUtils "github.com/openfga/openfga/pkg/tuple" "github.com/openfga/openfga/pkg/utils" serverErrors "github.com/openfga/openfga/server/errors" "github.com/openfga/openfga/storage" openfgapb "go.buf.build/openfga/go/openfga/api/openfga/v1" ) // Keeping the in...
cwe
CWE-863
Go
// Copyright (c) 2020 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. // // WSO2 Inc. licenses this file to you 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/licens...
cwe
CWE-306
Java
/* * gd_gd2.c * * Implements the I/O and support for the GD2 format. * * Changing the definition of GD2_DBG (below) will cause copious messages * to be displayed while it processes requests. * * Designed, Written & Copyright 1999, Philip Warner. * */ /** * File: GD2 IO * * Read and write...
cwe
CWE-20
C/C++
static int __videobuf_mmap_mapper(struct videobuf_queue *q, struct vm_area_struct *vma) { struct videbuf_vmalloc_memory *mem; struct videobuf_mapping *map; unsigned int first; int retval; unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; if (! (vma->vm_flags & VM_WRITE) || ! (vma->vm_flags & VM_SHARED)) ...
cwe
CWE-787
Unknown
#include "source/extensions/filters/http/oauth2/filter.h" #include <algorithm> #include <chrono> #include <memory> #include <string> #include <vector> #include "source/common/common/assert.h" #include "source/common/common/empty_string.h" #include "source/common/common/enum_to_int.h" #include "source/common/common/fm...
cwe
CWE-617
C/C++
int xenvif_kthread_guest_rx(void *data) { struct xenvif *vif = data; struct sk_buff *skb; while (!kthread_should_stop()) { wait_event_interruptible(vif->wq, rx_work_todo(vif) || kthread_should_stop()); if (kthread_should_stop()) break; if (vif->rx_queue_purge) { skb_queue_purge(&vif->rx_que...
cwe
CWE-399
Unknown
void WT_InterpolateMono (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame) { EAS_I32 *pMixBuffer; const EAS_I8 *pLoopEnd; const EAS_I8 *pCurrentPhaseInt; EAS_I32 numSamples; EAS_I32 gain; EAS_I32 gainIncrement; EAS_I32 currentPhaseFrac; EAS_I32 phaseInc; EAS_I32 tmp0; EAS_I32 tmp1; ...
cwe
CWE-119
C/C++
setTimeout(function(){Ia.style.display="none"},4E3)}function z(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",p=X,X=null)}function L(fa,ca,ba,ja,ia,ma,qa){if(-1<fa.className.indexOf("geTempDlgRadioBtnActive"))return!1;fa.className+=" geTempDlgRadioBtnActive";Q.querySelector(".geTempDlgRadioBtn[da...
cwe
CWE-20
JavaScript
) => { return [ isValidVideoIdParam('id'), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videosGet parameters', { parameters: req.params }) if (areValidationErrors(req, res)) return if (!await doesVideoExist(req.params.id, res, ...
cwe
CWE-284
JavaScript
static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) { if (cid != ctx->cid) { const CIDEntry *cid_table = ff_dnxhd_get_cid_table(cid); if (!cid_table) { av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %"PRIu32"\n", cid); return AVERROR(ENOSYS); ...
cwe
CWE-125
C/C++
static int do_seekable(__G__ lastchance) /* return PK-type error code */ __GDEF int lastchance; { #ifndef SFX /* static int no_ecrec = FALSE; SKM: moved to globals.h */ int maybe_exe=FALSE; int too_weird_to_continue=FALSE; #ifdef TIMESTAMP time_t uxstamp; ulg nmember = 0L; #endif #en...
cwe
CWE-400
Unknown
pqParseInput3(PGconn *conn) { char id; int msgLength; int avail; /* * Loop to parse successive complete messages available in the buffer. */ for (;;) { /* * Try to read a message. First get the type code and length. Return * if not enough data. */ conn->inCursor = conn->inStart; if (pqGe...
cwe
CWE-119
Unknown
static void Rp_test(js_State *J) { js_Regexp *re; const char *text; int opts; Resub m; re = js_toregexp(J, 0); text = js_tostring(J, 1); opts = 0; if (re->flags & JS_REGEXP_G) { if (re->last > strlen(text)) { re->last = 0; js_pushboolean(J, 0); return; } if (re->last > 0) { text += re->last;...
cwe
CWE-674
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-754
C/C++
bool WebContents::SendIPCMessageToFrame(bool internal, int32_t frame_id, const std::string& channel, v8::Local<v8::Value> args) { v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); blink:...
cwe
CWE-668
C/C++
static ssize_t rbd_config_info_show(struct device *dev, struct device_attribute *attr, char *buf) { struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); return sprintf(buf, "%s\n", rbd_dev->config_info); }
cwe
CWE-863
Unknown
jbig2_find_changing_element(const byte *line, int x, int w) { int a, b; if (line == 0) return w; if (x == -1) { a = 0; x = 0; } else { } while (x < w) { b = getbit(line, x); if (a != b) break; x++; } return x; }
cwe
CWE-119
C/C++
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
cwe
CWE-125
C/C++
PJ_DEF(pj_status_t) pjsip_auth_create_aka_response( pj_pool_t *pool, const pjsip_digest_challenge *chal, const pjsip_cred_info *cred, const pj_str_t *method, pjsip_digest_credential *auth) { pj_str_t nonce_bin; int aka_version; const pj_str_t pjsip_AKAv1_MD...
cwe
CWE-787
Unknown
void http_end_txn_clean_session(struct session *s) { int prev_status = s->txn.status; /* FIXME: We need a more portable way of releasing a backend's and a * server's connections. We need a safer way to reinitialize buffer * flags. We also need a more accurate method for computing per-request * data. */ /* ...
cwe
CWE-189
C/C++
package org.hl7.fhir.igtools.publisher; /*- * #%L * org.hl7.fhir.publisher.core * %% * Copyright (C) 2014 - 2019 Health Level 7 * %% * 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 * ...
cwe
CWE-22
Java
protected function checkTrustedHostPattern() { if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] === GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL) { $this->messageQueue->enqueue(new FlashMessage( 'Trusted hosts pattern is configured to allow all header values. ...
cwe
CWE-20
PHP
static int hci_uart_set_proto(struct hci_uart *hu, int id) { const struct hci_uart_proto *p; int err; p = hci_uart_get_proto(id); if (!p) return -EPROTONOSUPPORT; hu->proto = p; set_bit(HCI_UART_PROTO_READY, &hu->flags); err = hci_uart_register_dev(hu); if (err) { clear_bit(HCI_UART_PROTO_READY, &h...
cwe
CWE-416
C/C++
store: new mongoStore({ mongooseConnection: mongoose.connection }) })); server.use(passport.initialize()); server.use(passport.session()); server.use(flash()); server.use(csrf()); server.use(function(req, res, callback) { // Make user object available in templates. res.locals.us...
cwe
CWE-352
JavaScript
static rsRetVal createSocket(instanceConf_t* info, void** sock) { int rv; sublist* sub; *sock = zsocket_new(s_context, info->type); if (!sock) { errmsg.LogError(0, RS_RET_INVALID_PARAMS, "zsocket_new failed: %s, for type %d", ...
cwe
CWE-134
C/C++
void CLASS kodak_65000_load_raw() { short buf[256]; int row, col, len, pred[2], ret, i; for (row=0; row < height; row++) { #ifdef LIBRAW_LIBRARY_BUILD checkCancel(); #endif for (col=0; col < width; col+=256) { pred[0] = pred[1] = 0; len = MIN (256, width-col); ret = kodak_65000_decode...
cwe
CWE-787
C/C++
pktap_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { uint32_t dlt, hdrlen, rectype; u_int caplen = h->caplen; u_int length = h->len; if_printer printer; const pktap_header_t *hdr; if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) { ND_PRIN...
cwe
CWE-125
C/C++
def uploadimage(): # print(request.json) if not request.json or "image" not in request.json: print("No data sent or no image provided. Aborting with 400.") abort(400) im_b64 = request.json["image"] img_bytes = base64.b64decode(im_b64.encode("utf-8")) img_bytes, valid = allowed_file(...
cwe
CWE-22
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-772
C/C++
/* * Copyright (c) 2016-2017 Moddable Tech, Inc. * * This file is part of the Moddable SDK Runtime. * * The Moddable SDK Runtime is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either v...
cwe
CWE-125
C/C++
struct bus_id_priv *get_busid_priv(const char *busid) { int idx; struct bus_id_priv *bid = NULL; spin_lock(&busid_table_lock); idx = get_busid_idx(busid); if (idx >= 0) bid = &(busid_table[idx]); spin_unlock(&busid_table_lock); return bid; }
cwe
CWE-362
Unknown
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * 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,...
cwe
CWE-287
Java
null;u=null!=u?u.getElementsByTagName("parsererror"):null;null!=u&&0<u.length&&(J=E||mxResources.get("invalidChars"),E=u[0].getElementsByTagName("div"),0<E.length&&(J=mxUtils.getTextContent(E[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(u,E){null!=u&&(u=null!=u.error?u.error:u,null==u.retry&&...
cwe
CWE-20
JavaScript
void macvlan_common_setup(struct net_device *dev) { ether_setup(dev); dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; dev->netdev_ops = &macvlan_netdev_ops; dev->destructor = free_netdev; dev->header_ops = &macvlan_hard_header_ops, dev->ethtool_ops = &macvlan_ethtool_ops; }
cwe
CWE-703
Unknown
def _resolve_orders(orders): requester = get_user_or_app_from_context(info.context) if not requester.has_perm(OrderPermissions.MANAGE_ORDERS): orders = list( filter(lambda order: order.status != OrderStatus.DRAFT, orders) ) return ...
cwe
CWE-862
Python
#!/usr/bin/python # # Copyright (c) 2013 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 should have ...
cwe
CWE-264
Python