code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
gss_unwrap (minor_status, context_handle, input_message_buffer, output_message_buffer, conf_state, qop_state) OM_uint32 * minor_status; gss_ctx_id_t context_handle; gss_buffer_t input_message_buffer; gss_buffer_t output_message_buffer; int * conf_state;...
cwe
CWE-415
C/C++
static RzList *relocs(RzBinFile *bf) { rz_return_val_if_fail(bf && bf->o, NULL); QnxObj *qo = bf->o->bin_obj; return rz_list_clone(qo->fixups); }
cwe
CWE-415
Unknown
static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int force_reconnect) { HTTPContext *s = h->priv_data; URLContext *old_hd = s->hd; int64_t old_off = s->off; uint8_t old_buf[BUFFER_SIZE]; int old_buf_size, ret; AVDictionary *options = NULL; if (whence == AVSEEK_SIZE)...
cwe
CWE-787
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-20
C/C++
void rose_stop_idletimer(struct sock *sk) { del_timer(&rose_sk(sk)->idletimer); }
cwe
CWE-416
Unknown
package com.zrlog.web; import com.zrlog.common.Constants; import org.apache.catalina.LifecycleException; import org.apache.catalina.startup.Tomcat; import javax.servlet.ServletException; import java.io.File; public class Application { public static void main(String[] args) throws LifecycleException { St...
cwe
CWE-79
Java
// Copyright 2020-2021 Clastix Labs // SPDX-License-Identifier: Apache-2.0 package webserver import ( "context" "crypto/tls" "encoding/json" "fmt" "net/http" "net/http/httputil" "strings" "time" capsulev1beta1 "github.com/clastix/capsule/api/v1beta1" "github.com/go-logr/logr" "github.com/gorilla/handlers"...
cwe
CWE-287
Go
/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. Copyright (C) 2005 - 2015, ioquake3 contributors Copyright (C) 2013 - 2015, OpenJK contributors This fi...
cwe
CWE-269
C/C++
gplotRead(const char *filename) { char buf[L_BUF_SIZE]; char *rootname, *title, *xlabel, *ylabel, *ignores; l_int32 outformat, ret, version, ignore; FILE *fp; GPLOT *gplot; PROCNAME("gplotRead"); if (!filename) return (GPLOT *)ERROR_PTR("filename not defined", procName, NULL); if ((...
cwe
CWE-787
C/C++
static void mysql_ssl_free(MYSQL *mysql __attribute__((unused))) { struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd; DBUG_ENTER("mysql_ssl_free"); my_free(mysql->options.ssl_key); my_free(mysql->options.ssl_cert); my_free(mysql->options.ssl_ca); my_free(mysql->options.ssl_capath); my...
cwe
CWE-319
Unknown
void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out) { int x, y, pos; Wbmp *wbmp; /* create the WBMP */ if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL) { gd_error("Could not create WBMP"); return; } /* fill up the WBMP structure */ pos = 0; for (y = 0; y < gdIm...
cwe
CWE-415
C/C++
function set_up(container) { // Find prev/next links var prev = container.find('.pagination .prev'); var next = container.find('.pagination .next'); var prev_url = null, next_url = null; if (prev.length) prev_url = prev.attr('href'); ...
cwe
CWE-79
JavaScript
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.app.webui.servlet; import java.io.IOException; import java.sql.SQLException; impor...
cwe
CWE-601
Java
void UsbDeviceImpl::OnPathAccessRequestComplete(const OpenCallback& callback, bool success) { if (success) { blocking_task_runner_->PostTask( FROM_HERE, base::Bind(&UsbDeviceImpl::OpenOnBlockingThread, this, callback)); } else { chromeos::Permi...
cwe
CWE-399
C/C++
function AJchangeUserGroupPrivs() { global $user; $node = processInputVar("activeNode", ARG_NUMERIC); if(! checkUserHasPriv("userGrant", $user["id"], $node)) { $text = "You do not have rights to modify user privileges at this node."; print "alert('$text');"; return; } $newusergrpid = processInputVar("item", ...
cwe
CWE-264
PHP
static int selectExpander(Walker *pWalker, Select *p){ Parse *pParse = pWalker->pParse; int i, j, k; SrcList *pTabList; ExprList *pEList; struct SrcList_item *pFrom; sqlite3 *db = pParse->db; Expr *pE, *pRight, *pExpr; u16 selFlags = p->selFlags; u32 elistFlags = 0; p->selFlags |= SF_Expanded; if...
cwe
CWE-755
C/C++
IRC_PROTOCOL_CALLBACK(352) { char *pos_attr, *pos_hopcount, *pos_realname, *str_host; int arg_start, length; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick; IRC_PROTOCOL_MIN_ARGS(5); /* silently ignore malformed 352 message (missing infos) */ if (argc < 8) return WE...
cwe
CWE-476
C/C++
import express from 'express'; import BodyParser from 'body-parser'; import * as Middlewares from '../middlewares'; import Parse from 'parse/node'; import Config from '../Config'; import mime from 'mime'; import logger from '../logger'; const triggers = require('../triggers'); const http = require('http'); const downl...
cwe
CWE-20
JavaScript
add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env) { #define ASCII_LIMIT 127 int c, r; int ascii_mode; const OnigCodePoint *ranges; OnigCodePoint limit; OnigCodePoint sb_out; OnigEncoding enc = env->enc; ascii_mode = IS_ASCII_MODE_CTYPE_OPTION(ctype, env->options); r = ONIGENC_GET_C...
cwe
CWE-125
Unknown
messageFindArgument(const message *m, const char *variable) { int i; size_t len; assert(m != NULL); assert(variable != NULL); len = strlen(variable); for(i = 0; i < m->numberOfArguments; i++) { const char *ptr; ptr = messageGetArgument(m, i); if((ptr == NULL) || (*ptr == '\0')) continue; #ifdef CL_DE...
cwe
CWE-125
C/C++
void ServiceWorkerHandler::SetRenderer(RenderProcessHost* process_host, RenderFrameHostImpl* frame_host) { process_ = process_host; if (!process_host) { ClearForceUpdate(); context_ = nullptr; return; } StoragePartition* partition = process_host->GetStora...
cwe
CWE-20
C/C++
static char* get_icu_value_internal( const char* loc_name , char* tag_name, int* result , int fromParseLocale) { char* tag_value = NULL; int32_t tag_value_len = 512; int singletonPos = 0; char* mod_loc_name = NULL; int grOffset = 0; int32_t buflen = 512; UErrorCode status ...
cwe
CWE-125
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-94
JavaScript
findoprnd(ITEM *ptr, int32 *pos) { #ifdef BS_DEBUG elog(DEBUG3, (ptr[*pos].type == OPR) ? "%d %c" : "%d %d", *pos, ptr[*pos].val); #endif if (ptr[*pos].type == VAL) { ptr[*pos].left = 0; (*pos)--; } else if (ptr[*pos].val == (int32) '!') { ptr[*pos].left = -1; (*pos)--; findoprnd(ptr, pos); } els...
cwe
CWE-703
Unknown
static inline int mount_entry_on_systemfs(struct mntent *mntent) { return mount_entry_on_generic(mntent, mntent->mnt_dir); }
cwe
CWE-59
Unknown
async function getPackageInfo(packageName) { const { stdout } = await execa.shell(`npm view ${packageName} name version --silent`); // Use regex to parse name and version from CLI result const [name, version] = stdout.match(/(?<=')(.*?)(?=')/gm); return { name, version }; }
cwe
CWE-78
JavaScript
return ka}function B(){function fa(ta,ka){var Ja=mxResources.get(ta);null==Ja&&(Ja=ta.substring(0,1).toUpperCase()+ta.substring(1));18<Ja.length&&(Ja=Ja.substring(0,18)+"&hellip;");return Ja+" ("+ka.length+")"}function sa(ta,ka,Ja){mxEvent.addListener(ka,"click",function(){Ha!=ka&&(Ha.style.backgroundColor="",Ha=ka,Ha....
cwe
CWE-94
JavaScript
header_seek (SF_PRIVATE *psf, sf_count_t position, int whence) { switch (whence) { case SEEK_SET : if (position > SIGNED_SIZEOF (psf->header)) { /* Too much header to cache so just seek instead. */ psf_fseek (psf, position, whence) ; return ; } ; if (position > psf->headend) psf->headend += p...
cwe
CWE-119
C/C++
// Copyright (c) 2015-2021 MinIO, Inc. // // This file is part of MinIO Object Storage stack // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (...
cwe
CWE-269
Go
tt_cmap14_validate( FT_Byte* table, FT_Validator valid ) { FT_Byte* p; FT_ULong length; FT_ULong num_selectors; if ( table + 2 + 4 + 4 > valid->limit ) FT_INVALID_TOO_SHORT; p = table + 2; length = TT_NEXT_ULONG( p ); num_selectors...
cwe
CWE-125
Unknown
int extract_or_test_files(__G) /* return PK-type error code */ __GDEF { unsigned i, j; zoff_t cd_bufstart; uch *cd_inptr; int cd_incnt; ulg filnum=0L, blknum=0L; int reached_end; #ifndef SFX int no_endsig_found; #endif int error, error_in_archive=PK_COOL; int *fn_matched=NULL...
cwe
CWE-400
Unknown
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import mistune import tornado.web from urllib.parse import unquote, quote from .models import * from .markdown import * from tornado.escape import to_unicode class BaseHandler(tornado.web.RequestHandler): def description(self, text): if len(text) ...
cwe
CWE-79
Python
exsltStrPaddingFunction (xmlXPathParserContextPtr ctxt, int nargs) { int number, str_len = 0; xmlChar *str = NULL, *ret = NULL, *tmp; if ((nargs < 1) || (nargs > 2)) { xmlXPathSetArityError(ctxt); return; } if (nargs == 2) { str = xmlXPathPopString(ctxt); str_len = xmlUTF8Strlen(str); ...
cwe
CWE-119
C/C++
static int rds_recv_track_latency(struct rds_sock *rs, char __user *optval, int optlen) { struct rds_rx_trace_so trace; int i; if (optlen != sizeof(struct rds_rx_trace_so)) return -EFAULT; if (copy_from_user(&trace, optval, sizeof(trace))) return -EFAULT; rs->rs_rx_traces = trace.rx_traces; for (i = ...
cwe
CWE-787
C/C++
$removed[] = $fi->getFilename(); } if ($removed = implode(', ', $removed)) { $result .= $removed . ' ' . dgettext('tuleap-tracker', 'removed'); } $added = $this->fetchAddedFiles(array_diff($this->files, $changeset_value->getFiles()), $format, $is_for_mail...
cwe
CWE-79
PHP
static ssize_t block_size_bytes_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%lx\n", memory_block_size_bytes()); }
cwe
CWE-787
Unknown
merge_selfsigs_main (KBNODE keyblock, int *r_revoked, struct revoke_info *rinfo) { PKT_public_key *pk = NULL; KBNODE k; u32 kid[2]; u32 sigdate, uiddate, uiddate2; KBNODE signode, uidnode, uidnode2; u32 curtime = make_timestamp (); unsigned int key_usage = 0; u32 keytimestamp = 0; u32 key_expir...
cwe
CWE-20
Unknown
/* * ejabberd, Copyright (C) 2002-2011 ProcessOne * * 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 option) any later version. * * This p...
cwe
CWE-264
C/C++
// @flow import { AnalyticsAdapter } from '../Adapters/Analytics/AnalyticsAdapter'; import { FilesAdapter } from '../Adapters/Files/FilesAdapter'; import { LoggerAdapter } from '../Adapters/Logger/LoggerAdapter'; import { StorageAdapter } from '../Adapters/Storage/StorageAdapter'; import { CacheAdapter } from '../Adapt...
cwe
CWE-290
JavaScript
/* * Copyright 2012-2013 Ontology Engineering Group, Universidad Politecnica de Madrid, Spain * * 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...
cwe
CWE-22
Java
ext4_xattr_block_set(handle_t *handle, struct inode *inode, struct ext4_xattr_info *i, struct ext4_xattr_block_find *bs) { struct super_block *sb = inode->i_sb; struct buffer_head *new_bh = NULL; struct ext4_xattr_search *s = &bs->s; struct mb_cache_entry *ce = NULL; int error = 0; struct mb_cache *...
cwe
CWE-19
C/C++
amstar_backup( application_argument_t *argument) { int dumpin; char *cmd = NULL; char *qdisk; char line[32768]; amregex_t *rp; off_t dump_size = -1; char *type; char startchr; GPtrArray *argv_ptr; int starpid; int dataf...
cwe
CWE-77
Unknown
/*- * Copyright (c) 2004-2013 Tim Kientzle * Copyright (c) 2011-2012,2014 Michihiro NAKAJIMA * Copyright (c) 2013 Konrad Kleine * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redi...
cwe
CWE-401
C/C++
const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const category = ctx.params.category; const column = ctx.params.column; const url = `http://${column}.caixin.com/${category}`; const response = await got({ method: 'get', url, ...
cwe
CWE-918
JavaScript
@staticmethod def upsert_mapped_projects(user_id: int, project_id: int): """ Adds projects to mapped_projects if it doesn't exist """ sql = "select * from users where id = {0} and projects_mapped @> '{{{1}}}'".format(user_id, project_id) result = db.engine.execute(sql) if result.row...
cwe
CWE-89
Python
#include <node.h> #include <nan.h> #include <unicode/ucsdet.h> NAN_METHOD(DetectCharacterEncoding) { Nan::HandleScope scope; v8::Local<v8::Object> inputBuffer = info[0]->ToObject(); UCharsetDetector *charsetDetector; const UCharsetMatch *charsetMatch; UErrorCode errorCode = U_ZERO_ERROR; charsetDetector = uc...
cwe
CWE-755
C/C++
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-732
Java
# -*- coding: utf-8 -*- # Copyright 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 applicable la...
cwe
CWE-79
Python
/* * QEMU IDE disk and CD/DVD-ROM Emulator * * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2006 Openedhand Ltd. * * 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 restri...
cwe
CWE-476
C/C++
static bool load_buffer(RBinFile *bf, void **bin_obj, RBuffer *buf, ut64 loadaddr, Sdb *sdb) { RDyldCache *cache = R_NEW0 (RDyldCache); memcpy (cache->magic, "dyldcac", 7); cache->buf = r_buf_ref (buf); populate_cache_headers (cache); if (!cache->hdr) { r_dyldcache_free (cache); return false; } populate_cach...
cwe
CWE-787
Unknown
comparetup_index_btree(const SortTuple *a, const SortTuple *b, Tuplesortstate *state) { /* * This is similar to comparetup_heap(), but expects index tuples. There * is also special handling for enforcing uniqueness, and special treatment * for equal keys at the end. */ SortSupport sortKey = state->so...
cwe
CWE-209
Unknown
package org.thoughtcrime.securesms.linkpreview; import android.support.annotation.NonNull; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.URLSpan; import android.text.util.Linkify; import com.annimon.stream.Stream; import java.util.Collections; import java.util.List; i...
cwe
CWE-20
Java
def auto_complete_for_user_name search = params[:user][:name].to_s @users = User.find_by_sql("select * from users where LOWER(name) LIKE '%" + search + "%'") unless search.blank? end
cwe
CWE-89
Ruby
int nested_svm_vmrun(struct vcpu_svm *svm) { int ret; struct vmcb *vmcb12; struct vmcb *hsave = svm->nested.hsave; struct vmcb *vmcb = svm->vmcb; struct kvm_host_map map; u64 vmcb12_gpa; if (is_smm(&svm->vcpu)) { kvm_queue_exception(&svm->vcpu, UD_VECTOR); return 1; } vmcb12_gpa = svm->vmcb->save.rax; r...
cwe
CWE-416
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-772
C/C++
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-200
Java
void HeaderMapImpl::insertByKey(HeaderString&& key, HeaderString&& value) { EntryCb cb = ConstSingleton<StaticLookupTable>::get().find(key.getStringView()); if (cb) { key.clear(); StaticLookupResponse ref_lookup_response = cb(*this); if (*ref_lookup_response.entry_ == nullptr) { maybeCreateInline(...
cwe
CWE-400
C/C++
static inline signed short ReadPropertySignedShort(const EndianType endian, const unsigned char *buffer) { union { unsigned short unsigned_value; signed short signed_value; } quantum; unsigned short value; if (endian == LSBEndian) { value=(unsigned short) ((buffer[1] << ...
cwe
CWE-190
Unknown
DLLEXPORT int tjCompress2(tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags) { int i, retval = 0, allo...
cwe
CWE-787
Unknown
static int ext4_fill_super(struct super_block *sb, void *data, int silent) { char *orig_data = kstrdup(data, GFP_KERNEL); struct buffer_head *bh; struct ext4_super_block *es = NULL; struct ext4_sb_info *sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); ext4_fsblk_t block; ext4_fsblk_t sb_block = get_sb_block(&data); ext4...
cwe
CWE-125
Unknown
policy_summarize(smartlist_t *policy) { smartlist_t *summary = policy_summary_create(); smartlist_t *accepts, *rejects; int i, last, start_prt; size_t accepts_len, rejects_len, shorter_len, final_size; char *accepts_str = NULL, *rejects_str = NULL, *shorter_str, *result; const char *prefix; tor_assert(po...
cwe
CWE-119
C/C++
onNodeTextChange: function(node, text, oldText) { if (node.attributes && node.attributes.filterPanel) { node.attributes.filterPanel.setTitle(text); } },
cwe
CWE-79
JavaScript
function AddonTable_create() { /* INTEGRATION WITH MATH MODULE: Table supports integration with Math module. Table which is not activity, will show answers provided by Math module. Requires implementation of methods and variables listed below. Attributes: ...
cwe
CWE-79
JavaScript
static INLINE int vpx_read(vpx_reader *r, int prob) { unsigned int bit = 0; BD_VALUE value; BD_VALUE bigsplit; int count; unsigned int range; unsigned int split = (r->range * prob + (256 - prob)) >> CHAR_BIT; if (r->count < 0) vpx_reader_fill(r); value = r->value; count = r->count; bigsplit = (BD...
cwe
CWE-125
Unknown
static int xar_get_toc_data_values(xmlTextReaderPtr reader, long *length, long *offset, long *size, int *encoding, unsigned char ** a_cksum, int * a_hash, unsigned char ** e_cksum, int * e_hash) { const xmlChar *name; int indata = 0, inea = 0; int rc, gotoffset=0, gotlengt...
cwe
CWE-125
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); // Reinterprete the opaque data provided by user. OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput...
cwe
CWE-125
C/C++
def _add_chapsecret_to_host(self, host_name): """Generate and store a randomly-generated CHAP secret for the host.""" chap_secret = utils.generate_password() ssh_cmd = ('svctask chhost -chapsecret "%(chap_secret)s" %(host_name)s' % {'chap_secret': chap_secret, 'host_name': ho...
cwe
CWE-78
Python
/* * Handle firewalling * Linux ethernet bridge * * Authors: * Lennert Buytenhek <buytenh@gnu.org> * Bart De Schuymer <bdschuym@pandora.be> * * 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 Foun...
cwe
CWE-665
C/C++
/** * 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-346
Java
DSA_Signature_Operation(const DSA_PrivateKey& dsa, const std::string& emsa) : PK_Ops::Signature_with_EMSA(emsa), m_group(dsa.get_group()), m_x(dsa.get_x()), m_mod_q(dsa.group_q()) { #if defined(BOTAN_HAS_RFC6979_GENERATOR) m_rfc6979_hash = hash_for_emsa(emsa); #endi...
cwe
CWE-200
C/C++
void HTTPSession::onCertificate(uint16_t certId, std::unique_ptr<IOBuf> authenticator) { DestructorGuard dg(this); VLOG(4) << "CERTIFICATE on" << *this << ", certId=" << certId; bool isValid = false; auto fizzBase = getTransport()->getUnderlyingTransport<AsyncFizzBase>(); if (...
cwe
CWE-20
Unknown
R_API RBinJavaVerificationObj *r_bin_java_read_from_buffer_verification_info_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { ut64 offset = 0; RBinJavaVerificationObj *se = R_NEW0 (RBinJavaVerificationObj); if (!se) { return NULL; } se->file_offset = buf_offset; se->tag = buffer[offset]; offset += 1; if (se->tag ...
cwe
CWE-119
Unknown
void install_local_socket(asocket* s) { adb_mutex_lock(&socket_list_lock); s->id = local_socket_next_id++; if (local_socket_next_id == 0) { local_socket_next_id = 1; } insert_local_socket(s, &local_socket_list); adb_mutex_unlock(&socket_list_lock); }
cwe
CWE-264
C/C++
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label, bool is_tld_ascii) { UErrorCode status = U_ZERO_ERROR; int32_t result = uspoof_check(checker_, label.data(), base::checked_cast<int32_t>(label.size()), nullptr, &status); i...
cwe
CWE-20
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif static void jsonNewDString(Jsi_Interp *interp, Jsi_DString *dStr, const char* str, int len) { char buf[100], *dp = buf; const char *cp = str; int ulen; while ((cp-str)<len) { if (*cp == '\\') { switch (c...
cwe
CWE-120
C/C++
/******************************************************************************* * Copyright (c) 2015, 2018 Institute for Pervasive Computing, ETH Zurich and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * and E...
cwe
CWE-404
Java
const booleanOptions = [ { checked: true, unchecked: false }, { x: true, '': false }, { yes: true, no: false }, { y: true, n: false }, { 1: true, 0: false }, { '[x]': true, '[]': false, '[ ]': false }, { '☑': true, '': false }, { '✅': true, '': false }, { '✓': true, '': false }, { '✔': true, '': fal...
cwe
CWE-918
JavaScript
int main(int argc, char **argv) { for (int i = 1; i < argc; i++) { std::ifstream in(argv[i]); in.seekg(0, in.end); size_t length = in.tellg(); in.seekg (0, in.beg); std::cout << "checking " << argv[i] << std::endl; // Allocate exactly length bytes so that we relia...
cwe
CWE-787
Unknown
static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) { struct dvb_usb_device *d = i2c_get_adapdata(adap); u8 obuf[0x40], ibuf[0x40]; if (!d) return -ENODEV; if (mutex_lock_interruptible(&d->i2c_mutex) < 0) return -EAGAIN; switch (num) { case 1: switch (msg[0].add...
cwe
CWE-476
Unknown
OMX_ERRORTYPE SoftAVCEncoder::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { int32_t indexFull = index; switch (indexFull) { case OMX_IndexParamVideoBitrate: { OMX_VIDEO_PARAM_BITRATETYPE *bitRate = (OMX_VIDEO_PARAM_BITRATETYPE *) params; if...
cwe
CWE-119
C/C++
static int process_line(URLContext *h, char *line, int line_count, int *new_location) { HTTPContext *s = h->priv_data; const char *auto_method = h->flags & AVIO_FLAG_READ ? "POST" : "GET"; char *tag, *p, *end, *method, *resource, *version; int ret; /* end of header */ i...
cwe
CWE-119
C/C++
parse_wbxml_attribute_list (proto_tree *tree, tvbuff_t *tvb, guint32 offset, guint32 str_tbl, guint8 level, guint8 *codepage_attr) { guint32 tvb_len = tvb_reported_length (tvb); guint32 off = offset; guint32 len; guint str_len; guint32 ent; guint32 idx; guint8 peek; DebugLog(("parse_wbxml...
cwe
CWE-399
C/C++
gif_prepare_lzw (GifContext *context) { gint i; if (!gif_read (context, &(context->lzw_set_code_size), 1)) { /*g_message (_("GIF: EOF / read error on image data\n"));*/ return -1; } context->lzw_code_size = context->lzw_set_code_size + 1; context->lzw_clear_code = 1 << context->lzw_set_code_size; context->l...
cwe
CWE-20
Unknown
void GfxIndexedColorSpace::getRGBLine(Guchar *in, unsigned int *out, int length) { Guchar *line; int i, j, n; n = base->getNComps(); line = (Guchar *) gmalloc (length * n); for (i = 0; i < length; i++) for (j = 0; j < n; j++) line[i * n + j] = lookup[in[i] * n + j]; base->getRGBLine(line, ...
cwe
CWE-189
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-125
Python
#include "stdafx.h" #include "WebServer.h" #include "WebServerHelper.h" #include <boost/bind.hpp> #include <iostream> #include <fstream> #include "mainworker.h" #include "Helper.h" #include "localtime_r.h" #include "EventSystem.h" #include "dzVents.h" #include "../httpclient/HTTPClient.h" #include "../hardware/hardware...
cwe
CWE-89
C/C++
def getSubmissionDateFromDatabase(submission): database = sqlite3.connect('database.db') cursor = database.cursor() return cursor.execute("SELECT Date FROM ChallengeRankings WHERE SubmissionID = '" + str(submission.id) + "'").fetchone()[0] database.close()
cwe
CWE-89
Python
void close_thread_tables(THD *thd) { TABLE *table; DBUG_ENTER("close_thread_tables"); THD_STAGE_INFO(thd, stage_closing_tables); #ifdef EXTRA_DEBUG DBUG_PRINT("tcache", ("open tables:")); for (table= thd->open_tables; table; table= table->next) DBUG_PRINT("tcache", ("table: '%s'.'%s' %p", table->s->db.s...
cwe
CWE-703
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-772
C/C++
char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHAR...
cwe
CWE-119
Unknown
snmp_ber_encode_string_len(unsigned char *out, uint32_t *out_len, const char *str, uint32_t length) { uint32_t i; str += length - 1; for(i = 0; i < length; ++i) { (*out_len)++; *out-- = (uint8_t)*str--; } out = snmp_ber_encode_length(out, out_len, length); out = snmp_ber_encode_type(out, out_len, ...
cwe
CWE-125
C/C++
auth_delkeys(void) { symkey * sk; ITER_DLIST_BEGIN(key_listhead, sk, llink, symkey) if (sk->keyid > NTP_MAXKEY) { /* autokey */ continue; } /* * Don't lose info as to which keys are trusted. */ if (KEY_TRUSTED & sk->flags) { if (sk->secret != NULL) { memset(sk->secret, '\0', sk->secretsize);...
cwe
CWE-416
Unknown
func TimestampFileMetaEqual(actual data.TimestampFileMeta, expected data.TimestampFileMeta) error { // As opposed to snapshots, the length and hashes are still required in // TUF-1.0. See: // https://github.com/theupdateframework/specification/issues/38 if err := FileMetaEqual(actual.FileMeta, expected.FileMeta); e...
cwe
CWE-354
Go
isofs_export_encode_fh(struct inode *inode, __u32 *fh32, int *max_len, struct inode *parent) { struct iso_inode_info * ei = ISOFS_I(inode); int len = *max_len; int type = 1; __u16 *fh16 = (__u16*)fh32; /* * WARNING: max_len is 5 for NFSv2. Because of this * limitation, we use the l...
cwe
CWE-200
C/C++
Http::Response AbstractWebApplication::processRequest(const Http::Request &request, const Http::Environment &env) { session_ = 0; request_ = request; env_ = env; clear(); // clear response sessionInitialize(); if (!sessionActive() && !isAuthNeeded()) sessionStart(); if (isBanned()...
cwe
CWE-20
C/C++
int snd_timer_close(struct snd_timer_instance *timeri) { struct snd_timer *timer = NULL; struct snd_timer_instance *slave, *tmp; if (snd_BUG_ON(!timeri)) return -ENXIO; /* force to stop the timer */ snd_timer_stop(timeri); if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) { /* wait, until the active callback is ...
cwe
CWE-20
C/C++
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.attribute.ProductOptionService; import com.salesmanager.core.business.services.reference.language.LanguageService; import com.salesmanager.core.business.utils.ajax.AjaxResponse; import com.salesmanag...
cwe
CWE-639
Java
static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, struct dns_resolution *resolution, int max_answer_records) { unsigned char *reader; char *previous_dname, tmpname[DNS_MAX_NAME_SIZE]; int len, flags, offset; int dns_query_record_id; int nb_saved_records; struct dns_query_it...
cwe
CWE-125
C/C++
long WebPImage::getHeaderOffset(byte *data, long data_size, byte *header, long header_size) { long pos = -1; for (long i=0; i < data_size - header_size; i++) { if (memcmp(header, &data[i], header_size) == 0) { pos = i; break...
cwe
CWE-190
C/C++
__fdnlist(int fd, struct nlist *list) { struct nlist *p; Elf_Off symoff = 0, symstroff = 0; Elf_Word symsize = 0, symstrsize = 0; Elf_Sword cc, i; int nent = -1; int errsave; Elf_Sym sbuf[1024]; Elf_Sym *s; Elf_Ehdr ehdr; char *strtab = NULL; Elf_Shdr *shdr = NULL; Elf_Word shdr_size; struct stat st; /* ...
cwe
CWE-125
C/C++