code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
TfLiteStatus ReluPrepare(TfLiteContext* context, TfLiteNode* node) { ReluOpData* data = reinterpret_cast<ReluOpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output ...
cwe
CWE-125
C/C++
/* * "Real" compatible demuxer. * Copyright (c) 2000, 2001 Fabrice Bellard * * 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 * version 2.1 of th...
cwe
CWE-399
C/C++
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...
cwe
CWE-787
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); auto* params = ...
cwe
CWE-787
C/C++
static int renameTableSelectCb(Walker *pWalker, Select *pSelect){ int i; RenameCtx *p = pWalker->u.pRename; SrcList *pSrc = pSelect->pSrc; if( pSrc==0 ){ assert( pWalker->pParse->db->mallocFailed ); return WRC_Abort; } for(i=0; i<pSrc->nSrc; i++){ struct SrcList_item *pItem = &pSrc->a[i]; if...
cwe
CWE-674
Unknown
function getFileLink(file) { var file_name = highlight(file.name, filter_terms); return ( '<a data-nodrag="true" href="' + getFileUrl(file) + '" title="' + file.description + '"><i class="fas fa-paperclip extra-card...
cwe
CWE-79
JavaScript
/* . .o8 oooo .o8 "888 `888 .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' 888 888 888 888 888 888 888o...
cwe
CWE-79
JavaScript
bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CModInfo::EModuleType eType, CUser* pUser, CIRCNetwork* pNetwork, CString& sRetMsg) { sRetMsg = ""; if (FindModule(sModule) != nullptr) { sRetMsg = t_f("Module {1} already loaded....
cwe
CWE-20
Unknown
function h(a){var b=a.currentTarget,c=b.getAttribute("data-youtube"),d=b.getAttribute("data-ytparams")||"";d&&!m.test(d)&&(d="&"+d),a.preventDefault(),b.innerHTML='<iframe src="'+o.replace(k,c)+d+'" frameborder="0" allowfullscreen="" width="640" height="390"></iframe>',b.removeEventListener("click",h)}
cwe
CWE-79
JavaScript
void operator()(OpKernelContext* ctx, const Index num_segments, const TensorShape& segment_ids_shape, typename TTypes<Index>::ConstFlat segment_ids, const Index data_size, const T* data, typename TTypes<T, 2>::Tensor output) { if (output.size()...
cwe
CWE-681
C/C++
void WebLocalFrameImpl::SetCommittedFirstRealLoad() { DCHECK(GetFrame()); GetFrame()->Loader().StateMachine()->AdvanceTo( FrameLoaderStateMachine::kCommittedMultipleRealLoads); GetFrame()->DidSendResourceTimingInfoToParent(); }
cwe
CWE-200
C/C++
get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf) { int tmp; struct usb_host_interface *alt; struct usb_host_endpoint *in, *out; struct usb_host_endpoint *iso_in, *iso_out; struct usb_host_endpoint *int_in, *int_out; struct usb_device *udev; for (tmp = 0; tmp < intf->num_altsetting; tmp++) ...
cwe
CWE-476
C/C++
function delete_organization(id, organization_name) { const delAPI = "../delete/organization/"+id; swal.queue([{ title: 'Are you sure you want to delete '+ organization_name +'?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmB...
cwe
CWE-79
JavaScript
static int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr, *final_p, final; struct dst_entry *dst; struct flowi6 fl6; str...
cwe
CWE-284
Unknown
static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) { if (ImageInfo->Thumbnail.data) { exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails"); return; /* Should not happen */ } if (!ImageInfo->read_th...
cwe
CWE-125
Unknown
function isObject (o, allowArray) { return o && 'object' === typeof o && (allowArray || !Array.isArray(o)) } function isBasic (b) { return 'string' === typeof b || 'number' === typeof b } function get (obj, path, dft) { if(!isObject(obj, true)) return dft if(isBasic(path)) return obj[path] for(var i = 0; i ...
cwe
CWE-1321
JavaScript
static void gf_dump_vrml_simple_field(GF_SceneDumper *sdump, GF_FieldInfo field, GF_Node *parent) { u32 i, sf_type; GF_ChildNodeItem *list; void *slot_ptr; switch (field.fieldType) { case GF_SG_VRML_SFNODE: gf_dump_vrml_node(sdump, field.far_ptr ? *(GF_Node **)field.far_ptr : NULL, 0, NULL); return; case GF_...
cwe
CWE-476
Unknown
R_API int r_egg_lang_parsechar(REgg *egg, char c) { REggEmit *e = egg->remit; char *ptr, str[64], *tmp_ptr = NULL; int i, j; if (c == '\n') { egg->lang.line++; egg->lang.elem_n = 0; } /* comments */ if (egg->lang.skipline) { if (c != '\n') { egg->lang.oc = c; return 0; } egg->lang.skipline = 0; ...
cwe
CWE-416
C/C++
beep_print(netdissect_options *ndo, const u_char *bp, u_int length) { if (l_strnstart("MSG", 4, (const char *)bp, length)) /* A REQuest */ ND_PRINT((ndo, " BEEP MSG")); else if (l_strnstart("RPY ", 4, (const char *)bp, length)) ND_PRINT((ndo, " BEEP RPY")); else if (l_strnstart("ERR ", 4, (const char *)bp, leng...
cwe
CWE-787
Unknown
R_API int r_egg_compile(REgg *egg) { r_buf_seek (egg->src, 0, R_BUF_SET); char b; int r = r_buf_read (egg->src, (ut8 *)&b, sizeof (b)); if (r != sizeof (b) || !egg->remit) { return true; } // only emit begin if code is found r_egg_lang_init (egg); for (; b; ) { r_egg_lang_parsechar (egg, b); int r = r_buf...
cwe
CWE-125
C/C++
function escapeArgBash(arg, interpolation, quoted) { let result = arg.replace(/[\0\u0008\u001B\u009B]/gu, ""); if (interpolation) { result = result .replace(/\\/gu, "\\\\") .replace(/\n/gu, " ") .replace(/(^|\s)([#~])/gu, "$1\\$2") .replace(/(["$&'()*;<>?`|])/gu, "\\$1") .replace(...
cwe
CWE-1333
JavaScript
func queryMatches(rp *arrayPathResult, value Result) bool { rpv := rp.query.value if len(rpv) > 0 && rpv[0] == '~' { // convert to bool rpv = rpv[1:] if value.Bool() { value = Result{Type: True} } else { value = Result{Type: False} } } if !value.Exists() { return false } if rp.query.op == "" { ...
cwe
CWE-400
Go
static int komeda_wb_connector_add(struct komeda_kms_dev *kms, struct komeda_crtc *kcrtc) { struct komeda_dev *mdev = kms->base.dev_private; struct komeda_wb_connector *kwb_conn; struct drm_writeback_connector *wb_conn; u32 *formats, n_formats = 0; int err; if (!kcrtc->master->wb_layer) return 0; kwb_...
cwe
CWE-401
C/C++
package com.salesmanager.shop.filter; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;...
cwe
CWE-639
Java
static int stv06xx_isoc_init(struct gspca_dev *gspca_dev) { struct usb_host_interface *alt; struct sd *sd = (struct sd *) gspca_dev; /* Start isoc bandwidth "negotiation" at max isoc bandwidth */ alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1]; alt->endpoint[0].desc.wMaxPacketSize = cpu_to_le16(s...
cwe
CWE-476
C/C++
static int rndis_query_response(USBNetState *s, rndis_query_msg_type *buf, unsigned int length) { rndis_query_cmplt_type *resp; /* oid_supported_list is the largest data reply */ uint8_t infobuf[sizeof(oid_supported_list)]; uint32_t bufoffs, buflen; int infobuflen; unsigned int r...
cwe
CWE-189
Unknown
dvi_document_file_exporter_end (EvFileExporter *exporter) { gchar *command_line; gint exit_stat; GError *err = NULL; gboolean success; DviDocument *dvi_document = DVI_DOCUMENT(exporter); command_line = g_strdup_printf ("dvipdfm %s -o %s \"%s\"", /* dvipdfm -s 1,2,.., -o exporter_filename dvi_filename */ ...
cwe
CWE-78
C/C++
OmniboxPopupViewGtk::~OmniboxPopupViewGtk() { model_.reset(); g_object_unref(layout_); gtk_widget_destroy(window_); for (ImageMap::iterator it = images_.begin(); it != images_.end(); ++it) delete it->second; }
cwe
CWE-399
C/C++
void BrowserEventRouter::TabUpdated(WebContents* contents, bool did_navigate) { TabEntry* entry = GetTabEntry(contents); DictionaryValue* changed_properties = NULL; DCHECK(entry); if (did_navigate) changed_properties = entry->DidNavigate(contents); else changed_properties = entry->UpdateLoadSt...
cwe
CWE-264
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
* Diffie Hellman Key Exchange, Group Agnostic */ static int diffie_hellman_sha1(LIBSSH2_SESSION *session, _libssh2_bn *g, _libssh2_bn *p, int group_order, unsigned char packet_type_init, ...
cwe
CWE-787
Unknown
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
cwe
CWE-125
C/C++
static void recv_buffer_cleanup(h2_bucket_beam *beam, h2_beam_lock *bl) { if (beam->recv_buffer && !APR_BRIGADE_EMPTY(beam->recv_buffer)) { apr_bucket_brigade *bb = beam->recv_buffer; apr_off_t bblen = 0; beam->recv_buffer = NULL; apr_brigade_length(bb, 0, &bblen); b...
cwe
CWE-400
Unknown
inline const TfLiteTensor* GetIntermediates(TfLiteContext* context, const TfLiteNode* node, int index) { return &context->tensors[node->intermediates->data[index]]; }
cwe
CWE-125
Unknown
bool SFD_GetFontMetaData( FILE *sfd, char *tok, SplineFont *sf, SFD_GetFontMetaDataData* d ) { int ch; int i; KernClass* kc = 0; int old; char val[2000]; // This allows us to assume we can dereference d // at all times static SFD_GetFontMetaDataData my_static_d; stati...
cwe
CWE-416
C/C++
g_keyfile_settings_backend_keyfile_write (GKeyfileSettingsBackend *kfsb) { gchar *contents; gsize length; contents = g_key_file_to_data (kfsb->keyfile, &length, NULL); g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, ...
cwe
CWE-732
Unknown
dtls1_process_record(SSL *s) { int i,al; int clear=0; int enc_err; SSL_SESSION *sess; SSL3_RECORD *rr; unsigned int mac_size; unsigned char md[EVP_MAX_MD_SIZE]; int decryption_failed_or_bad_record_mac = 0; unsigned char *mac = NULL; rr= &(s->s3->rrec); sess = s->session; /* At this point, s->packet_lengt...
cwe
CWE-310
Unknown
int CLASS parse_tiff_ifd (int base) { unsigned entries, tag, type, len, plen=16, save; int ifd, use_cm=0, cfa, i, j, c, ima_len=0; int blrr=1, blrc=1, dblack[] = { 0,0,0,0 }; char software[64], *cbuf, *cp; uchar cfa_pat[16], cfa_pc[] = { 0,1,2,3 }, tab[256]; double cc[4][4], cm[4][3], cam_xyz[4][3], num; ...
cwe
CWE-703
Unknown
function ame_ajax_set_postdate( post_id, pickedDate, posttype ) { var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_set_date" ); ame_sack.setVar( "category_id", post_id ); ame_sack.setVar( "pickedDate", pickedDate ); ame_sack.setVar( "posttype", p...
cwe
CWE-352
JavaScript
static int nbd_negotiate_drop_sync(QIOChannel *ioc, size_t size) { ssize_t ret; uint8_t *buffer = g_malloc(MIN(65536, size)); while (size > 0) { size_t count = MIN(65536, size); ret = nbd_negotiate_read(ioc, buffer, count); if (ret < 0) { g_free(buffer); retur...
cwe
CWE-20
C/C++
/* Copyright 2013 Simo Sorce <simo@samba.org>, see COPYING for license */ /* This File implements the NTLM protocol as specified by: * [MS-NLMP]: NT LAN Manager (NTLM) Authentication Protocol * * Additional cross checking with: * http://davenport.sourceforge.net/ntlm.html */ #include <alloca.h> #include <en...
cwe
CWE-125
C/C++
void WebGL2RenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, ...
cwe
CWE-119
C/C++
header_put_le_int (SF_PRIVATE *psf, int x) { if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) { psf->header [psf->headindex++] = x ; psf->header [psf->headindex++] = (x >> 8) ; psf->header [psf->headindex++] = (x >> 16) ; psf->header [psf->headindex++] = (x >> 24) ; } ; } /* header_put_le_int */
cwe
CWE-119
Unknown
""" IPython: tools for interactive and parallel computing in Python. https://ipython.org """ #----------------------------------------------------------------------------- # Copyright (c) 2008-2011, IPython Development Team. # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu> # Copyright (c) 200...
cwe
CWE-269
Python
static ssize_t set_cmci_disabled(struct device *s, struct device_attribute *attr, const char *buf, size_t size) { u64 new; if (kstrtou64(buf, 0, &new) < 0) return -EINVAL; if (mca_cfg.cmci_disabled ^ !!new) { if (new) { /* disable cmci */ on_each_cpu(mce_disable_cmci, NULL, 1); mca_cfg.cmci_...
cwe
CWE-362
Unknown
TfLiteStatus LessEqualEval(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 = !HaveSameShap...
cwe
CWE-787
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_packet_common.c -- some common packet-related routines */ #include <stdint.h> #include <stdio.h> #include <time.h> #include "lsquic.h" #include "lsquic_types.h" #include "lsquic_logger.h" #include "lsquic_enc_sess.h" #include "lsq...
cwe
CWE-476
C/C++
Status Examples::Initialize(OpKernelContext* const context, const ModelWeights& weights, const int num_sparse_features, const int num_sparse_features_with_values, const int num_dense_features) { num_feature...
cwe
CWE-703
C/C++
static MagickBooleanType SkipRGBMipmaps(Image *image,DDSInfo *dds_info, int pixel_size,ExceptionInfo *exception) { MagickOffsetType offset; register ssize_t i; size_t h, w; /* Only skip mipmaps for textures and cube maps */ if (EOFBlob(image) != MagickFalse) { ThrowFileE...
cwe
CWE-399
C/C++
function ame_ajax_set_visibility( post_id, status, posttype ) { var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_toggle_visibility" ); ame_sack.setVar( "category_id", post_id ); ame_sack.setVar( "vis_status", status ); ame_sack.setVar( "posttype"...
cwe
CWE-352
JavaScript
static bool cgm_bind_dir(const char *root, const char *dirname) { nih_local char *cgpath = NULL; /* /sys should have been mounted by now */ cgpath = NIH_MUST( nih_strdup(NULL, root) ); NIH_MUST( nih_strcat(&cgpath, NULL, "/sys/fs/cgroup") ); if (!dir_exists(cgpath)) { ERROR("%s does not exist", cgpath); retu...
cwe
CWE-59
C/C++
int main(int argc, char* argv[]) { char* name = argv[0]; bool applyColorCorrection = false; #if USE(QCMSLIB) if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) applyColorCorrection = (--argc, ++argv, true); if (argc < 2) { fprintf(stderr, "Usage: %s [--color-correct] file [ite...
cwe
CWE-310
C/C++
package server import ( "encoding/json" "errors" "fmt" "io" "net" "net/http" "os" "os/signal" "regexp" "runtime" "runtime/debug" "strconv" "strings" "syscall" "time" "github.com/Azure/go-autorest/autorest/adal" "github.com/gorilla/mux" "k8s.io/klog/v2" "github.com/Azure/aad-pod-identity/pkg/auth" ...
cwe
CWE-863
Go
pkcs11rsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) { dst_private_t priv; isc_result_t ret; int i; pk11_object_t *rsa; CK_ATTRIBUTE *attr; isc_mem_t *mctx = key->mctx; const char *engine = NULL, *label = NULL; /* read private key file */ ret = dst__privstruct_parse(key, DST_ALG_RSA, lexer, mctx,...
cwe
CWE-617
Unknown
public BigInteger calculateAgreement( DHPublicKeyParameters pub, BigInteger message) { if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } BigInteger p = dhPa...
cwe
CWE-320
Java
function auth_nodes_dialog(unauth_nodes, callback_success, callback_success_one) { callback_success = typeof callback_success !== 'undefined' ? callback_success : null; callback_success_one = typeof callback_success_one !== 'undefined' ? callback_success_one : null; var buttonsOpts = [ { text: "Authent...
cwe
CWE-79
JavaScript
/* 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-908
Python
package io.onedev.server.maintenance; import static org.hibernate.cfg.AvailableSettings.DIALECT; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.M...
cwe
CWE-552
Java
static js_Ast *logor(js_State *J, int notin) { js_Ast *a = logand(J, notin); if (jsP_accept(J, TK_OR)) a = EXP2(LOGOR, a, logor(J, notin)); return a; }
cwe
CWE-674
Unknown
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)); ...
cwe
CWE-119
C/C++
MagickExport const char *GetMagickProperty(ImageInfo *image_info, Image *image,const char *property,ExceptionInfo *exception) { char value[MagickPathExtent]; const char *string; assert(property[0] != '\0'); assert(image != (Image *) NULL || image_info != (ImageInfo *) NULL ); if (property[1] == '\...
cwe
CWE-476
C/C++
static int set_rcvarray_entry(struct hfi1_filedata *fd, struct tid_user_buf *tbuf, u32 rcventry, struct tid_group *grp, u16 pageidx, unsigned int npages) { int ret; struct hfi1_ctxtdata *uctxt = fd->uctxt; struct tid_rb_node *node; struct hfi1_devdata *dd = uctxt->dd; dma_addr_t phys; s...
cwe
CWE-416
Unknown
(function() { // Adds ArchiMate 2.1 shapes Sidebar.prototype.addArchiMatePalette = function() { var w = 100; var h = 75; var s = 'html=1;outlineConnect=0;shape=mxgraph.archimate.'; var am1 = 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#ffff99;shape=mxgraph.archimate.'; var am2 = 'html=1;outlineConne...
cwe
CWE-284
Java
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
cwe
CWE-384
Python
LogLuvSetupEncode(TIFF* tif) { static const char module[] = "LogLuvSetupEncode"; LogLuvState* sp = EncoderState(tif); TIFFDirectory* td = &tif->tif_dir; switch (td->td_photometric) { case PHOTOMETRIC_LOGLUV: if (!LogLuvInitState(tif)) break; if (td->td_compression == COMPRESSION_SGILOG24) { tif->tif_enc...
cwe
CWE-125
Unknown
ZEND_METHOD(CURLFile, __wakeup) { zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "" TSRMLS_CC); zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0 TSRMLS_CC); }
cwe
CWE-416
Unknown
void disable_config(void) { EUID_USER(); #ifndef HAVE_ONLY_SYSCFG_PROFILES char *fname; if (asprintf(&fname, "%s/.config/firejail", cfg.homedir) == -1) errExit("asprintf"); disable_file(BLACKLIST_FILE, fname); free(fname); #endif // disable run time information disable_file(BLACKLIST_FILE, RUN_FIREJAIL_NETWOR...
cwe
CWE-94
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-125
C/C++
static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception) { char buffer[MaxTextExtent]; Image *image; MagickBooleanType status; register ssize_t x; register PixelPacket *q; register unsigned char *p; ssize_t count, y; unsigned char *pixel...
cwe
CWE-120
C/C++
flow_entry_type_t flow_decode(flow_hash_table_t *fht, const struct pcap_pkthdr *pkthdr, const u_char *pktdata, const int datalink, const int expiry) { uint32_t pkt_len = pkthdr->caplen; const u_char *packet = pktdata; uint32_t _U_ vlan_offset; uint16_t ether_type = 0; ipv4_hdr_t *ip_hdr = NU...
cwe
CWE-476
Unknown
/******************************************************************************/ /* */ /* X r d S e c g s i G M A P F u n L D A P . c c */ /* ...
cwe
CWE-77
C/C++
static void die(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vprintf(fmt, ap); if(fmt[strlen(fmt)-1] != '\n') printf("\n"); exit(EXIT_FAILURE); }
cwe
CWE-119
C/C++
#include "calenderServer.h" #include "serverActions.h" #include "persistentState.h" #include "renderPage.h" #include "objectCache.h" #include <iostream> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <thread> #include <algorithm> #include <string> #include <sstream> #include <unistd.h> #incl...
cwe
CWE-287
C/C++
xmlParseStartTag(xmlParserCtxtPtr ctxt) { const xmlChar *name; const xmlChar *attname; xmlChar *attvalue; const xmlChar **atts = ctxt->atts; int nbatts = 0; int maxatts = ctxt->maxatts; int i; if (RAW != '<') return(NULL); NEXT1; name = xmlParseName(ctxt); if (name == NULL)...
cwe
CWE-119
C/C++
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
cwe
CWE-125
C/C++
static struct sk_buff *macsec_encrypt(struct sk_buff *skb, struct net_device *dev) { int ret; struct scatterlist *sg; unsigned char *iv; struct ethhdr *eth; struct macsec_eth_header *hh; size_t unprotected_len; struct aead_request *req; struct macsec_secy *secy; struct macsec_tx_sc *tx_sc; struct ma...
cwe
CWE-119
Unknown
def render_POST(self, request): """ Register with the Identity Server """ send_cors(request) args = get_args(request, ('matrix_server_name', 'access_token')) result = yield self.client.get_json( "matrix://%s/_matrix/federation/v1/openid/userinfo?access_token...
cwe
CWE-20
Python
static int comparedictkey(i_ctx_t * i_ctx_p, ref *CIEdict1, ref *CIEdict2, char *key) { int code, code1; ref *tempref1, *tempref2; code = dict_find_string(CIEdict1, key, &tempref1); code1 = dict_find_string(CIEdict2, key, &tempref2); if (code != code1) return 0; if (code <= 0) ...
cwe
CWE-704
Unknown
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
cwe
CWE-20
Python
async fn main() -> Result<(), Box<dyn std::error::Error>> { let args = set_command_line_args().get_matches(); env::set_var("RUST_LOG", "swhkd=warn"); if args.is_present("debug") { env::set_var("RUST_LOG", "swhkd=trace"); } env_logger::init(); log::trace!("Logger initialized."); le...
cwe
CWE-59
Rust
void shut(pid_t pid) { EUID_ASSERT(); EUID_ROOT(); char *comm = pid_proc_comm(pid); EUID_USER(); if (comm) { if (strcmp(comm, "firejail") != 0) { fprintf(stderr, "Error: this is not a firejail sandbox\n"); exit(1); } free(comm); } else { fprintf(stderr, "Error: cannot find process %d\n", pid); e...
cwe
CWE-94
Unknown
otError Commissioner::GeneratePskc(const char * aPassPhrase, const char * aNetworkName, const Mac::ExtendedPanId &aExtPanId, Pskc & aPskc) { otError error = ...
cwe
CWE-787
C/C++
'use strict'; /** * Teedy application. */ angular.module('docs', // Dependencies ['ui.router', 'ui.bootstrap', 'dialog', 'ngProgress', 'monospaced.qrcode', 'yaru22.angular-timeago', 'ui.validate', 'ui.sortable', 'restangular', 'ngSanitize', 'ngTouch', 'colorpicker.module', 'ngFileUpload', 'pascalprecht...
cwe
CWE-79
Java
static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd) { PCIDevice *pci_dev = PCI_DEVICE(s); PCIDeviceClass *pci_class = PCI_DEVICE_GET_CLASS(pci_dev); MegasasBaseClass *base_class = MEGASAS_DEVICE_GET_CLASS(s); struct mfi_ctrl_info info; size_t dcmd_size = sizeof(info); BusChild *ki...
cwe
CWE-200
Unknown
DisplaySourceCustomBindings::DisplaySourceCustomBindings(ScriptContext* context) : ObjectBackedNativeHandler(context), weak_factory_(this) { RouteFunction("StartSession", base::Bind(&DisplaySourceCustomBindings::StartSession, weak_factory_.GetWeakPtr())); Rou...
cwe
CWE-284
C/C++
/* * AirSpy SDR driver * * Copyright (C) 2014 Antti Palosaari <crope@iki.fi> * * 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-119
C/C++
static void flush_tmregs_to_thread(struct task_struct *tsk) { /* * If task is not current, it will have been flushed already to * it's thread_struct during __switch_to(). * * A reclaim flushes ALL the state or if not in TM save TM SPRs * in the appropriate thread structures from live. */ if (tsk != cu...
cwe
CWE-119
Unknown
package org.openmrs.module.appointmentscheduling; import org.openmrs.BaseOpenmrsData; import org.openmrs.Patient; import org.openmrs.Provider; import java.util.Date; /** * persisted object that reflects a request by a provider (or other user) for a scheduler to schedule a patient for a future appointment; * has an...
cwe
CWE-707
Java
$url['host'] = PMA_getenv('SERVER_NAME'); } else { $this->error_pma_uri = true; return; } // If we didn't set port yet... if (empty($url['port']) && PMA_getenv('SERVER_PORT')) { $url['port'] = PM...
cwe
CWE-79
PHP
session_key( sockaddr_u *srcadr, /* source address */ sockaddr_u *dstadr, /* destination address */ keyid_t keyno, /* key ID */ keyid_t private, /* private value */ u_long lifetime /* key lifetime */ ) { EVP_MD_CTX ctx; /* message digest context */ u_char dgst[EVP_MAX_MD_SIZE]; /* message digest */ keyid_...
cwe
CWE-287
Unknown
public function formatItem( Article $article, $pageText = null ) { $item = ''; if ( $pageText !== null ) { //Include parsed/processed wiki markup content after each item before the closing tag. $item .= $pageText; } $item = $this->getItemStart() . $item . $this->getItemEnd(); $item = $this->replaceTa...
cwe
CWE-400
PHP
do_command (unsigned char c) { static int dtr_up = 0; int newbaud, newflow, newparity, newbits; const char *xfr_cmd; char *fname; int r; switch (c) { case KEY_EXIT: return 1; case KEY_QUIT: term_set_hupcl(tty_fd, 0); term_flush(tty_fd); term_apply(tty_fd); term_erase(tty_fd); return 1; case KEY_ST...
cwe
CWE-77
Unknown
package com.salesmanager.shop.admin.model.userpassword; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class UserReset { final static String CHAR_LIST_WITHNUM = "abcdefghijklmnopqrstuvwxyzABCDEF...
cwe
CWE-639
Java
GC_INNER void GC_setpagesize(void) { GetSystemInfo(&GC_sysinfo); GC_page_size = GC_sysinfo.dwPageSize; # if defined(MSWINCE) && !defined(_WIN32_WCE_EMULATION) { OSVERSIONINFO verInfo; /* Check the current WinCE version. */ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO)...
cwe
CWE-119
Unknown
radix__arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags) { struct vm_area_struct *vma; struct mm_struct *mm = current->mm; unsigned long addr = addr0; struct vm_unmapped_area...
cwe
CWE-119
Unknown
error: function() { // Fail message $('#success').html("<div class='alert alert-danger'>"); $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;") .append("</button>"); ...
cwe
CWE-79
JavaScript
function audioCaptions() { const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id }); if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) { Logger.warn(`Publishing AudioCaptions was requested by unauth connection ${this.connection.id}`); ...
cwe
CWE-918
JavaScript
public Optional<InputStream> getResourceAsStream(String path) { URL url = classLoader.getResource(prefixPath(path)); if (url != null) { try { URI uri = url.toURI(); if (uri.getScheme().equals("jar")) { synchronized (DefaultClassPathResource...
cwe
CWE-22
Java
const busboyOptions = deepmerge.all([{ headers: Object.assign({}, req.headers) }, options || {}, opts || {}]) const stream = busboy(busboyOptions) let completed = false let files = 0 req.on('error', function (err) { stream.destroy() if (!completed) { completed = true done(er...
cwe
CWE-1321
JavaScript
extern int x11_set_xauth(char *xauthority, char *cookie, char *host, uint16_t display) { int i=0, status; char *result; char **xauth_argv; xauth_argv = xmalloc(sizeof(char *) * 10); xauth_argv[i++] = xstrdup("xauth"); xauth_argv[i++] = xstrdup("-v"); xauth_argv[i++] = xstrdup("-f"); xauth_argv[i++] = xstrd...
cwe
CWE-362
C/C++