Dataset Viewer
Auto-converted to Parquet Duplicate
func
string
target
int64
cwe
list
static boolean ReadICCProfile(j_decompress_ptr jpeg_info) { char magick[12]; ErrorManager *error_manager; ExceptionInfo *exception; Image *image; MagickBooleanType status; register ssize_t i; register unsigned char *p; size_t length; StringInfo *icc_profile,...
1
[ "CWE-416" ]
__export struct rad_dict_attr_t *rad_dict_find_attr_id(struct rad_dict_vendor_t *vendor, int id) { struct rad_dict_attr_t *attr; struct list_head *items = vendor ? &vendor->items : &dict->items; list_for_each_entry(attr, items, entry) if (attr->id == id) return attr; return NULL; }
0
[ "CWE-787" ]
void set_user_nice(struct task_struct *p, long nice) { int old_prio, delta, on_rq; unsigned long flags; struct rq *rq; if (TASK_NICE(p) == nice || nice < -20 || nice > 19) return; /* * We have to be careful, if called from sys_setpriority(), * the task might be in the middle of scheduling on another CPU. ...
0
[]
GetNumWrongData(const byte * curPtr, const int maxnum) { int count = 0; if (1 == maxnum) { return (1); } while (maxnum > count+1 && *(curPtr + count) != *(curPtr + count + 1)) { count++; } return (count); }
0
[ "CWE-787" ]
int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir, const char *name, int name_len) { int ret; struct btrfs_key key; struct btrfs_dir_item *di; int data_size; struct extent_buffer *leaf; int slot; struct btrfs_path *path; path = btrfs_alloc_path(); if (!path) return -ENOMEM; key.o...
0
[ "CWE-310" ]
static int rsi_mac80211_resume(struct ieee80211_hw *hw) { u16 rx_filter_word = 0; struct rsi_hw *adapter = hw->priv; struct rsi_common *common = adapter->priv; common->wow_flags = 0; rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__); if (common->hibernate_resume) return 0; mutex_lock(&common->mutex); ...
0
[ "CWE-416" ]
MagickExport MagickBooleanType SetImageProperty(Image *image, const char *property,const char *value,ExceptionInfo *exception) { MagickBooleanType status; MagickStatusType flags; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) ...
0
[ "CWE-476" ]
proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, const gint start, gint length, const guint encoding, gboolean *retval) { header_field_info *hfinfo = proto_registrar_get_nth(hfindex); field_info *new_fi; guint64 value,...
0
[ "CWE-401" ]
auth_update_component(struct sc_card *card, struct auth_update_component_info *args) { struct sc_apdu apdu; unsigned char sbuf[SC_MAX_APDU_BUFFER_SIZE + 0x10]; unsigned char ins, p1, p2; int rv, len; LOG_FUNC_CALLED(card->ctx); if (args->len > sizeof(sbuf) || args->len > 0x100) LOG_FUNC_RETURN(card->ctx, SC_ER...
0
[ "CWE-125" ]
static s32 brcmf_set_auth_type(struct net_device *ndev, struct cfg80211_connect_params *sme) { struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); struct brcmf_cfg80211_security *sec; s32 val = 0; s32 err = 0; switch (sme->auth_type) { case NL80211_AUTHTYPE_OPEN_SYSTEM: val = 0; brcmf_dbg(...
0
[ "CWE-119", "CWE-787" ]
CImg<T>& blur_box(const float boxsize_x, const float boxsize_y, const float boxsize_z, const unsigned int boundary_conditions=1, const unsigned int nb_iter=1) { if (is_empty()) return *this; if (_width>1) boxfilter(boxsize_x,0,'x',boundary_conditions,nb_iter);...
0
[ "CWE-770" ]
static int network_flush(cdtime_t timeout, __attribute__((unused)) const char *identifier, __attribute__((unused)) user_data_t *user_data) { pthread_mutex_lock(&send_buffer_lock); if (send_buffer_fill > 0) { if (timeout > 0) { cdtime_t now = cdtime(); ...
0
[ "CWE-835" ]
static void test_bug9643() { MYSQL_STMT *stmt; MYSQL_BIND my_bind[1]; int32 a; int rc; const char *stmt_text; int num_rows= 0; ulong type; ulong prefetch_rows= 5; myheader("test_bug9643"); mysql_query(mysql, "drop table if exists t1"); mysql_query(mysql, "create table t1 (id integer not null pri...
0
[ "CWE-416" ]
zzip_mem_disk_load(ZZIP_MEM_DISK* dir, ZZIP_DISK* disk) { if (dir->list) zzip_mem_disk_unload(dir); ___ struct zzip_disk_entry* entry = zzip_disk_findfirst(disk); for (; entry ; entry = zzip_disk_findnext(disk, entry)) { ZZIP_MEM_DISK_ENTRY* item = zzip_mem_disk_entry_new(disk, entry); if (dir->last) { di...
1
[ "CWE-119" ]
int rsa_pkcs1_decrypt( rsa_context *ctx, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len) { switch( ctx->padding ) { case RSA_PKCS_V15: return rsa_rsae...
1
[ "CWE-310" ]
void subtime(struct timeval *a, struct timeval *b) { timersub(a, b, b); }
0
[ "CWE-20", "CWE-703" ]
bool Item::cleanup_processor(void *arg) { if (fixed) cleanup(); return FALSE; }
0
[ "CWE-416" ]
static struct sb_uart_state *uart_get(struct uart_driver *drv, int line) { struct sb_uart_state *state; MP_MUTEX_LOCK(mp_mutex); state = drv->state + line; if (mutex_lock_interruptible(&state->mutex)) { state = ERR_PTR(-ERESTARTSYS); goto out; } state->count++; if (!state->port) { state->count--; MP_STA...
0
[ "CWE-200" ]
grapheme_extract_charcount_iter(UBreakIterator *bi, int32_t csize, unsigned char *pstr, int32_t str_len) { int pos = 0, prev_pos = 0; int ret_pos = 0, prev_ret_pos = 0; while ( 1 ) { pos = ubrk_next(bi); if ( UBRK_DONE == pos ) { break; } /* if we are beyond our limit, then the loop is done */ if ( p...
0
[]
static void regulator_bulk_enable_async(void *data, async_cookie_t cookie) { struct regulator_bulk_data *bulk = data; bulk->ret = regulator_enable(bulk->consumer); }
0
[ "CWE-416" ]
static void free_pgpaths(struct list_head *pgpaths, struct dm_target *ti) { struct pgpath *pgpath, *tmp; struct multipath *m = ti->private; list_for_each_entry_safe(pgpath, tmp, pgpaths, list) { list_del(&pgpath->list); if (m->hw_handler_name) scsi_dh_detach(bdev_get_queue(pgpath->path.dev->bdev)); dm_put_...
0
[ "CWE-284", "CWE-264" ]
bgp_attr_origin (struct bgp_attr_parser_args *args) { struct peer *const peer = args->peer; struct attr *const attr = args->attr; const bgp_size_t length = args->length; /* If any recognized attribute has Attribute Length that conflicts with the expected length (based on the attribute type code), then ...
0
[]
bool ParticipantImpl::removeSubscriber( Subscriber* sub) { for (auto sit = m_subscribers.begin(); sit != m_subscribers.end(); ++sit) { if (sit->second->getGuid() == sub->getGuid()) { delete(sit->second); m_subscribers.erase(sit); return true; }...
0
[ "CWE-284" ]
void virDomainInputDefFree(virDomainInputDefPtr def) { if (!def) return; virDomainDeviceInfoClear(&def->info); VIR_FREE(def->source.evdev); VIR_FREE(def->virtio); VIR_FREE(def); }
0
[ "CWE-212" ]
static ssize_t tlbflush_read_file(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { char buf[32]; unsigned int len; len = sprintf(buf, "%ld\n", tlb_single_page_flush_ceiling); return simple_read_from_buffer(user_buf, count, ppos, buf, len); }
0
[ "CWE-362" ]
bool CSteamNetworkConnectionUDP::BBeginAccept( CSteamNetworkListenSocketDirectUDP *pParent, const netadr_t &adrFrom, CSharedSocket *pSharedSock, const SteamNetworkingIdentity &identityRemote, uint32 unConnectionIDRemote, const CMsgSteamDatagramCertificateSigned &msgCert, const CMsgSteamDatagramSessionCryptInfoSi...
0
[ "CWE-703" ]
static void fwnet_remove(struct fw_unit *unit) { struct fwnet_peer *peer = dev_get_drvdata(&unit->device); struct fwnet_device *dev = peer->dev; struct net_device *net; int i; mutex_lock(&fwnet_device_mutex); net = dev->netdev; fwnet_remove_peer(peer, dev); if (list_empty(&dev->peer_list)) { unregister_ne...
0
[ "CWE-119", "CWE-284", "CWE-787" ]
static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen) { void *addr; /* * VMAP_STACK (at least) puts stack into the vmalloc address space */ if (is_vmalloc_addr(buf)) addr = vmalloc_to_page(buf); else addr = virt_to_page(buf); sg_set_page(sg, addr, buflen, o...
0
[ "CWE-476" ]
TEST_F(ExpressionNaryTest, GroupingOptimizationOnAssociativeOnlyNotExecuteOnSingleConstantsBack) { BSONArray spec = BSON_ARRAY("$path" << 55); addOperandArrayToExpr(_associativeOnly, spec); assertContents(_associativeOnly, spec); intrusive_ptr<Expression> optimized = _associativeOnly->optimize(); AS...
0
[ "CWE-835" ]
int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) { WARN_ON(mm == NULL); return security_ops->vm_enough_memory(mm, pages); }
0
[]
congestion_control_init(congestion_control_t *cc, const circuit_params_t *params, cc_path_t path) { cc->sendme_pending_timestamps = smartlist_new(); cc->sendme_arrival_timestamps = smartlist_new(); cc->in_slow_start = 1; congestion_control_init_params(cc, params,...
0
[]
kssl_tgt_is_available(KSSL_CTX *kssl_ctx) { krb5_error_code krb5rc = KRB5KRB_ERR_GENERIC; krb5_context krb5context = NULL; krb5_ccache krb5ccdef = NULL; krb5_creds krb5creds, *krb5credsp = NULL; int rc = 0; memset((char *)&krb5creds, 0, s...
0
[ "CWE-20" ]
struct dentry *ovl_entry_real(struct ovl_entry *oe, bool *is_upper) { struct dentry *realdentry; realdentry = ovl_upperdentry_dereference(oe); if (realdentry) { *is_upper = true; } else { realdentry = oe->lowerdentry; *is_upper = false; } return realdentry; }
0
[ "CWE-284", "CWE-264" ]
static String* Pe_r_bin_pe_parse_string(struct PE_(r_bin_pe_obj_t)* bin, PE_DWord* curAddr) { String* string = calloc (1, sizeof(*string)); PE_DWord begAddr = *curAddr; int len_value = 0; int i = 0; if (!string) { bprintf ("Warning: calloc (String)\n"); return NULL; } if (begAddr > bin->size || begAddr + siz...
0
[ "CWE-125" ]
glob_func_error(VALUE val) { struct glob_error_args *arg = (struct glob_error_args *)val; VALUE path = rb_enc_str_new_cstr(arg->path, arg->enc); rb_syserr_fail_str(arg->error, path); return Qnil; }
0
[ "CWE-22" ]
int ipmi_set_my_LUN(struct ipmi_user *user, unsigned int channel, unsigned char LUN) { int index, rv = 0; user = acquire_ipmi_user(user, &index); if (!user) return -ENODEV; if (channel >= IPMI_MAX_CHANNELS) { rv = -EINVAL; } else { channel = array_index_nospec(channel, IPMI_MAX_CHANNELS); us...
0
[ "CWE-416", "CWE-284" ]
irc_server_set_host (struct t_irc_server *server, const char *host) { struct t_irc_channel *ptr_channel; /* if host is the same, just return */ if ((!server->host && !host) || (server->host && host && strcmp (server->host, host) == 0)) { return; } /* update the nick host in ser...
0
[ "CWE-120", "CWE-787" ]
static int crypto_pcomp_init(struct crypto_tfm *tfm, u32 type, u32 mask) { return 0; }
0
[ "CWE-310" ]
**/ CImgList():
0
[ "CWE-125" ]
unsigned int iucv_sock_poll(struct file *file, struct socket *sock, poll_table *wait) { struct sock *sk = sock->sk; unsigned int mask = 0; sock_poll_wait(file, sk_sleep(sk), wait); if (sk->sk_state == IUCV_LISTEN) return iucv_accept_poll(sk); if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) m...
0
[ "CWE-20", "CWE-269" ]
xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family) { struct xfrm_state *x; rcu_read_lock(); x = __xfrm_state_lookup(net, mark, daddr, spi, proto, family); rcu_read_unlock(); return x; }
0
[ "CWE-416" ]
int security_syslog(int type) { return security_ops->syslog(type); }
0
[]
bool ha_partition::initialize_partition(MEM_ROOT *mem_root) { handler **file_array, *file; ulonglong check_table_flags; DBUG_ENTER("ha_partition::initialize_partition"); if (m_create_handler) { m_tot_parts= m_part_info->get_tot_partitions(); DBUG_ASSERT(m_tot_parts > 0); if (new_handlers_from_par...
0
[]
init_write_reg( int name, yankreg_T **old_y_previous, yankreg_T **old_y_current, int must_append, int *yank_type UNUSED) { if (!valid_yank_reg(name, TRUE)) // check for valid reg name { emsg_invreg(name); return FAIL; } // Don't want to change the current (unnamed) register...
0
[ "CWE-122", "CWE-787" ]
static json_t *json_object_deep_copy(const json_t *object) { json_t *result; void *iter; result = json_object(); if(!result) return NULL; /* Cannot use json_object_foreach because object has to be cast non-const */ iter = json_object_iter((json_t *)object); while(iter) { ...
0
[ "CWE-310" ]
static int mmap_ureg(struct vm_area_struct *vma, struct qib_devdata *dd, u64 ureg) { unsigned long phys; unsigned long sz; int ret; /* * This is real hardware, so use io_remap. This is the mechanism * for the user process to update the head registers for their ctxt * in the chip. */ sz = dd->flags...
0
[ "CWE-284", "CWE-264" ]
xmlHashAddEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata) { return(xmlHashAddEntry3(table, name, NULL, NULL, userdata)); }
0
[ "CWE-399" ]
static struct bsg_command *bsg_alloc_command(struct bsg_device *bd) { struct bsg_command *bc = ERR_PTR(-EINVAL); spin_lock_irq(&bd->lock); if (bd->queued_cmds >= bd->max_queue) goto out; bd->queued_cmds++; spin_unlock_irq(&bd->lock); bc = kmem_cache_zalloc(bsg_cmd_cachep, GFP_KERNEL); if (unlikely(!bc)) { ...
0
[ "CWE-399" ]
static inline struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t features, bool *again) { return skb; }
0
[ "CWE-416" ]
static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) { struct shmem_sb_info *sbinfo = SHMEM_SB(sb); struct shmem_sb_info config = *sbinfo; unsigned long blocks; unsigned long inodes; int error = -EINVAL; if (shmem_parse_options(data, &config, true)) return error; spin_lock(&sbinfo->sta...
0
[ "CWE-400" ]
static errno_t sssctl_restore(bool force_start, bool force_restart) { errno_t ret; if (!sssctl_start_sssd(force_start)) { return ERR_SSSD_NOT_RUNNING; } if (sssctl_backup_file_exists(SSS_BACKUP_USER_OVERRIDES)) { ret = sssctl_run_command((const char *[]){"sss_override", "user-import", ...
0
[ "CWE-78" ]
thread_specific_data(void *private_data) { xmlDocPtr myDoc; const char *filename = (const char *) private_data; int okay = 1; if (!strcmp(filename, "test/threads/invalid.xml")) { xmlDoValidityCheckingDefaultValue = 0; xmlGenericErrorContext = stdout; } else { xmlDoValidityCh...
0
[ "CWE-125" ]
void fsck_set_msg_types(struct fsck_options *options, const char *values) { char *buf = xstrdup(values), *to_free = buf; int done = 0; while (!done) { int len = strcspn(buf, " ,|"), equal; done = !buf[len]; if (!len) { buf++; continue; } buf[len] = '\0'; for (equal = 0; equal < len && buf...
0
[ "CWE-20", "CWE-88", "CWE-522" ]
static void *m_start(struct seq_file *m, loff_t *pos) { struct proc_mounts *p = proc_mounts(m); down_read(&namespace_sem); return seq_list_start(&p->ns->list, *pos); }
0
[ "CWE-284", "CWE-264" ]
static int ehci_process_itd(EHCIState *ehci, EHCIitd *itd, uint32_t addr) { USBDevice *dev; USBEndpoint *ep; uint32_t i, len, pid, dir, devaddr, endp; uint32_t pg, off, ptr1, ptr2, max, mult; ehci->periodic_sched_active = PERIODIC_ACTIVE; ...
1
[ "CWE-617" ]
int free_embedded_options(char ** options_list, int options_count) { int i; for (i= 0; i < options_count; i++) { if (options_list[i]) free(options_list[i]); } free(options_list); return 1; }
0
[ "CWE-416" ]
static bool reg_type_mismatch_ok(enum bpf_reg_type type) { switch (base_type(type)) { case PTR_TO_CTX: case PTR_TO_SOCKET: case PTR_TO_SOCK_COMMON: case PTR_TO_TCP_SOCK: case PTR_TO_XDP_SOCK: case PTR_TO_BTF_ID: return false; default: return true; } }
0
[ "CWE-787" ]
GF_Filter *gf_fs_load_filter(GF_FilterSession *fsess, const char *name, GF_Err *err_code) { const char *args=NULL; const char *sep, *file_ext; u32 i, len, count = gf_list_count(fsess->registry); Bool quiet = (err_code && (*err_code == GF_EOS)) ? GF_TRUE : GF_FALSE; assert(fsess); assert(name); if (err_code) *er...
1
[ "CWE-476" ]
TEST_F(HttpHealthCheckerImplTest, GoAwayProbeInProgress) { setupHCHttp2(); EXPECT_CALL(runtime_.snapshot_, featureEnabled("health_check.verify_cluster", 100)) .WillRepeatedly(Return(false)); cluster_->prioritySet().getMockHostSet(0)->hosts_ = { makeTestHost(cluster_->info_, "tcp://127.0.0.1:80", simTi...
0
[ "CWE-476" ]
Error Box_auxC::write(StreamWriter& writer) const { size_t box_start = reserve_box_header_space(writer); writer.write(m_aux_type); for (uint8_t subtype : m_aux_subtypes) { writer.write8(subtype); } prepend_header(writer, box_start); return Error::Ok; }
0
[ "CWE-703" ]
static void cmd_capabilities(char *keyword __attribute__((unused))) { const char *mechlist; int mechcount = 0; prot_printf(nntp_out, "101 Capability list follows:\r\n"); prot_printf(nntp_out, "VERSION 2\r\n"); if (nntp_authstate || (config_serverinfo == IMAP_ENUM_SERVERINFO_ON)) { prot_printf(nntp...
0
[ "CWE-287" ]
void Compute(OpKernelContext* context) override { // Read ragged_splits inputs. OpInputList ragged_nested_splits_in; OP_REQUIRES_OK(context, context->input_list("rt_nested_splits", &ragged_nested_splits_in)); const int ragged_nested_splits_len = ragged_n...
1
[ "CWE-125", "CWE-824" ]
llsec_update_devkey_info(struct mac802154_llsec_device *dev, const struct ieee802154_llsec_key_id *in_key, u32 frame_counter) { struct mac802154_llsec_device_key *devkey = NULL; if (dev->dev.key_mode == IEEE802154_LLSEC_DEVKEY_RESTRICT) { devkey = llsec_devkey_find(dev, in_key); if (!devkey) return -E...
0
[ "CWE-416" ]
void clear_fifo (i) int i; { if (dev_fd_list[i]) { dev_fd_list[i] = 0; nfds--; }
0
[ "CWE-20" ]
static inline void DetectRunPrefilterPkt( ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p, DetectRunScratchpad *scratch ) { DetectPrefilterSetNonPrefilterList(p, det_ctx, scratch); /* create our prefilter mask */ PacketCreateMask(p, &scratch->pkt_mask,...
0
[ "CWE-347" ]
static int check_version_match(void) { DYNAMIC_STRING ds_version; char version_str[NAME_CHAR_LEN + 1]; if (init_dynamic_string(&ds_version, NULL, NAME_CHAR_LEN, NAME_CHAR_LEN)) die("Out of memory"); if (run_query("show variables like 'version'", &ds_version, FALSE)) { fprintf(stderr, "Error: Failed ...
0
[ "CWE-319" ]
u32 parse_track_dump(char *arg, u32 dump_type) { if (!create_new_track_action(arg, TRACK_ACTION_RAW_EXTRACT, dump_type)) return 2; track_dump_type = dump_type; return 0;
0
[ "CWE-787" ]
void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active) { struct hci_dev *hdev = conn->hdev; BT_DBG("hcon %p mode %d", conn, conn->mode); if (conn->mode != HCI_CM_SNIFF) goto timer; if (!test_bit(HCI_CONN_POWER_SAVE, &conn->flags) && !force_active) goto timer; if (!test_and_set_bit(HCI_CO...
0
[ "CWE-327" ]
e_mail_parser_parse (EMailParser *parser, CamelFolder *folder, const gchar *message_uid, CamelMimeMessage *message, GAsyncReadyCallback callback, GCancellable *cancellable, gpointer user_data) {...
0
[ "CWE-347" ]
static bool check_underflow(const struct ip6t_entry *e) { const struct xt_entry_target *t; unsigned int verdict; if (!unconditional(&e->ipv6)) return false; t = ip6t_get_target_c(e); if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0) return false; verdict = ((struct xt_standard_target *)t)->verdict; verdi...
1
[ "CWE-119", "CWE-787" ]
static inline TCGMemOp mo_64_32(TCGMemOp ot) { #ifdef TARGET_X86_64 return ot == MO_64 ? MO_64 : MO_32; #else return MO_32; #endif }
0
[ "CWE-94" ]
lyxml_free_attrs(struct ly_ctx *ctx, struct lyxml_elem *elem) { struct lyxml_attr *a, *next; if (!elem || !elem->attr) { return; } a = elem->attr; do { next = a->next; lydict_remove(ctx, a->name); lydict_remove(ctx, a->value); if (a->type == LYXML_ATTR_STD_U...
0
[ "CWE-674" ]
SegmentCommand* Binary::segment_from_offset(uint64_t offset) { return const_cast<SegmentCommand*>(static_cast<const Binary*>(this)->segment_from_offset(offset)); }
1
[ "CWE-703" ]
static int pfkey_error(const struct sadb_msg *orig, int err, struct sock *sk) { struct sk_buff *skb = alloc_skb(sizeof(struct sadb_msg) + 16, GFP_KERNEL); struct sadb_msg *hdr; if (!skb) return -ENOBUFS; /* Woe be to the platform trying to support PFKEY yet * having normal errnos outside the 1-255 range, incl...
0
[ "CWE-20", "CWE-269" ]
void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { gchar *ifilename; variableLength *filename; gchar *charptr, *charptr2; FILE *fptr; gint index; DWORD *dword_ptr; DWORD dword_val; dtr thedate; ifilename = g_build_filename (tmpdir, "calendar.vcf", NULL); printf("%s\n",...
0
[]
static int mark_source_chains(const struct xt_table_info *newinfo, unsigned int valid_hooks, void *entry0, unsigned int *offsets) { unsigned int hook; /* No recursion; use packet counter to save back ptrs (reset * to 0 as we leave), and comefrom to save source hook bitmask. */ for (hook = 0; h...
0
[ "CWE-787" ]
static int ntop_set_second_traffic(lua_State* vm) { NetworkInterface *ntop_interface = getCurrentInterface(vm); ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__); if(!ntop_interface) return(CONST_LUA_ERROR); ntop_interface->updateSecondTraffic(time(NULL)); return(CONST_LUA_OK); }
0
[ "CWE-476" ]
static int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, ext4_lblk_t iblock, unsigned int maxblocks, struct buffer_head *bh_result, int create, int extend_disksize) { int err = -EIO; ext4_lblk_t offsets[4]; Indirect chain[4]; Indirect *partial; ext4_fsblk_t goal; int indirect_blk...
0
[ "CWE-399" ]
ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source) { uint32_t idx; HashTable *target; IS_CONSISTENT(source); ALLOC_HASHTABLE(target); GC_REFCOUNT(target) = 1; GC_TYPE_INFO(target) = IS_ARRAY; target->nTableSize = source->nTableSize; target->pDestructor = source->pDestructor; if (source->nN...
0
[ "CWE-190" ]
seticc_lab(i_ctx_t * i_ctx_p, float *white, float *black, float *range_buff) { int code; gs_color_space * pcs; int i; /* build the color space object */ code = gs_cspace_build_ICC(&pcs, NULL, gs_gstate_memory(igs)); if (code < 0) return gs_...
0
[ "CWE-704" ]
create_backup (char const *to, const struct stat *to_st, bool leave_original) { /* When the input to patch modifies the same file more than once, patch only backs up the initial version of each file. To figure out which files have already been backed up, patch remembers the files that replace the orig...
1
[ "CWE-59" ]
static void print_request(struct drm_printer *m, struct i915_request *rq, const char *prefix) { const char *name = rq->fence.ops->get_timeline_name(&rq->fence); char buf[80] = ""; int x = 0; x = print_sched_attr(&rq->sched.attr, buf, x, sizeof(buf)); drm_printf(m, "%s %llx:%llx%s%s %s @ %dms: %s\n", ...
0
[ "CWE-20", "CWE-190" ]
MagickExport Image *SmushImages(const Image *images, const MagickBooleanType stack,const ssize_t offset,ExceptionInfo *exception) { #define SmushImageTag "Smush/Image" CacheView *smush_view; const Image *image; Image *smush_image; MagickBooleanType matte, proceed, status; Magic...
0
[ "CWE-665" ]
static inline void tcp_advance_highest_sack(struct sock *sk, struct sk_buff *skb) { tcp_sk(sk)->highest_sack = tcp_skb_is_last(sk, skb) ? NULL : tcp_write_queue_next(sk, skb); }
0
[ "CWE-416", "CWE-269" ]
static int __check_ptr_off_reg(struct bpf_verifier_env *env, const struct bpf_reg_state *reg, int regno, bool fixed_off_ok) { /* Access to this pointer-typed register or passing it to a helper * is only allowed in its original, unmodified form. */ if (!fixed_off_ok && reg->off) { verbose(en...
0
[ "CWE-787" ]
static int generate_session_id(const SSL *ssl, unsigned char *id, unsigned int *id_len) { unsigned int count = 0; do { if (RAND_bytes(id, *id_len) <= 0) return 0; /* * Prefix the session_id with the required prefix. NB: If our prefix *...
0
[ "CWE-399" ]
static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode mode) { struct hrtimer_cpu_base *cpu_base; int base; memset(timer, 0, sizeof(struct hrtimer)); cpu_base = raw_cpu_ptr(&hrtimer_bases); if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS) clock_id = CLOCK_MONO...
0
[ "CWE-200" ]
static void i40e_remove_queue_channels(struct i40e_vsi *vsi) { enum i40e_admin_queue_err last_aq_status; struct i40e_cloud_filter *cfilter; struct i40e_channel *ch, *ch_tmp; struct i40e_pf *pf = vsi->back; struct hlist_node *node; int ret, i; /* Reset rss size that was stored when reconfiguring rss for * chan...
0
[ "CWE-400", "CWE-401" ]
FilterEncodingNode *FLTCreateBinaryCompFilterEncodingNode(void) { FilterEncodingNode *psFilterNode = NULL; psFilterNode = FLTCreateFilterEncodingNode(); /* used to store case sensitivity flag. Default is 0 meaning the comparing is case sensititive */ psFilterNode->pOther = (int *)malloc(sizeof(int)); (*...
0
[ "CWE-200", "CWE-119" ]
static int getScreenColumns(void) { int cols; #ifdef _WIN32 CONSOLE_SCREEN_BUFFER_INFO inf; GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &inf); cols = inf.dwSize.X; #else struct winsize ws; cols = (ioctl(1, TIOCGWINSZ, &ws) == -1) ? 80 : ws.ws_col; #endif // cols is 0 in certa...
0
[ "CWE-200" ]
vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg, int main_fd) { struct virtio_net *dev = *pdev; struct VhostUserMemory *memory = &msg->payload.memory; struct rte_vhost_mem_region *reg; void *mmap_addr; uint64_t mmap_size; uint64_t mmap_offset; uint64_t alignment; uint32_t i; int ...
0
[]
qtdemux_tag_add_id32 (GstQTDemux * demux, GstTagList * taglist, const char *tag, const char *tag_bis, GNode * node) { guint8 *data; GstBuffer *buf; guint len; GstTagList *id32_taglist = NULL; GST_LOG_OBJECT (demux, "parsing ID32"); data = node->data; len = GST_READ_UINT32_BE (data); /* need at le...
0
[ "CWE-125" ]
static void readbn(BIGNUM **bn, BIO *bconn) { char buf[10240]; int l; l = BIO_gets(bconn, buf, sizeof buf); assert(l > 0); assert(buf[l-1] == '\n'); buf[l-1] = '\0'; BN_hex2bn(bn, buf); }
0
[]
static inline bool is_ioat_bug(unsigned long err) { return !!err; }
0
[]
static bool security_info_runs_privileged(const struct security_info *i) { assert(i); if (STRPTR_IN_SET(i->user, "0", "root")) return true; if (i->dynamic_user) return false; return isempty(i->user); }
0
[ "CWE-269" ]
Join() : ClientProtocol::Message("JOIN") , memb(NULL) { }
0
[ "CWE-200", "CWE-732" ]
mprint(struct magic_set *ms, struct magic *m) { uint64_t v; float vf; double vd; int64_t t = 0; char buf[128], tbuf[26]; union VALUETYPE *p = &ms->ms_value; switch (m->type) { case FILE_BYTE: v = file_signextend(ms, m, (uint64_t)p->b); switch (check_fmt(ms, m)) { case -1: return -1; case 1: ...
0
[ "CWE-20" ]
static void test_open_cursor_prepared_statement_query_cache() { MYSQL_STMT *stmt; int rc; MYSQL_RES *result; myheader("test_open_cursor_prepared_statement_query_cache"); if (! is_query_cache_available()) { fprintf(stdout, "Skipping test_open_cursor_prepared_statement_query_cache: Query cache not availa...
0
[ "CWE-416" ]
static void line_unit_free(RzBinDwarfLineUnit *unit) { if (!unit) { return; } line_header_fini(&unit->header); if (unit->ops) { for (size_t i = 0; i < unit->ops_count; i++) { rz_bin_dwarf_line_op_fini(&unit->ops[i]); } free(unit->ops); } free(unit); }
0
[ "CWE-787" ]
int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area) { struct snd_pcm_runtime *runtime = substream->runtime; area->vm_page_prot = pgprot_noncached(area->vm_page_prot); return vm_iomap_memory(area, runtime->dma_addr, runtime->dma_bytes); }
0
[ "CWE-125" ]

CASS-Vibe Security Bench

19 teacher triples + 20 human-labeled rows + 100 real-CVE rows with reports.

from datasets import load_dataset
ds = load_dataset("bbkdevops/cass-vibe-security-bench", "truth20")

Reproduce: python eval.py (needs the repo's cass/ package for scanners; numbers must match EVIDENCE.md scoreboard).

Downloads last month
25