instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
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 BrowserPpapiHostImpl::AddInstanceObserver(PP_Instance instance, InstanceObserver* observer) { instance_map_[instance]->observer_list.AddObserver(observer); } Commit Message: Validate in-process plugin instance messages. Bug: 733548, 733549 Cq-Include-Trybot...
0
135,551
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 btpan_close_handle(btpan_conn_t *p) { BTIF_TRACE_DEBUG("btpan_close_handle : close handle %d", p->handle); p->handle = -1; p->local_role = -1; p->remote_role = -1; memset(&p->peer, 0, 6); } Commit Message: DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 288...
0
158,780
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 init_dequant_tables(H264Context *h) { int i, x; init_dequant4_coeff_table(h); if (h->pps.transform_8x8_mode) init_dequant8_coeff_table(h); if (h->sps.transform_bypass) { for (i = 0; i < 6; i++) for (x = 0; x < 16; x++) h->dequant4_coeff[i][0]...
0
28,256
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: std::unique_ptr<ImageProcessorClient> ImageProcessorClient::Create( const ImageProcessor::PortConfig& input_config, const ImageProcessor::PortConfig& output_config, size_t num_buffers, std::vector<std::unique_ptr<VideoFrameProcessor>> frame_processors) { auto ip_client = base::WrapUnique(n...
0
137,473
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 ext4_commit_super(struct super_block *sb, int sync) { struct ext4_super_block *es = EXT4_SB(sb)->s_es; struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; int error = 0; if (!sbh) return error; if (buffer_write_io_error(sbh)) { /* * Oh, dear. A previous attempt to write the * superblock fail...
0
57,564
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 ping_seq_open(struct inode *inode, struct file *file) { struct ping_seq_afinfo *afinfo = PDE_DATA(inode); return seq_open_net(inode, file, &afinfo->seq_ops, sizeof(struct ping_iter_state)); } Commit Message: ping: prevent NULL pointer dereference on write to msg_name A plain read() on a socke...
0
28,382
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 std::string& last_text() const { return last_text_; } Commit Message: Don't show current RenderWidgetHostView while interstitial is showing. Also moves interstitial page tracking from RenderFrameHostManager to WebContents, since interstitial pages are not frame-specific. This was necessary for subframes...
0
136,162
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 ChromeDownloadManagerDelegate::Shutdown() { download_history_.reset(); download_prefs_.reset(); } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic move...
0
106,026
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 StartMonitoringRequestsFor(const GURL& url) { request_url_ = url; saw_request_url_ = false; } Commit Message: Allow origin lock for WebUI pages. Returning true for WebUI pages in DoesSiteRequireDedicatedProcess helps to keep enforcing a SiteInstance swap during chrome://foo -> chrome://bar navi...
0
156,493
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 Document::childTypeAllowed(NodeType type) const { switch (type) { case ATTRIBUTE_NODE: case CDATA_SECTION_NODE: case DOCUMENT_FRAGMENT_NODE: case DOCUMENT_NODE: case ENTITY_NODE: case NOTATION_NODE: case TEXT_NODE: case XPATH_NAMESPACE_NODE: return false; case ...
0
102,639
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 PdfCompositorClient::Connect(service_manager::Connector* connector) { DCHECK(!compositor_.is_bound()); connector->BindInterface(mojom::kServiceName, &compositor_); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming ...
0
149,177
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 SparseHistogram::GetCountAndBucketData(Count* count, int64_t* sum, ListValue* buckets) const { } Commit Message: Convert DCHECKs to CHECKs for histogram types When a histogram is looked up by name, there is currently a ...
0
140,091
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: proc_map_files_instantiate(struct inode *dir, struct dentry *dentry, struct task_struct *task, const void *ptr) { fmode_t mode = (fmode_t)(unsigned long)ptr; struct proc_inode *ei; struct inode *inode; inode = proc_pid_make_inode(dir->i_sb, task); if (!inode) return -ENOENT; ei = PROC_I(inode); e...
0
49,426
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: TestURLFetcherFactory::TestURLFetcherFactory() {} Commit Message: Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to use an URLFetcher factory which will prevent ...
0
100,164
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 unsigned long get_unmapped_area_zero(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { #ifdef CONFIG_MMU if (flags & MAP_SHARED) { /* * mmap_zero() will call shmem_zero_setup() to create a file, * so use shmem's get_unmapped_area in case ...
0
66,875
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: IntSize WebPagePrivate::absoluteVisibleOverflowSize() const { if (!m_mainFrame->contentRenderer()) return IntSize(); return IntSize(m_mainFrame->contentRenderer()->rightAbsoluteVisibleOverflow(), m_mainFrame->contentRenderer()->bottomAbsoluteVisibleOverflow()); } Commit Message: [BlackBerry] Ada...
0
104,103
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: nvmet_fc_handle_ls_rqst_work(struct work_struct *work) { struct nvmet_fc_ls_iod *iod = container_of(work, struct nvmet_fc_ls_iod, work); struct nvmet_fc_tgtport *tgtport = iod->tgtport; nvmet_fc_handle_ls_rqst(tgtport, iod); } Commit Message: nvmet-fc: ensure target queue id within range. When searching f...
0
93,618
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 fpu_init(struct sh_fpu_soft_struct *fpu) { int i; fpu->fpscr = FPSCR_INIT; fpu->fpul = 0; for (i = 0; i < 16; i++) { fpu->fp_regs[i] = 0; fpu->xfp_regs[i]= 0; } } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could...
0
25,611
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: char *FLTGetIsLikeComparisonExpression(FilterEncodingNode *psFilterNode) { const size_t bufferSize = 1024; char szBuffer[1024]; char szTmp[256]; char *pszValue = NULL; const char *pszWild = NULL; const char *pszSingle = NULL; const char *pszEscape = NULL; int bCaseInsensitive = 0; int nLength...
1
168,399
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 tx3g_dump_rgba8(FILE * trace, char *name, u32 col) { fprintf(trace, "%s=\"%x %x %x %x\"", name, (col>>16)&0xFF, (col>>8)&0xFF, (col)&0xFF, (col>>24)&0xFF); } Commit Message: fixed 2 possible heap overflows (inc. #1088) CWE ID: CWE-125
0
80,896
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 handle_message(int sd) { struct ifsock *ifs; LIST_FOREACH(ifs, &il, link) { if (ifs->in != sd) continue; if (ifs->cb) ifs->cb(sd); } } Commit Message: Fix #1: Ensure recv buf is always NUL terminated Signed-off-by: Joachim Nilsson <troglobit@gmail.com> CWE ID: CWE-119
0
88,797
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 CSSStyleSheet::Trace(blink::Visitor* visitor) { visitor->Trace(contents_); visitor->Trace(owner_node_); visitor->Trace(owner_rule_); visitor->Trace(constructed_tree_scopes_); visitor->Trace(media_cssom_wrapper_); visitor->Trace(child_rule_cssom_wrappers_); visitor->Trace(rule_list_cssom_wrapper...
0
153,958
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 ChromeContentBrowserClient::WillCreateWebSocket( content::RenderFrameHost* frame, network::mojom::WebSocketRequest* request, network::mojom::AuthenticationHandlerPtr* auth_handler) { #if BUILDFLAG(ENABLE_EXTENSIONS) auto* web_request_api = extensions::BrowserContextKeyedAPIFactory<extensi...
0
152,399
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 ieee80211_remove_interfaces(struct ieee80211_local *local) { struct ieee80211_sub_if_data *sdata, *tmp; LIST_HEAD(unreg_list); ASSERT_RTNL(); mutex_lock(&local->iflist_mtx); list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { list_del(&sdata->list); unregister_netdevice_queue(sdata->...
0
24,333
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 bool is_session_dead(struct nfsd4_session *ses) { return ses->se_flags & NFS4_SESSION_DEAD; } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.1...
0
65,492
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: evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void)) { } Commit Message: evdns: fix searching empty hostnames From #332: Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly. ## Bug report The DNS code of Libevent contains this rather obvious O...
0
70,654
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 btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) { return __btrfs_set_acl(NULL, inode, acl, type); } Commit Message: posix_acl: Clear SGID bit when setting file permissions When file permissions are modified via chmod(2) and the user is not in the owning group or capable of CAP_FSETID, t...
0
50,316
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_FUNCTION(xmlwriter_start_dtd_attlist) { php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDAttlist, "Invalid Element Name"); } Commit Message: CWE ID: CWE-254
0
15,322
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 LayerTreeHost::DeleteUIResource(UIResourceId uid) { UIResourceClientMap::iterator iter = ui_resource_client_map_.find(uid); if (iter == ui_resource_client_map_.end()) return; UIResourceRequest request(UIResourceRequest::UIResourceDelete, uid); ui_resource_request_queue_.push_back(request); ui_...
0
111,963
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: connection_edge_consider_sending_sendme(edge_connection_t *conn) { circuit_t *circ; if (connection_outbuf_too_full(TO_CONN(conn))) return; circ = circuit_get_by_edge_conn(conn); if (!circ) { /* this can legitimately happen if the destroy has already * arrived and torn down the circuit */ ...
0
69,854
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: TestFieldTrialObserver() { FieldTrialList::AddObserver(this); } Commit Message: Convert ARRAYSIZE_UNSAFE -> arraysize in base/. R=thestig@chromium.org BUG=423134 Review URL: https://codereview.chromium.org/656033009 Cr-Commit-Position: refs/heads/master@{#299835} CWE ID: CWE-189
0
110,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 ContainerNode::attach() { attachChildren(); Node::attach(); } Commit Message: https://bugs.webkit.org/show_bug.cgi?id=93587 Node::replaceChild() can create bad DOM topology with MutationEvent, Part 2 Reviewed by Kent Tamura. Source/WebCore: This is a followup of r124156. replaceChild() has yet an...
0
98,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 inline void gen_scas(DisasContext *s, TCGMemOp ot) { gen_string_movl_A0_EDI(s); gen_op_ld_v(s, ot, cpu_T1, cpu_A0); gen_op(s, OP_CMPL, ot, R_EAX); gen_op_movl_T0_Dshift(ot); gen_op_add_reg_T0(s->aflag, R_EDI); } Commit Message: tcg/i386: Check the size of instruction being translated ...
0
66,401
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: net::RequestPriority DetermineRequestPriority( const ResourceHostMsg_Request& request_data) { switch (request_data.priority) { case WebKit::WebURLRequest::PriorityVeryHigh: return net::HIGHEST; case WebKit::WebURLRequest::PriorityHigh: return net::MEDIUM; case WebKit::WebURLRequest...
0
115,891
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 MSG_ReadData( msg_t *msg, void *data, int len ) { int i; for (i=0 ; i<len ; i++) { ((byte *)data)[i] = MSG_ReadByte (msg); } } Commit Message: Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Prevent reading past end of message in MSG_ReadBits. If read past end of msg->data buffer (16348 by...
0
63,147
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 WebURLLoaderImpl::Context::OnUploadProgress(uint64 position, uint64 size) { if (client_) client_->didSendData(loader_, position, size); } Commit Message: Protect WebURLLoaderImpl::Context while receiving responses. A client's didReceiveResponse can cancel a request; by protecting the Context we avoid...
0
113,067
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: std::unique_ptr<NavigationEntry> NavigationController::CreateNavigationEntry( const GURL& url, const Referrer& referrer, ui::PageTransition transition, bool is_renderer_initiated, const std::string& extra_headers, BrowserContext* browser_context) { GURL dest_url(url); BrowserURLHandler...
0
137,766
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 WebContentsImpl::UpdateTitle(RenderFrameHost* render_frame_host, const base::string16& title, base::i18n::TextDirection title_direction) { SetNotWaitingForResponse(); NavigationEntryImpl* entry = controller_.GetEntryWithUniqueID( ...
0
135,908
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: views::View* AutofillDialogViews::GetNotificationAreaForTesting() { return notification_area_; } Commit Message: Clear out some minor TODOs. BUG=none Review URL: https://codereview.chromium.org/1047063002 Cr-Commit-Position: refs/heads/master@{#322959} CWE ID: CWE-20
0
109,980
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 RenderWidgetHostImpl::DidUpdateVisualProperties( const cc::RenderFrameMetadata& metadata) { TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::DidUpdateVisualProperties"); DCHECK(!metadata.viewport_size_in_pixels.IsEmpty()); visual_properties_ack_pending_ = false; Notification...
0
145,436
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: json_to_recordset(PG_FUNCTION_ARGS) { return populate_recordset_worker(fcinfo, "json_to_recordset", false); } Commit Message: CWE ID: CWE-119
0
2,613
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 GLES2DecoderPassthroughImpl::BeginDecoding() { gpu_tracer_->BeginDecoding(); gpu_trace_commands_ = gpu_tracer_->IsTracing() && *gpu_decoder_category_; gpu_debug_commands_ = log_commands() || debug() || gpu_trace_commands_; } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the quer...
0
141,726
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 TabStrip::EndDrag(EndDragReason reason) { return drag_context_->EndDrag(reason); } Commit Message: Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group color. This treatment, along with the co...
0
140,688
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 Pack<WebGLImageConversion::kDataFormatRA8, WebGLImageConversion::kAlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixels_per_row) { #if defined(ARCH_CPU_X86_FAMILY) SIMD::PackOneRowOfRGBA8LittleTo...
0
146,667
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 DataPipeConsumerDispatcher::NotifyRead(uint32_t num_bytes) { DVLOG(1) << "Data pipe consumer " << pipe_id_ << " notifying peer: " << num_bytes << " bytes read. [control_port=" << control_port_.name() << "]"; SendDataPipeControlMessage(node_controller_, control_port_, ...
0
154,390
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: SoftAVCEncoder::SoftAVCEncoder( const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component) : SoftVideoEncoderOMXComponent( name, "video_encoder.avc", OMX_VIDEO_CodingAVC, kProfileLevels, NELEM(kProfileLevels), 176 /* wid...
0
163,939
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 cJSON_AddItemReferenceToObject( cJSON *object, const char *string, cJSON *item ) { cJSON_AddItemToObject( object, string, create_reference( item ) ); } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, p...
1
167,266
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 cmd_idle(char *tag) { int c = EOF; int flags; static struct buf arg; static int idle_period = -1; static time_t idle_timeout = -1; struct timespec deadline = { 0, 0 }; if (idle_timeout == -1) { idle_timeout = config_getint(IMAPOPT_IMAPIDLETIMEOUT); if (idle...
0
95,150
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: dict_threshold2_params(const ref * pdict, gs_threshold2_halftone * ptp, ref * ptproc, gs_memory_t *mem) { ref *tstring; int code = dict_threshold_common_params(pdict, (gs_threshold_halftone_common *)ptp, ...
0
13,927
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 AwContents::ShouldDownloadFavicon(const GURL& icon_url) { return g_should_download_favicons; } Commit Message: sync compositor: pass simple gfx types by const ref See bug for reasoning BUG=159273 Review URL: https://codereview.chromium.org/1417893006 Cr-Commit-Position: refs/heads/master@{#356653} CWE...
0
119,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: print_t_info(netdissect_options *ndo, int info) { int ntype = info & 3; switch (ntype) { case 0: ND_PRINT((ndo, "reserved-ntype? ")); break; case TI_L2ROUT: ND_PRINT((ndo, "l2rout ")); break; case TI_L1ROUT: ND_PRINT((ndo, "l1rout ")); break; case TI_ENDNODE: ND_PRINT((ndo, "endnode ")); break;...
0
95,108
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: templPush(xsltTransformContextPtr ctxt, xsltTemplatePtr value) { if (ctxt->templMax == 0) { ctxt->templMax = 4; ctxt->templTab = (xsltTemplatePtr *) xmlMalloc(ctxt->templMax * sizeof(ctxt->templTab[0])); if (ctxt->templTab == NULL) ...
0
156,803
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: CStarter::Continue( void ) { dprintf(D_ALWAYS, "Continuing all jobs.\n"); UserProc *job; m_job_list.Rewind(); while ((job = m_job_list.Next()) != NULL) { job->Continue(); } this->suspended = false; return ( true ); } Commit Message: CWE ID: CWE-134
0
16,385
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 get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie) { struct sighand_struct *sighand = current->sighand; struct signal_struct *signal = current->signal; int signr; relock: /* * We'll jump back here after any time we were stopped in TASK_STOPPED...
0
35,178
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 allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, block_t old_blkaddr, block_t *new_blkaddr, struct f2fs_summary *sum, int type, struct f2fs_io_info *fio, bool add_list) { struct sit_info *sit_i = SIT_I(sbi); struct curseg_info *curseg = CURSEG_I(sbi, type); mutex_lock(&curseg->curse...
0
85,360
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 FileBrowserPrivateGetDownloadUrlFunction::OnGetResourceEntry( drive::FileError error, scoped_ptr<drive::ResourceEntry> entry) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (error != drive::FILE_ERROR_OK) { SetError("Download Url for this item is not available."); SetResult(...
0
111,771
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 kvm_unmap_hva(struct kvm *kvm, unsigned long hva) { return kvm_handle_hva(kvm, hva, 0, kvm_unmap_rmapp); } Commit Message: nEPT: Nested INVEPT If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT table for L2 (i.e.,...
0
37,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: static void __exit dm_multipath_exit(void) { destroy_workqueue(kmpath_handlerd); destroy_workqueue(kmultipathd); dm_unregister_target(&multipath_target); kmem_cache_destroy(_mpio_cache); } Commit Message: dm: do not forward ioctls from logical volumes to the underlying device A logical volume can map to ju...
0
23,582
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 xmp_files_put_xmp(XmpFilePtr xf, XmpPtr xmp) { CHECK_PTR(xf, false); CHECK_PTR(xmp, false); RESET_ERROR; auto txf = reinterpret_cast<SXMPFiles *>(xf); try { txf->PutXMP(*reinterpret_cast<const SXMPMeta *>(xmp)); } catch (const XMP_Error &e) { set_error(e); ...
0
16,022
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 js_Ast *arrayelement(js_State *J) { if (J->lookahead == ',') return EXP0(UNDEF); return assignment(J, 0); } Commit Message: CWE ID: CWE-674
0
11,879
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: string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( const GURL& url, const string16& formatted_url) { if (!net::CanStripTrailingSlash(url)) return formatted_url; const string16 url_with_path(formatted_url + char16('/')); return (AutocompleteInput::Parse(formatted_url, string16(), N...
0
103,788
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: selCreateFromPta(PTA *pta, l_int32 cy, l_int32 cx, const char *name) { l_int32 i, n, x, y, w, h; BOX *box; SEL *sel; PROCNAME("selCreateFromPta"); if (!pta) return (SEL *)ERROR_PTR("pta not defined", procName, NULL); ...
0
84,210
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: getftp (struct url *u, wgint passed_expected_bytes, wgint *qtyread, wgint restval, ccon *con, int count, wgint *last_expected_bytes, FILE *warc_tmp) { int csock, dtsock, local_sock, res; uerr_t err = RETROK; /* appease the compiler */ FILE *fp; char *respline, *tms; const char...
1
164,574
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 cryp_cra_init(struct crypto_tfm *tfm) { struct cryp_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_alg *alg = tfm->__crt_alg; struct cryp_algo_template *cryp_alg = container_of(alg, struct cryp_algo_template, crypto); ctx->config.algomode = cryp_alg->algomode; ctx->blocksize = crypto_tfm_alg...
0
47,489
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 perf_swevent_start(struct perf_event *event, int flags) { event->hw.state = 0; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let t...
0
26,174
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 imapd_reset(void) { int i; int bytes_in = 0; int bytes_out = 0; proc_cleanup(); /* close backend connections */ i = 0; while (backend_cached && backend_cached[i]) { proxy_downserver(backend_cached[i]); if (backend_cached[i]->last_result.s) { fr...
0
95,221
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 HFSIterator::IsSymbolicLink() { if (IsDirectory()) return S_ISLNK(catalog_->current_record()->folder->bsdInfo.fileMode); else return S_ISLNK(catalog_->current_record()->file->bsdInfo.fileMode); } Commit Message: Add the SandboxedDMGParser and wire it up to the DownloadProtectionService. BUG=496...
0
123,801
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 squashfs_closedir(struct dir *dir) { free(dir->dirs); free(dir); } Commit Message: unsquashfs-4: Add more sanity checks + fix CVE-2015-4645/6 Add more filesystem table sanity checks to Unsquashfs-4 and also properly fix CVE-2015-4645 and CVE-2015-4646. The CVEs were raised due to Unsquashfs having varia...
0
74,306
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 __dev_remove_offload(struct packet_offload *po) { struct list_head *head = &offload_base; struct packet_offload *po1; spin_lock(&offload_lock); list_for_each_entry(po1, head, list) { if (po == po1) { list_del_rcu(&po->list); goto out; } } pr_warn("dev_remove_offload: %p not found\n"...
0
48,737
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_errata100(struct pt_regs *regs, unsigned long address) { #ifdef CONFIG_X86_64 if ((regs->cs == __USER32_CS || (regs->cs & (1<<2))) && (address >> 32)) return 1; #endif return 0; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated...
0
25,937
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 GpuProcessHost::OnAcceleratedSurfaceRelease( const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceRelease"); gfx::PluginWindowHandle handle = GpuSurfaceTracker::Get()->GetSurfaceWindowHandle(params.surface_id); if (!handle) { #...
0
114,448
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 zend_extension_activator(zend_extension *extension) /* {{{ */ { if (extension->activate) { extension->activate(); } } /* }}} */ Commit Message: Use format string CWE ID: CWE-134
0
57,323
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 AppCacheDatabase::InsertOnlineWhiteList( const OnlineWhiteListRecord* record) { if (!LazyOpen(kCreateIfNeeded)) return false; static const char kSql[] = "INSERT INTO OnlineWhiteLists (cache_id, namespace_url, is_pattern)" " VALUES (?, ?, ?)"; sql::Statement statement(db_->GetCach...
0
151,294
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: QuicStreamSequencerBuffer::FrameInfo::FrameInfo(size_t length, QuicTime timestamp) : length(length), timestamp(timestamp) {} Commit Message: Fix OOB Write in QuicStreamSequencerBuffer::OnStreamData BUG=778505 Cq-Include-Trybots: master.tryserver.chromium.andr...
0
150,171
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 struct mddev *mddev_get(struct mddev *mddev) { atomic_inc(&mddev->active); return mddev; } 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 "file". 5769 file = kmalloc(sizeof(*file), GFP...
0
42,489
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 ChromeRenderMessageFilter::OnMessageReceived(const IPC::Message& message, bool* message_was_ok) { bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(ChromeRenderMessageFilter, message, *message_was_ok) #if !defined(DISABLE_NACL) IPC_MESSAGE_HANDLER_DELAY_R...
1
170,812
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: nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) { struct nfs_find_desc desc = { .fh = fh, .fattr = fattr }; struct inode *inode = ERR_PTR(-ENOENT); unsigned long hash; if ((fattr->valid & NFS_ATTR_FATTR) == 0) goto out_no_inode; if (!fattr->nlink) { printk("NFS: Buggy...
0
22,791
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 tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) { struct tcp_extend_values tmp_ext; struct tcp_options_received tmp_opt; u8 *hash_location; struct request_sock *req; struct inet6_request_sock *treq; struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp = tcp_sk(sk); __u32 isn = TC...
0
25,217
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: unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable) { struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn); return gfn_to_hva_memslot_prot(slot, gfn, writable); } Commit Message: KVM: use after free in kvm_ioctl_create_device() We should move the ops->destroy(dev) after the list_del(...
0
71,177
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: std::vector<gfx::Size> ConvertToFaviconSizes( const blink::WebVector<blink::WebSize>& web_sizes) { std::vector<gfx::Size> result; result.reserve(web_sizes.size()); for (const blink::WebSize& web_size : web_sizes) result.push_back(gfx::Size(web_size)); return result; } Commit Message: Convert Fram...
0
139,547
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 first_nibble_is_4(RAnal* anal, RAnalOp* op, ut16 code){ switch (code & 0xF0FF) { case 0x4020: //shal op->type = R_ANAL_OP_TYPE_SAL; break; case 0x4021: //shar op->type = R_ANAL_OP_TYPE_SAR; break; case 0x4000: //shll case 0x4008: //shll2 case 0x4018: //shll8 case 0x4028: //shll16 op->t...
0
82,685
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: LayerTreeHost::InitParams::~InitParams() {} Commit Message: (Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 TBR=danakj@chromium.org, creis@ch...
0
137,200
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: ZEND_RESULT_CODE php_http_url_encode_hash_ex(HashTable *hash, php_http_buffer_t *qstr, const char *arg_sep_str, size_t arg_sep_len, const char *val_sep_str, size_t val_sep_len, const char *pre_encoded_str, size_t pre_encoded_len TSRMLS_DC) { if (pre_encoded_len && pre_encoded_str) { php_http_buffer_append(qstr...
0
73,839
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: more_files_callback (GObject *source_object, GAsyncResult *res, gpointer user_data) { DirectoryLoadState *state; NautilusDirectory *directory; GError *error; GList *files, *l; GFileInfo *info; state = user_data; if (state->directory...
0
60,951
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 usbhid_request(struct hid_device *hid, struct hid_report *rep, int reqtype) { switch (reqtype) { case HID_REQ_GET_REPORT: usbhid_submit_report(hid, rep, USB_DIR_IN); break; case HID_REQ_SET_REPORT: usbhid_submit_report(hid, rep, USB_DIR_OUT); break; } } Commit Message: HID: usbhid: fix ou...
0
59,832
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 __attribute__((__noreturn__)) Com_Error_f (void) { if ( Cmd_Argc() > 1 ) { Com_Error( ERR_DROP, "Testing drop error" ); } else { Com_Error( ERR_FATAL, "Testing fatal error" ); } } Commit Message: Merge some file writing extension checks from OpenJK. Thanks Ensiform. https://github.com/JACoder...
0
95,450
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 StrictModeTypeErrorFunction::destroy(JSCell* cell) { jsCast<StrictModeTypeErrorFunction*>(cell)->StrictModeTypeErrorFunction::~StrictModeTypeErrorFunction(); } Commit Message: [JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoff...
0
101,017
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 DownloadItemImplDelegate::ResumeInterruptedDownload( std::unique_ptr<DownloadUrlParameters> params, uint32_t id) {} 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...
0
146,405
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: WebContext* WebContext::FromBrowserContext(oxide::BrowserContext* context) { BrowserContextDelegate* delegate = static_cast<BrowserContextDelegate*>(context->GetDelegate()); if (!delegate) { return nullptr; } return delegate->context(); } Commit Message: CWE ID: CWE-20
1
165,411
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 mwifiex_uap_custom_ie_prepare(u8 *tlv, void *cmd_buf, u16 *ie_size) { struct mwifiex_ie_list *ap_ie = cmd_buf; struct mwifiex_ie_types_header *tlv_ie = (void *)tlv; if (!ap_ie || !ap_ie->len) return -1; *ie_size += le16_to_cpu(ap_ie->len) + sizeof(struct mwifiex_ie_types_header); tlv_ie->t...
0
88,624
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 Element::isUnresolvedCustomElement() { return isCustomElement() && document()->registry()->isUnresolved(this); } Commit Message: Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr:...
0
112,303
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 __init snd_compress_init(void) { return 0; } Commit Message: ALSA: compress: fix an integer overflow check I previously added an integer overflow check here but looking at it now, it's still buggy. The bug happens in snd_compr_allocate_buffer(). We multiply ".fragments" and ".fragment_size" and th...
0
58,103
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 OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) { OMX_PARAM_PORTDEFINITIONTYPE def; InitOMXParams(&def); def.nPortIndex = portIndex; status_t err = mOMX->getParameter( mNode, OMX_IndexParamPortDefinition, &def, sizeof(def)); CHECK_EQ(err, (status_t)OK); if ((portIndex...
0
158,197
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 kill_ioctx(struct mm_struct *mm, struct kioctx *ctx) { if (!atomic_xchg(&ctx->dead, 1)) { struct kioctx_table *table; spin_lock(&mm->ioctx_lock); rcu_read_lock(); table = rcu_dereference(mm->ioctx_table); WARN_ON(ctx != table->table[ctx->id]); table->table[ctx->id] = NULL; rcu_read_un...
0
40,100
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: otp_edata(krb5_context context, krb5_kdc_req *request, krb5_kdcpreauth_callbacks cb, krb5_kdcpreauth_rock rock, krb5_kdcpreauth_moddata moddata, krb5_preauthtype pa_type, krb5_kdcpreauth_edata_respond_fn respond, void *arg) { krb5_otp_tokeninfo ti, *tis[2] = { &ti, NULL }; kr...
0
43,827
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: httpd_close_conn( httpd_conn* hc, struct timeval* nowP ) { make_log_entry( hc, nowP ); if ( hc->file_address != (char*) 0 ) { mmc_unmap( hc->file_address, &(hc->sb), nowP ); hc->file_address = (char*) 0; } if ( hc->conn_fd >= 0 ) { (void) close( hc->conn_fd ); hc->conn_fd = -1; } } C...
0
63,807
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 dns_link_resolution(void *requester, int requester_type, int requester_locked) { struct dns_resolution *res = NULL; struct dns_requester *req; struct dns_resolvers *resolvers; struct server *srv = NULL; struct dns_srvrq *srvrq = NULL; char **hostname_dn; int hostname_dn_len, query_ty...
0
722
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 unsigned char* lodepng_chunk_data_const(const unsigned char* chunk) { return &chunk[8]; } Commit Message: Fixed #5645: realloc return handling CWE ID: CWE-772
0
87,509
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 double KernelBessel_Order1(double x) { double p, q; if (x == 0.0) return (0.0f); p = x; if (x < 0.0) x=(-x); if (x < 8.0) return (p*KernelBessel_J1(x)); q = (double)sqrt(2.0f/(M_PI*x))*(double)(KernelBessel_P1(x)*(1.0f/sqrt(2.0f)*(sin(x)-cos(x)))-8.0f/x*KernelBessel_Q1(x)* (-1.0f/sqrt(2.0f)*...
0
95,052
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 PaintLayerScrollableArea::SetHorizontalScrollbarVisualRect( const LayoutRect& rect) { horizontal_scrollbar_visual_rect_ = rect; if (Scrollbar* scrollbar = HorizontalScrollbar()) scrollbar->SetVisualRect(rect); } Commit Message: Always call UpdateCompositedScrollOffset, not just for the root laye...
0
130,129