instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: loff_t ext4_llseek(struct file *file, loff_t offset, int whence) { struct inode *inode = file->f_mapping->host; loff_t maxbytes; if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) maxbytes = EXT4_SB(inode->i_sb)->s_bitmap_maxbytes; else maxbytes = inode->i_sb->s_maxbytes; switch (whence) { case S...
0
17,080
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool TopSitesCache::GetPageThumbnail( const GURL& url, scoped_refptr<base::RefCountedMemory>* bytes) const { std::map<GURL, Images>::const_iterator found = images_.find(GetCanonicalURL(url)); if (found != images_.end()) { base::RefCountedMemory* data = found->second.thumbnail.get(); if (...
0
1,859
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct dirent *handle_readdir(FsContext *ctx, V9fsFidOpenState *fs) { return readdir(fs->dir.stream); } Commit Message: CWE ID: CWE-400
0
15,505
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPICE_GNUC_VISIBLE int spice_server_set_image_compression(SpiceServer *s, spice_image_compression_t comp) { spice_assert(reds == s); set_image_compression(comp); return 0; } Commit Message: CWE ID: CWE-119
0
8,830
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int srpt_ch_list_empty(struct srpt_device *sdev) { int res; spin_lock_irq(&sdev->spinlock); res = list_empty(&sdev->rch_list); spin_unlock_irq(&sdev->spinlock); return res; } Commit Message: IB/srpt: Simplify srpt_handle_tsk_mgmt() Let the target core check task existence instead of the SRP target...
0
19,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Box *tfdt_New() { ISOM_DECL_BOX_ALLOC(GF_TFBaseMediaDecodeTimeBox, GF_ISOM_BOX_TYPE_TFDT); return (GF_Box *)tmp; } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
6,057
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool HTMLMediaElement::HasPendingActivity() const { if (should_delay_load_event_) return true; if (network_state_ == kNetworkLoading) return true; { AutoReset<bool> scope(&official_playback_position_needs_update_, false); if (CouldPlayIfEnoughData()) return true; } if (seeking_...
0
5,650
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ComputeEndPoints(const DDSSingleColourLookup *lookup[], const unsigned char *color, DDSVector3 *start, DDSVector3 *end, unsigned char *index) { register ssize_t i; size_t c, maxError = SIZE_MAX; for (i=0; i < 2; i++) { const DDSSourceBlock* sources[3]; size_t...
0
21,681
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int xenvif_get_sset_count(struct net_device *dev, int string_set) { switch (string_set) { case ETH_SS_STATS: return ARRAY_SIZE(xenvif_stats); default: return -EINVAL; } } Commit Message: xen/netback: shutdown the ring if it contains garbage. A buggy or malicious frontend should not be able to con...
0
8,442
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct posix_acl *gfs2_get_acl(struct inode *inode, int type) { struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_holder gh; bool need_unlock = false; struct posix_acl *acl; if (!gfs2_glock_is_locked_by_me(ip->i_gl)) { int ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); if...
0
13,167
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) { php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract; assert(ms != NULL); switch(whence) { case SEEK_CUR: if (offset < 0) { if (ms->fpos < (size_t)(-offset)) { ms->fpos =...
0
1,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { struct session_state *state = ssh->state; int len, r, ms_remain; fd_set *setp; char buf[8192]; struct timeval timeout, start, *timeoutp = NULL; DBG(debug("packet_read()")); setp = calloc(howmany(state->connection_in + 1, NFD...
0
11,867
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void sock_kfree_s(struct sock *sk, void *mem, int size) { kfree(mem); atomic_sub(size, &sk->sk_omem_alloc); } Commit Message: net: sock: validate data_len before allocating skb in sock_alloc_send_pskb() We need to validate the number of pages consumed by data_len, otherwise frags array could be overflowed by ...
0
29,277
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close) { #if (AVRC_CTLR_INCLUDED == TRUE) bt_bdaddr_t rc_addr; tBTA_AV_FEAT features; #endif BTIF_TRACE_DEBUG("%s: rc_handle: %d", __FUNCTION__, p_rc_close->rc_handle); if ((p_rc_close->rc_handle != btif_rc_cb.rc_handle) && (bdcmp(btif_rc_cb.rc_addr, p_...
0
4,725
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType IsITUFaxImage(const Image *image) { const StringInfo *profile; const unsigned char *datum; profile=GetImageProfile(image,"8bim"); if (profile == (const StringInfo *) NULL) return(MagickFalse); if (GetStringInfoLength(profile) < 5) return(MagickFalse); datum=G...
0
22,296
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: slot_show(struct md_rdev *rdev, char *page) { if (rdev->raid_disk < 0) return sprintf(page, "none\n"); else return sprintf(page, "%d\n", rdev->raid_disk); } Commit Message: md: use kzalloc() when bitmap is disabled In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a mdu_bitmap_file_t called...
0
16,813
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static HB_Error Load_ValueRecord( HB_ValueRecord* vr, HB_UShort format, HB_UInt base_offset, HB_Stream stream ) { HB_Error error; HB_UInt cur_offset, new_offset; if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT ) { if ( ACCESS_Frame( 2L ) ) return...
0
2,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool TabsRemoveFunction::RemoveTab(int tab_id, std::string* error) { Browser* browser = NULL; WebContents* contents = NULL; if (!GetTabById(tab_id, browser_context(), include_incognito_information(), &browser, nullptr, &contents, nullptr, error)) { return false; } if (!browser->wi...
0
10,230
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual ~SelfDeletingDelegate() {} Commit Message: Revert a workaround commit for a Use-After-Free crash. Revert a workaround commit r20158 for a Use-After-Free issue (http://crbug.com/244746) because a cleaner CL r207218 is landed. URLRequestContext does not inherit SupportsWeakPtr now. R=mmenke BUG=244746 ...
0
16,031
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DocumentThreadableLoader::setSerializedCachedMetadata(Resource*, const char* data, size_t size) { if (!m_actualRequest.isNull()) return; m_client->didReceiveCachedMetadata(data, size); } Commit Message: DocumentThreadableLoader: Add guards for sync notifyFinished() in setResource() In loadR...
0
5,936
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(snmp_get_valueretrieval) { if (zend_parse_parameters_none() == FAILURE) { RETURN_FALSE; } RETURN_LONG(SNMP_G(valueretrieval)); } Commit Message: CWE ID: CWE-416
0
29,969
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BrowserContextDestroyer::BrowserContextDestroyer( BrowserContext* context, const std::set<content::RenderProcessHost*>& hosts) : context_(context), pending_hosts_(0) { for (std::set<content::RenderProcessHost*>::iterator it = hosts.begin(); it != hosts.end(); ++it) { (*it)->AddObse...
1
6,021
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: 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]...
0
12,362
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req) { int err = req->rsk_ops->rtx_syn_ack(parent, req); if (!err) req->num_retrans++; return err; } Commit Message: dccp/tcp: do not inherit mc_list from parent syzkaller found a way to trigger double frees from ip_mc_drop_socket() It ...
0
21,358
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ChromeContentBrowserClient::IsBuiltinComponent( content::BrowserContext* browser_context, const url::Origin& origin) { #if BUILDFLAG(ENABLE_EXTENSIONS) return ChromeContentBrowserClientExtensionsPart::IsBuiltinComponent( browser_context, origin); #else return false; #endif } Commit Message...
0
12,219
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sp<InputWindowHandle> InputDispatcher::findTouchedWindowAtLocked(int32_t displayId, int32_t x, int32_t y) { size_t numWindows = mWindowHandles.size(); for (size_t i = 0; i < numWindows; i++) { sp<InputWindowHandle> windowHandle = mWindowHandles.itemAt(i); const InputWindowInfo* windowInfo = windowHand...
0
6,232
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_get_pCAL(png_structp png_ptr, png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params) { png_debug1(1, "in %s retrieval function", "pCAL"); if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) ...
0
3,973
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid) { struct zip *zip = (struct zip *)a->format->data; int64_t file_size, current_offset; const char *p; int i, tail; /* If someone has already bid more than 32, then avoid trashing the look-ahead buffers with a seek. */ if (best_bi...
0
710
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ProcXFixesShowCursor(ClientPtr client) { WindowPtr pWin; CursorHideCountPtr pChc; int rc; REQUEST(xXFixesShowCursorReq); REQUEST_SIZE_MATCH(xXFixesShowCursorReq); rc = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrA...
0
21,765
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int install_session_keyring_to_cred(struct cred *cred, struct key *keyring) { unsigned long flags; struct key *old; might_sleep(); /* create an empty session keyring */ if (!keyring) { flags = KEY_ALLOC_QUOTA_OVERRUN; if (cred->session_keyring) flags = KEY_ALLOC_IN_QUOTA; keyring = keyring_alloc(...
0
4,418
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AudioHandler::AudioHandler(NodeType node_type, AudioNode& node, float sample_rate) : is_initialized_(false), node_type_(kNodeTypeUnknown), node_(&node), context_(node.context()), last_processing_time_(-1), last_non_silent_time...
0
20,224
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BlobURLRequestJob::DidStart() { if (request()->method() != "GET") { NotifyFailure(net::ERR_METHOD_NOT_SUPPORTED); return; } if (!blob_data_) { NotifyFailure(net::ERR_FILE_NOT_FOUND); return; } CountSize(); } Commit Message: Avoid integer overflows in BlobURLRequestJob. BUG=169...
0
10,189
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline bool is_exception(u32 intr_info) { return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK)) == (INTR_TYPE_HARD_EXCEPTION | INTR_INFO_VALID_MASK); } Commit Message: kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF) When L2 exits to L0 due to "exception or NMI", ...
1
13,089
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static uint32_t vmsvga_index_read(void *opaque, uint32_t address) { struct vmsvga_state_s *s = opaque; return s->index; } Commit Message: CWE ID: CWE-787
0
7,016
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) { struct mm_struct *mm = vma->vm_mm; unsigned long old_start = vma->vm_start; unsigned long old_end = vma->vm_end; unsigned long length = old_end - old_start; unsigned long new_start = old_start - shift; unsigned long new_end = old_...
0
3,658
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LocalFrame* Document::GetFrameOfMasterDocument() const { if (frame_) return frame_; if (imports_controller_) return imports_controller_->Master()->GetFrame(); return nullptr; } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea34...
0
10,876
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(SplObjectStorage, valid) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS); } /* }}} */ /* {{{ proto mixed SplObjectStorage::key() Commi...
0
24,955
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AuthenticatorBlePowerOnManualSheetModel::OnBluetoothPoweredStateChanged() { dialog_model()->OnSheetModelDidChange(); } Commit Message: chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show ...
0
12,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int arcmsr_build_ccb(struct AdapterControlBlock *acb, struct CommandControlBlock *ccb, struct scsi_cmnd *pcmd) { struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&ccb->arcmsr_cdb; int8_t *psge = (int8_t *)&arcmsr_cdb->u; __le32 address_lo, address_hi; int arccdbsize = 0x30; __le32 length = 0; in...
0
7,627
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntRect Element::boundsInRootViewSpace() { document()->updateLayoutIgnorePendingStylesheets(); FrameView* view = document()->view(); if (!view) return IntRect(); Vector<FloatQuad> quads; if (isSVGElement() && renderer()) { SVGElement* svgElement = toSVGElement(this); ...
0
23,865
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: 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; ...
1
17,876
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: adjust_exit_policy_from_exitpolicy_failure(origin_circuit_t *circ, entry_connection_t *conn, node_t *node, const tor_addr_t *addr) { int make_reject_all = 0; const sa_family_t famil...
0
8,907
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int generic_pipe_buf_nosteal(struct pipe_inode_info *pipe, struct pipe_buffer *buf) { return 1; } Commit Message: ->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-based iov_iter covering those and feeds it ...
0
3,248
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iasecc_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr) { struct sc_context *ctx = card->ctx; struct iasecc_sdo *sdo = (struct iasecc_sdo *) ptr; switch (cmd) { case SC_CARDCTL_GET_SERIALNR: return iasecc_get_serialnr(card, (struct sc_serial_number *)ptr); case SC_CARDCTL_IASECC_SDO_CREATE: ...
0
4,280
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MiniTabAnimation(TabStripGtk* tabstrip, int index) : TabAnimation(tabstrip, MINI), index_(index) { int tab_count = tabstrip->GetTabCount(); int start_mini_count = tabstrip->GetMiniTabCount(); int end_mini_count = start_mini_count; if (tabstrip->GetTabAt(index)->mini()) start_...
0
9,847
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gpgsm_reset (void *engine) { engine_gpgsm_t gpgsm = engine; /* IF we have an active connection we must send a reset because we need to reset the list of signers. Note that RESET does not reset OPTION commands. */ return (gpgsm->assuan_ctx ? gpgsm_assuan_simple_command (gpgsm->assuan_ct...
0
21,580
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void IDNSpoofChecker::SetAllowedUnicodeSet(UErrorCode* status) { if (U_FAILURE(*status)) return; const icu::UnicodeSet* recommended_set = uspoof_getRecommendedUnicodeSet(status); icu::UnicodeSet allowed_set; allowed_set.addAll(*recommended_set); const icu::UnicodeSet* inclusion_set = uspoof_g...
1
22,809
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int jp2_putuint8(jas_stream_t *out, uint_fast8_t val) { if (jas_stream_putc(out, val & 0xff) == EOF) { return -1; } return 0; } Commit Message: Fixed bugs due to uninitialized data in the JP2 decoder. Also, added some comments marking I/O stream interfaces that probably need to be changed (in the lon...
0
29,808
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int is_white(int c) { return c == '\x00' || c == '\x09' || c == '\x0a' || c == '\x0c' || c == '\x0d' || c == '\x20'; } Commit Message: CWE ID: CWE-119
0
4,144
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gboolean BrowserWindowGtk::OnMainWindowDeleteEvent(GtkWidget* widget, GdkEvent* event) { Close(); return TRUE; } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumc...
0
12,089
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void nfc_llcp_exit(void) { nfc_llcp_sock_exit(); } Commit Message: net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails KASAN report this: BUG: KASAN: null-ptr-deref in nfc_llcp_build_gb+0x37f/0x540 [nfc] Read of size 3 at addr 0000000000000000 by task syz-executor.0/5401 CPU: 0 PID: 5401 Comm: syz-exe...
0
10,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DownloadItemImpl::NotifyRemoved() { for (auto& observer : observers_) observer.OnDownloadRemoved(this); } Commit Message: Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new dow...
0
18,410
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cmsPipeline* BlackPreservingKOnlyIntents(cmsContext ContextID, cmsUInt32Number nProfiles, cmsUInt32Number TheIntents[], cmsHPROFILE hProfiles[], ...
0
12,297
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void cma_query_handler(int status, struct ib_sa_path_rec *path_rec, void *context) { struct cma_work *work = context; struct rdma_route *route; route = &work->id->id.route; if (!status) { route->num_paths = 1; *route->path_rec = *path_rec; } else { work->old_state = RDMA_CM_ROUTE_QUER...
0
18,838
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void LocationWithPerWorldBindingsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::ToImpl(holder); V8SetReturnValueFast(info, WTF::GetPtr(impl->locationWithPerWorldBindings()), impl); } Commit Message: ...
0
6,962
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void addReplyStatusLength(client *c, const char *s, size_t len) { addReplyString(c,"+",1); addReplyString(c,s,len); addReplyString(c,"\r\n",2); } Commit Message: Security: Cross Protocol Scripting protection. This is an attempt at mitigating problems due to cross protocol scripting, an attack target...
0
7,176
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void XMLHttpRequest::send(const String& body, ExceptionState& es) { if (!initSend(es)) return; if (!body.isNull() && areMethodAndURLValidForSend()) { String contentType = getRequestHeader("Content-Type"); if (contentType.isEmpty()) { setRequestHeaderInternal("Content-T...
0
11,494
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int nl80211_dump_station(struct sk_buff *skb, struct netlink_callback *cb) { struct station_info sinfo; struct cfg80211_registered_device *dev; struct net_device *netdev; u8 mac_addr[ETH_ALEN]; int sta_idx = cb->args[1]; int err; err = nl80211_prepare_netdev_dump(skb, cb, &dev, &netdev); if (e...
0
19,467
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeContentBrowserClient::OverrideRequestContextForURL( const GURL& url, content::ResourceContext* context) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (url.SchemeIs(extensions::kExtensionScheme)) { ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); return io_d...
0
29,282
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct request *blk_peek_request(struct request_queue *q) { struct request *rq; int ret; lockdep_assert_held(q->queue_lock); WARN_ON_ONCE(q->mq_ops); while ((rq = elv_next_request(q)) != NULL) { if (!(rq->rq_flags & RQF_STARTED)) { /* * This is the first time the device driver * sees this requ...
0
3,211
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: freeBindings(XML_Parser parser, BINDING *bindings) { while (bindings) { BINDING *b = bindings; /* m_startNamespaceDeclHandler will have been called for this * binding in addBindings(), so call the end handler now. */ if (parser->m_endNamespaceDeclHandler) parser->m_endNamespaceDeclH...
0
26,433
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long Track::GetNumber() const { return m_info.number; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c83b4...
0
18,665
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AutoResetServer (int sig) { int olderrno = errno; dispatchException |= DE_RESET; isItTimeToYield = TRUE; errno = olderrno; } Commit Message: CWE ID: CWE-362
0
3,044
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void NaClProcessHost::Launch( ChromeRenderMessageFilter* chrome_render_message_filter, int socket_count, IPC::Message* reply_msg, scoped_refptr<ExtensionInfoMap> extension_info_map) { chrome_render_message_filter_ = chrome_render_message_filter; reply_msg_ = reply_msg; extension_info_map_ = ...
0
8,265
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct snd_rawmidi_substream *snd_usbmidi_find_substream(struct snd_usb_midi *umidi, int stream, int number) { struct snd_rawmidi_substream *substream; list_for_each_entry(substream, &umidi->rmidi->streams[stream].substreams, list) { if (substream->number == number) return su...
0
26,431
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct kern_ipc_perm *ipc_findkey(struct ipc_ids *ids, key_t key) { struct kern_ipc_perm *ipc; int next_id; int total; for (total = 0, next_id = 0; total < ids->in_use; next_id++) { ipc = idr_find(&ids->ipcs_idr, next_id); if (ipc == NULL) continue; if (ipc->key != key) { total++; con...
0
10,686
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int tcp_conn_request(struct request_sock_ops *rsk_ops, const struct tcp_request_sock_ops *af_ops, struct sock *sk, struct sk_buff *skb) { struct tcp_fastopen_cookie foc = { .len = -1 }; __u32 isn = TCP_SKB_CB(skb)->tcp_tw_isn; struct tcp_options_received tmp_opt; struct tcp_sock *tp = tcp_sk(sk)...
0
695
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const gfx::FontList& Textfield::GetDefaultFontList() { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); return rb.GetFontListWithDelta(ui::kLabelFontSizeDelta); } Commit Message: MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enable...
0
17,351
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize) { return ZSTD_CCtx_refPrefix_advanced(cctx, prefix, prefixSize, ZSTD_dct_rawContent); } Commit Message: fixed T36302429 CWE ID: CWE-362
0
21,328
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g) { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = NULL; uint64_t interval; // index entry time interval in 100 ns units, usually it's 1s uint32_t pkt_num, nb_entries; int32_t prev_pkt_n...
0
11,454
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void PDFiumEngine::OnMultipleClick(int click_count, int page_index, int char_index) { DCHECK_GE(click_count, 2); bool is_double_click = click_count == 2; int start_index = char_index; do { base::char16 cur = pages_[page_index]->Get...
0
10,979
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static OMX_ERRORTYPE subscribe_to_events(int fd) { OMX_ERRORTYPE eRet = OMX_ErrorNone; struct v4l2_event_subscription sub; int array_sz = sizeof(event_type)/sizeof(int); int i,rc; memset(&sub, 0, sizeof(sub)); if (fd < 0) { DEBUG_PRINT_ERROR("Invalid input: %d", fd); return OMX_ErrorBadParame...
0
17,680
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const char *register_access_checker_hook(cmd_parms *cmd, void *_cfg, const char *file, const char *function, const char *when) { int apr_hook_when = APR_HOOK_M...
0
168
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: tTcpIpPacketParsingResult ParaNdis_ReviewIPPacket(PVOID buffer, ULONG size, LPCSTR caller) { tTcpIpPacketParsingResult res = QualifyIpPacket((IPHeader *) buffer, size); PrintOutParsingResult(res, 1, caller); return res; } Commit Message: NetKVM: BZ#1169718: More rigoruous testing of incoming packet ...
0
10,773
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void LayerTreeHostImpl::SetManagedMemoryPolicy( const ManagedMemoryPolicy& policy) { if (cached_managed_memory_policy_ == policy) return; ManagedMemoryPolicy old_policy = ActualManagedMemoryPolicy(); cached_managed_memory_policy_ = policy; ManagedMemoryPolicy actual_policy = ActualManagedMemoryPo...
0
14,563
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: archive_acl_text_want_type(struct archive_acl *acl, int flags) { int want_type; /* Check if ACL is NFSv4 */ if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { /* NFSv4 should never mix with POSIX.1e */ if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) return (0); else return (ARC...
0
6,241
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void BackTexture::Create() { ScopedGLErrorSuppressor suppressor("BackTexture::Create", state_->GetErrorState()); Destroy(); glGenTextures(1, &id_); ScopedTextureBinder binder(state_, id_, GL_TEXTURE_2D); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEARES...
0
22,838
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline bool is_page_fault(u32 intr_info) { return is_exception_n(intr_info, PF_VECTOR); } Commit Message: kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF) When L2 exits to L0 due to "exception or NMI", software exceptions (#BP and #OF) for which L1 has requested an intercept should be ...
0
14,011
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int __init __weak arch_early_irq_init(void) { return 0; } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong p...
0
15,759
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void nested_vmx_abort(struct kvm_vcpu *vcpu, u32 indicator) { /* TODO: not to reset guest simply here. */ kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu); pr_warn("kvm: nested vmx abort, indicator %d\n", indicator); } Commit Message: KVM: x86: work around infinite loop in microcode when #AC is delivered ...
0
17,437
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ShaderManager::ShaderInfo* GetShaderInfo(GLuint client_id) { return shader_manager()->GetShaderInfo(client_id); } Commit Message: Revert "Revert 100494 - Fix bug in SimulateAttrib0.""" TEST=none BUG=95625 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7796016 git-svn-id: svn://sv...
0
8,699
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RList* MACH0_(mach_fields)(RBinFile *arch) { struct MACH0_(mach_header) *mh = MACH0_(get_hdr_from_bytes)(arch->buf); if (!mh) { return NULL; } RList *ret = r_list_new (); if (!ret) { return NULL; } ret->free = free; ut64 addr = 0; #define ROW(nam,siz,val,fmt) \ r_list_append (ret, r_bin_field_new (a...
0
478
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static PHP_MINIT_FUNCTION(libxml) { zend_class_entry ce; php_libxml_initialize(); REGISTER_LONG_CONSTANT("LIBXML_VERSION", LIBXML_VERSION, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("LIBXML_DOTTED_VERSION", LIBXML_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("LIBXM...
0
16,378
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RemoveTexture(GLuint client_id) { texture_manager()->RemoveTexture(client_id); } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, webgl conformance R=kbr@chromiu...
0
29,799
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GaiaCookieManagerService::Init() { cookie_changed_subscription_ = signin_client_->AddCookieChangedCallback( GaiaUrls::GetInstance()->google_url(), kGaiaCookieName, base::Bind(&GaiaCookieManagerService::OnCookieChanged, base::Unretained(this))); } Commit Message: Add data usage...
0
12,869
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int php_stream_temp_flush(php_stream *stream TSRMLS_DC) { php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract; assert(ts != NULL); return ts->innerstream ? php_stream_flush(ts->innerstream) : -1; } Commit Message: CWE ID: CWE-20
0
13,310
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SProcXvSelectVideoNotify(ClientPtr client) { REQUEST(xvSelectVideoNotifyReq); REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); swaps(&stuff->length); swapl(&stuff->drawable); return XvProcVector[xv_SelectVideoNotify] (client); } Commit Message: CWE ID: CWE-20
0
25,189
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void GLES2Implementation::BindVertexArrayOESHelper(GLuint array) { bool changed = false; if (vertex_array_object_manager_->BindVertexArray(array, &changed)) { if (changed) { helper_->BindVertexArrayOES(array); } } else { SetGLError(GL_INVALID_OPERATION, "glBindVertexArrayOES", ...
0
28,140
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void rb_init_page(struct buffer_data_page *bpage) { local_set(&bpage->commit, 0); } Commit Message: ring-buffer: Prevent overflow of size in ring_buffer_resize() If the size passed to ring_buffer_resize() is greater than MAX_LONG - BUF_PAGE_SIZE then the DIV_ROUND_UP() will return zero. Here's the deta...
0
9,143
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 ih264d_set_display_frame(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) { ivd_set_display_frame_ip_t *dec_disp_ip; ivd_set_display_frame_op_t *dec_disp_op; UWORD32 i; dec_struct_t * ps_dec = (dec_struct_t *)(dec_hdl->pv_codec_handle); dec_disp_ip = (ivd_set_display_frame_ip_t *)pv_api...
0
270
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Gfx::opSetFillColorN(Object args[], int numArgs) { GfxColor color; GfxPattern *pattern; int i; if (state->getFillColorSpace()->getMode() == csPattern) { if (numArgs > 1) { if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() || numArgs - 1 != ((GfxPatternColorSpace *)st...
0
6,646
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Part::registerJob(KJob* job) { if (!m_jobTracker) { m_jobTracker = new JobTracker(widget()); m_statusBarExtension->addStatusBarItem(m_jobTracker->widget(0), 0, true); m_jobTracker->widget(job)->show(); } m_jobTracker->registerJob(job); emit busy(); connect(job, &K...
0
6,994
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: COMPS_HSList * comps_mrtree_get(COMPS_MRTree * rt, const char * key) { COMPS_HSList * subnodes; COMPS_HSListItem * it = NULL; COMPS_MRTreeData * rtdata; unsigned int offset, len, x; char found, ended; len = strlen(key); offset = 0; subnodes = rt->subnodes; while (offset != len...
0
7,843
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void webkitWebViewBaseSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->size_allocate(widget, allocation); WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget); if (!gtk_widget_get_mapped(GTK_WIDGET(webViewBase)) && !webV...
0
15,758
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ikev1_hash_print(netdissect_options *ndo, u_char tpay _U_, const struct isakmp_gen *ext, u_int item_len _U_, const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { struct isakmp_gen e; ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_HASH))); ND_TCHECK(*ext); UNALI...
0
511
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: OVS_REQUIRES(ofproto_mutex) { struct ofputil_group_stats ogs; const struct ofproto *ofproto = group->ofproto; long long int now = time_msec(); int error; ogs.bucket_stats = xmalloc(group->n_buckets * sizeof *ogs.bucket_stats); /* Provider sets the packet and byte counts, we do the re...
0
21,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static spl_ptr_heap_element spl_ptr_heap_top(spl_ptr_heap *heap) { /* {{{ */ if (heap->count == 0) { return NULL; } return heap->elements[0]; } /* }}} */ Commit Message: CWE ID:
0
5,612
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SProcGetProperty(ClientPtr client) { REQUEST(xGetPropertyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetPropertyReq); swapl(&stuff->window); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->longOffset); swapl(&stuff->longLength); return ((*ProcVector[X_GetProper...
0
18,439
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t MediaPlayer::prepareAsync_l() { if ( (mPlayer != 0) && ( mCurrentState & (MEDIA_PLAYER_INITIALIZED | MEDIA_PLAYER_STOPPED) ) ) { if (mAudioAttributesParcel != NULL) { mPlayer->setParameter(KEY_PARAMETER_AUDIO_ATTRIBUTES, *mAudioAttributesParcel); } else { mPlayer->setAudioStrea...
0
13,356
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void returnDataCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { info.GetReturnValue().Set(info.Data()); } Commit Message: [DevTools] Copy objects from debugger context to inspected context properly. BUG=637594 Review-Url: https://codereview.chromium.org/2253643002 Cr-Commit-Position: refs/heads/...
0
27,112