Dataset Viewer
Auto-converted to Parquet Duplicate
code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
// A RestWrite encapsulates everything we need to run an operation // that writes to the database. // This could be either a "create" or an "update". var SchemaController = require('./Controllers/SchemaController'); var deepcopy = require('deepcopy'); const Auth = require('./Auth'); var cryptoUtils = require('./crypt...
vuln
Vulnerable
JavaScript
R_API void r_anal_bb_free(RAnalBlock *bb) { if (!bb) { return; } r_anal_cond_free (bb->cond); R_FREE (bb->fingerprint); r_anal_diff_free (bb->diff); bb->diff = NULL; R_FREE (bb->op_bytes); r_anal_switch_op_free (bb->switch_op); bb->switch_op = NULL; bb->fingerprint = NULL; bb->cond = NULL; R_FREE (bb->lab...
vuln
Vulnerable
C/C++
static PHP_FUNCTION(gzopen) { char *filename; char *mode; int filename_len, mode_len; int flags = REPORT_ERRORS; php_stream *stream; long use_include_path = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAIL...
cwe
CWE-254
C/C++
@Override public void onRequiemInitialize() { registerEtherealEventHandlers(); registerPossessionEventHandlers(); ReclamationStatusEffect.registerEventHandlers(); CanCurePossessedCallback.EVENT.register((body) -> { CurableEntityComponent curableEntityComponent = CurableEn...
vuln
Safe
Java
static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int type, int stackptr, int stacktop, BOOL has_quit) { delayed_mem_copy_status status; PCRE2_SPTR alternative; sljit_sw private_srcw[2]; sljit_sw shared_srcw[3]; sljit_sw kept_shared_srcw[2]; int private_count, shared_count, kept_...
cwe
CWE-703
Unknown
get_ruser(pam_handle_t *pamh, char *ruserbuf, size_t ruserbuflen) { const void *ruser; struct passwd *pwd; if (ruserbuf == NULL || ruserbuflen < 1) return -2; /* Get the name of the source user. */ if (pam_get_item(pamh, PAM_RUSER, &ruser) != PAM_SUCCESS) { ruser = NULL; } if ((ruser == NULL) || (strlen(rus...
vuln
Safe
C/C++
crypto_retrieve_X509_sans(krb5_context context, pkinit_plg_crypto_context plgctx, pkinit_req_crypto_context reqctx, X509 *cert, krb5_principal **princs_ret, krb5_principal **upn_ret, ...
cwe
CWE-287
C/C++
static int ocsp_verify_signer(X509 *signer, int response, X509_STORE *st, unsigned long flags, STACK_OF(X509) *untrusted, STACK_OF(X509) **chain) { X509_STORE_CTX *ctx = X509_STORE_CTX_new(); X509_VERIFY_PARAM *vp; int ret = -1; if (ctx == NUL...
vuln
Vulnerable
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
function selectRelativeTime() { var quantityField = new Ext.form.TextField({ fieldLabel: 'Show the past', width: 90, allowBlank: false, regex: /\d+/, regexText: 'Please enter a number', value: TimeRange.relativeStartQuantity }); var unitField = new Ext.form.ComboBox({ fieldLabel: '', ...
vuln
Vulnerable
JavaScript
static inline void write_IRQreg (openpic_t *opp, int n_IRQ, uint32_t reg, uint32_t val) { uint32_t tmp; switch (reg) { case IRQ_IPVP: opp->src[n_IRQ].ipvp = (opp->src[n_IRQ].ipvp & 0x40000000) | (val & 0x800F00FF); op...
vuln
Safe
C/C++
def get_ports(self): # First get the active FC ports out = self._cli_run('showport', None) # strip out header # N:S:P,Mode,State,----Node_WWN----,-Port_WWN/HW_Addr-,Type, # Protocol,Label,Partner,FailoverState out = out[1:len(out) - 2] ports = {'FC': [], 'iSCSI'...
cwe
CWE-78
Python
/* * Copyright (C) Alexander Borisov * Copyright (C) Nginx, Inc. */ #include <njs_main.h> static void njs_async_context_free(njs_vm_t *vm, njs_async_ctx_t *ctx); njs_int_t njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval) { njs_int_t ret; njs_value_t ctor;...
vuln
Safe
C/C++
static grub_disk_addr_t grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_ext2_data *data = node->data; struct grub_ext2_inode *inode = &node->inode; int blknr = -1; unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); if (grub_le...
vuln
Safe
C/C++
public RechnungCostEditTablePanel(final String id) { super(id); feedbackPanel = new FeedbackPanel("feedback"); ajaxComponents.register(feedbackPanel); add(feedbackPanel); this.form = new Form<AbstractRechnungsPositionDO>("form"); add(form); rows = new RepeatingView("rows"); form.add(ro...
vuln
Vulnerable
Java
public boolean checkUrlParameter(String url) { if (url != null) { try { URL parsedUrl = new URL(url); String protocol = parsedUrl.getProtocol(); String host = parsedUrl.getHost().toLowerCase(); return (protocol.equals("http") || protocol.equals("https")) && !host.endsWith(".internal") ...
vuln
Vulnerable
Java
int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len) { size_t i, j; i = c->num; if (i != 0) { if (i + len < MDC2_BLOCK) { /* partial block */ memcpy(&(c->data[i]), in, len); c->num += (int)len; return 1; } else { ...
vuln
Vulnerable
Unknown
static int decomp(unsigned char *srcBuf, unsigned char **jpegBuf, unsigned long *jpegSize, unsigned char *dstBuf, int w, int h, int subsamp, int jpegQual, char *fileName, int tilew, int tileh) { char tempStr[1024], sizeStr[24] = "\0", qualStr[13] = "\0", *ptr; F...
vuln
Vulnerable
C/C++
int tcpdump_open(tcpdump_t *tcpdump, pcap_t *pcap) { assert(tcpdump); assert(pcap); if (tcpdump->pid != 0) { warn("tcpdump process already running"); return FALSE; } /* is tcpdump executable? */ if (! can_exec(TCPDUMP_BINARY)) { errx(-1, "Unable to execute tcpdump binar...
vuln
Safe
C/C++
public void prepare() { if(sections != null) { return; } sections = new LevelChunkSection[totalLength]; int i = 0; for(int z = minZ; z <= maxZ; z++) { for(int y = minY; y <= maxY; y++) { for(int x = minX; x <= maxX; x++) { ...
vuln
Vulnerable
Java
WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info, const int argc,const char **argv,Image **images,ExceptionInfo *exception) { ChannelType channel; const char *option; ImageInfo *mogrify_info; MagickStatusType status; QuantizeInfo *quantize_info; register ssize_t...
cwe
CWE-399
C/C++
static int decomp(unsigned char *srcBuf, unsigned char **jpegBuf, unsigned long *jpegSize, unsigned char *dstBuf, int w, int h, int subsamp, int jpegQual, char *fileName, int tilew, int tileh) { char tempStr[1024], sizeStr[24] = "\0", qualStr[13] = "\0", *ptr; F...
cwe
CWE-787
C/C++
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo spli...
cwe
CWE-125
C/C++
def self.publish_unread(post) return unless post.topic.regular? # TODO at high scale we are going to have to defer this, # perhaps cut down to users that are around in the last 7 days as well group_ids = if post.post_type == Post.types[:whisper] [Group::AUTO_GROUPS[:staff]] else ...
cwe
CWE-200
Ruby
End of preview. Expand in Data Studio

Qwen Unified Security Dataset

A unified, multi-task dataset for training and evaluating Large Language Models on code security tasks:

  1. Vulnerability Detection (Binary classification)
  2. CWE Classification (Multi-class CWE identification)

Compiled from TitanVul and REEF datasets (excluding C# and BenchVul).

Downloads last month
28