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: static inline struct inode *orphan_list_entry(struct list_head *l) { return &list_entry(l, struct ext3_inode_info, i_orphan)->vfs_inode; } Commit Message: ext3: Fix format string issues ext3_msg() takes the printk prefix as the second parameter and the format string as the third parameter. Two callers of ext3_...
0
32,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 EBMLHeader::Init() { m_version = 1; m_readVersion = 1; m_maxIdLength = 4; m_maxSizeLength = 8; if (m_docType) { delete[] m_docType; m_docType = NULL; } m_docTypeVersion = 1; m_docTypeReadVersion = 1; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. ...
0
160,825
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: netdutils::Status XfrmController::flushInterfaces() { const auto& ifaces = InterfaceController::getIfaceNames(); RETURN_IF_NOT_OK(ifaces); const String8 ifPrefix8 = String8(INetd::IPSEC_INTERFACE_PREFIX().string()); for (const std::string& iface : ifaces.value()) { int status = 0; if (!iface.compare(0, ...
0
162,707
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 RenderFrameImpl::OnJavaScriptExecuteRequest( const base::string16& jscript, int id, bool notify_result) { TRACE_EVENT_INSTANT0("test_tracing", "OnJavaScriptExecuteRequest", TRACE_EVENT_SCOPE_THREAD); v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); v8::Local<...
0
123,163
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: point_set (mpi_point_t d, mpi_point_t s) { mpi_set (d->x, s->x); mpi_set (d->y, s->y); mpi_set (d->z, s->z); } Commit Message: CWE ID: CWE-200
0
13,072
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::GetVertexAttribiv(GLuint index, GLenum pname, GLint* params) { GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetVertexAttribiv(" << index << "...
0
141,054
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 vmx_exit(void) { #ifdef CONFIG_KEXEC_CORE RCU_INIT_POINTER(crash_vmclear_loaded_vmcss, NULL); synchronize_rcu(); #endif kvm_exit(); } Commit Message: KVM: x86: work around infinite loop in microcode when #AC is delivered It was found that a guest can DoS a host by triggering an infinite s...
0
42,745
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: IW_IMPL(void) iw_set_dither_type(struct iw_context *ctx, int channeltype, int f, int s) { if(channeltype>=0 && channeltype<IW_NUM_CHANNELTYPES) { ctx->ditherfamily_by_channeltype[channeltype] = f; ctx->dithersubtype_by_channeltype[channeltype] = s; } switch(channeltype) { case IW_CHANNELTYPE_ALL: ctx->...
0
64,989
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 KURL& DocumentLoader::unreachableURL() const { return m_substituteData.failingURL(); } Commit Message: Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id=112903 Source/WebCore: * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * ...
0
105,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: oparray_find(i_ctx_t *i_ctx_p) { long i; ref *ep; for (i = 0; (ep = ref_stack_index(&e_stack, i)) != 0; ++i) { if (r_is_estack_mark(ep) && (ep->value.opproc == oparray_cleanup || ep->value.opproc == oparray_no_cleanup) ) return ep; } re...
0
2,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: void HTMLFormElement::CopyNonAttributePropertiesFromElement( const Element& source) { was_demoted_ = static_cast<const HTMLFormElement&>(source).was_demoted_; HTMLElement::CopyNonAttributePropertiesFromElement(source); } Commit Message: Move user activation check to RemoteFrame::Navigate's callers. Curr...
0
152,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: static void option_export_pack_edges(const char *edges) { if (pack_edges) fclose(pack_edges); pack_edges = fopen(edges, "a"); if (!pack_edges) die_errno("Cannot open '%s'", edges); } Commit Message: prefer memcpy to strcpy When we already know the length of a string (e.g., because we just malloc'd to fit...
0
55,098
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: crypto_check_cert_eku(krb5_context context, pkinit_plg_crypto_context plgctx, pkinit_req_crypto_context reqctx, pkinit_identity_crypto_context idctx, int checking_kdc_cert, int allow_secondary_usage, ...
0
33,628
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_API void* ZEND_FASTCALL _emalloc_huge(size_t size) { ZEND_MM_CUSTOM_ALLOCATOR(size); return zend_mm_alloc_huge(AG(mm_heap), size); } Commit Message: Fix bug #72742 - memory allocator fails to realloc small block to large one CWE ID: CWE-190
0
50,152
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: rescaled_large_exists() const { return rescaled_large_exists_; } Commit Message: [reland] Do not set default wallpaper unless it should do so. TBR=bshe@chromium.org, alemate@chromium.org Bug: 751382 Change-Id: Id0793dfe467f737526a95b1e66ed01fbb8860bda Reviewed-on: https://chromium-review.googlesource.com...
0
128,101
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::OnDidDownloadImage( int id, int http_status_code, const GURL& image_url, int requested_size, const std::vector<SkBitmap>& bitmaps) { ImageDownloadMap::iterator iter = image_download_map_.find(id); if (iter == image_download_map_.end()) { return; } if (!iter->s...
0
111,596
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 Camera3Device::tearDown(int streamId) { ATRACE_CALL(); ALOGV("%s: Camera %d: Tearing down stream %d", __FUNCTION__, mId, streamId); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); if (mHal3Device->common.version < CAMERA_DEVICE_API_VERSION_3_2) { ALOGE("%s: Unable to tea...
0
161,106
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 HTMLMediaElement::LoadSourceFromAttribute() { load_state_ = kLoadingFromSrcAttr; const AtomicString& src_value = FastGetAttribute(srcAttr); if (src_value.IsEmpty()) { BLINK_MEDIA_LOG << "LoadSourceFromAttribute(" << (void*)this << "), empty 'src'"; MediaLoadingFailed(WebMed...
0
144,565
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: lzh_make_huffman_table(struct huffman *hf) { uint16_t *tbl; const unsigned char *bitlen; int bitptn[17], weight[17]; int i, maxbits = 0, ptn, tbl_size, w; int diffbits, len_avail; /* * Initialize bit patterns. */ ptn = 0; for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) { bitptn[i] = ptn; weight[i...
0
68,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 process_bin_update(conn *c) { char *key; int nkey; int vlen; item *it; protocol_binary_request_set* req = binary_get_request(c); assert(c != NULL); key = binary_get_key(c); nkey = c->binary_header.request.keylen; /* fix byteorder in the request */ req->messag...
0
18,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: bool PropertyAddedOrRemoved() const { return property_added_or_removed_; } Commit Message: Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit 887383b30842d9d9006e11bb6932660a3cb5b1b7. Reason for revert: Retry in M69. Original change's description: > Revert "[CI] Make paint property ...
0
125,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 RenderViewImpl::EvaluateScript(const string16& frame_xpath, const string16& jscript, int id, bool notify_result) { v8::HandleScope handle_scope; v8::Handle<v8::Value> result; WebFrame* web_frame ...
0
115,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: void BrowserPluginGuest::Terminate() { RecordAction(UserMetricsAction("BrowserPlugin.Guest.Terminate")); base::ProcessHandle process_handle = web_contents()->GetRenderProcessHost()->GetHandle(); base::KillProcess(process_handle, RESULT_CODE_KILLED, false); } Commit Message: Implement TextureImageTran...
0
114,427
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_Err paen_Size(GF_Box *s) { GF_Err e; FDPartitionEntryBox *ptr = (FDPartitionEntryBox *)s; if (ptr->blocks_and_symbols) { e = gf_isom_box_size((GF_Box *)ptr->blocks_and_symbols); if (e) return e; ptr->size += ptr->blocks_and_symbols->size; } if (ptr->FEC_symbol_locations) { e = gf_isom_box_size((G...
0
80,309
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: RestartTestJob(URLRequest* request, NetworkDelegate* network_delegate) : URLRequestTestJob(request, network_delegate, true) {} Commit Message: Tests were marked as Flaky. BUG=151811,151810 TBR=droger@chromium.org,shalev@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10968052 ...
0
102,268
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: cff_parse_multiple_master( CFF_Parser parser ) { CFF_FontRecDict dict = (CFF_FontRecDict)parser->object; FT_Error error; #ifdef FT_DEBUG_LEVEL_TRACE /* beautify tracing message */ if ( ft_trace_levels[FT_COMPONENT] < 4 ) FT_TRACE1(( "Multiple Master CFFs not supported yet," ...
0
13,245
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 RenderFrameHostImpl::MaybeGenerateCrashReport( base::TerminationStatus status) { if (!last_committed_url_.SchemeIsHTTPOrHTTPS()) return; if (!frame_tree_node_->IsMainFrame() && !IsCrossProcessSubframe()) return; std::string reason; switch (status) { case base::TERMINATION_STATUS_ABN...
0
153,107
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 php_wddx_pop_element(void *user_data, const XML_Char *name) { st_entry *ent1, *ent2; wddx_stack *stack = (wddx_stack *)user_data; HashTable *target_hash; zend_class_entry **pce; zval *obj; zval *tmp; TSRMLS_FETCH(); /* OBJECTS_FIXME */ if (stack->top == 0) { return; } if ...
1
166,949
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 write_data_page(struct dnode_of_data *dn, struct f2fs_io_info *fio) { struct f2fs_sb_info *sbi = fio->sbi; struct f2fs_summary sum; struct node_info ni; f2fs_bug_on(sbi, dn->data_blkaddr == NULL_ADDR); get_node_info(sbi, dn->nid, &ni); set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version); do_write...
0
86,034
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: mm_answer_pam_free_ctx(int sock, Buffer *m) { debug3("%s", __func__); (sshpam_device.free_ctx)(sshpam_ctxt); buffer_clear(m); mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m); auth_method = "keyboard-interactive"; auth_submethod = "pam"; return (sshpam_authok == sshpam_ctxt); } Commit Message...
1
166,584
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: CCITTFaxStream::CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA, GBool byteAlignA, int columnsA, int rowsA, GBool endOfBlockA, GBool blackA): FilterStream(strA) { encoding = encodingA; endOfLine = endOfLineA; byteAlign = byteAlignA; columns = columnsA; if (columns < ...
0
3,895
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: raptor_libxml_validation_error(void* user_data, const char *msg, ...) { va_list args; va_start(args, msg); raptor_libxml_error_common(user_data, msg, args, xml_validation_error_prefix, 1); va_end(args); } Commit Message: CVE-2012-0037 Enforce entity loading policy in rapt...
0
21,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 void PromiseAttributeAttributeSetter( v8::Local<v8::Value> v8_value, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); ALLOW_UNUSED_LOCAL(isolate); v8::Local<v8::Object> holder = info.Holder(); ALLOW_UNUSED_LOCAL(holder); TestObject* impl = V8TestO...
0
135,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 LayoutBlockFlow::layoutBlockChild(LayoutBox& child, MarginInfo& marginInfo, LayoutUnit& previousFloatLogicalBottom) { LayoutBlockFlow* childLayoutBlockFlow = child.isLayoutBlockFlow() ? toLayoutBlockFlow(&child) : nullptr; LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); LayoutUnit oldN...
0
123,004
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 p4_pmu_enable_all(int added) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); int idx; for (idx = 0; idx < x86_pmu.num_counters; idx++) { struct perf_event *event = cpuc->events[idx]; if (!test_bit(idx, cpuc->active_mask)) continue; p4_pmu_enable_event(event); } } Commit Me...
0
25,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 void netlink_mm_close(struct vm_area_struct *vma) { struct file *file = vma->vm_file; struct socket *sock = file->private_data; struct sock *sk = sock->sk; if (sk) atomic_dec(&nlk_sk(sk)->mapped); } Commit Message: net: rework recvmsg handler msg_name and msg_namelen logic This patch now always pa...
0
40,538
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 nfs4_wait_for_completion_rpc_task(struct rpc_task *task) { int ret; ret = rpc_wait_for_completion_task(task); return ret; } Commit Message: NFSv4: Convert the open and close ops to use fmode Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> CWE ID:
0
22,916
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 _check_var(pam_handle_t *pamh, VAR *var) { /* * Examine the variable and determine what action to take. * Returns DEFINE_VAR, UNDEFINE_VAR depending on action to take * or a PAM_* error code if passed back from other routines * * if no DEFAULT provided, the empty string is assumed *...
0
6,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: Tab* TabStrip::FindTabHitByPoint(const gfx::Point& point) { for (int i = 0; i < tab_count(); ++i) { Tab* tab = tab_at(i); if (!IsPointInTab(tab, point)) continue; Tab* next_tab = i < (tab_count() - 1) ? tab_at(i + 1) : nullptr; if (next_tab && (next_tab->IsActive() || (ne...
0
140,693
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 DXVAVideoDecodeAccelerator::StopOnError( media::VideoDecodeAccelerator::Error error) { DCHECK(CalledOnValidThread()); if (client_) client_->NotifyError(error); client_ = NULL; if (state_ != kUninitialized) { Invalidate(); } } Commit Message: Convert plugin and GPU process to brokered h...
0
106,950
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 Image *ReadCMYKImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *canvas_image, *image; MagickBooleanType status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType quantum_type; register ssize_t i; size_t length; ssize...
1
168,553
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_Err ohdr_dump(GF_Box *a, FILE * trace) { GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox *)a; gf_isom_box_dump_start(a, "OMADRMCommonHeaderBox", trace); fprintf(trace, "EncryptionMethod=\"%d\" PaddingScheme=\"%d\" PlaintextLength=\""LLD"\" ", ptr->EncryptionMethod, ptr->PaddingScheme, pt...
0
80,810
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 __unhash_process(struct task_struct *p) { nr_threads--; detach_pid(p, PIDTYPE_PID); if (thread_group_leader(p)) { detach_pid(p, PIDTYPE_PGID); detach_pid(p, PIDTYPE_SID); list_del_rcu(&p->tasks); __get_cpu_var(process_counts)--; } list_del_rcu(&p->thread_group); list_del_init(&p->siblin...
0
22,096
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: GDataRootDirectory::GDataRootDirectory() : ALLOW_THIS_IN_INITIALIZER_LIST(GDataDirectory(NULL, this)), fake_search_directory_(new GDataDirectory(NULL, NULL)), largest_changestamp_(0), serialized_size_(0) { title_ = kGDataRootDirectory; SetFileNameFromTitle(); } Commit Message: gdata: Defi...
1
170,777
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 pdf_destroy(struct pdf_doc *pdf) { if (pdf) { int i; for (i = 0; i < flexarray_size(&pdf->objects); i++) pdf_object_destroy(pdf_get_object(pdf, i)); flexarray_clear(&pdf->objects); free(pdf); } } Commit Message: jpeg: Fix another possible buffer overrun F...
0
83,007
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 rle_patch_file_size(struct iwbmpwcontext *wctx,size_t rlesize) { iw_byte buf[4]; size_t fileheader_size; int ret; if(!wctx->iodescr->seek_fn) { iw_set_error(wctx->ctx,"Writing compressed BMP requires a seek function"); return 0; } if(wctx->include_file_header) { ret=(*wctx->iodescr->seek_...
0
64,892
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: ExtensionDevToolsClientHost::~ExtensionDevToolsClientHost() { if (infobar_delegate_) { infobar_delegate_->ClearClientHost(); TabContentsWrapper* wrapper = TabContentsWrapper::GetCurrentWrapperForContents(web_contents_); InfoBarTabHelper* helper = wrapper->infobar_tab_helper(); if (helper...
0
108,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: void Location::setHostname(LocalDOMWindow* current_window, LocalDOMWindow* entered_window, const String& hostname, ExceptionState& exception_state) { KURL url = GetDocument()->Url(); url.SetHost(hostname); SetLocation(url.GetSt...
0
152,599
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: clear_fifo_list () { } Commit Message: CWE ID: CWE-20
0
9,289
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 au1200fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi) { volatile u32 *palette = lcd->palette; u32 value; if (regno > (AU1200_LCD_NBR_PALETTE_ENTRIES - 1)) return -EINVAL; if (fbi->var.grayscale) { /* Convert color to grayscal...
0
28,346
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 get_implied_cluster_alloc(struct super_block *sb, struct ext4_map_blocks *map, struct ext4_extent *ex, struct ext4_ext_path *path) { struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_lblk_t c_offset = map->m_lblk & (sbi->s_cluster_ratio-1); ext4_lblk_t ex_cluster_start, ex_clus...
0
18,605
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 bio_attempt_back_merge(struct request_queue *q, struct request *req, struct bio *bio) { const int ff = bio->bi_opf & REQ_FAILFAST_MASK; if (!ll_back_merge_fn(q, req, bio)) return false; trace_block_bio_backmerge(q, req, bio); if ((req->cmd_flags & REQ_FAILFAST_MASK) != ff) blk_rq_set_mixed_...
0
91,956
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 UDPSocketWin::SetMulticastLoopbackMode(bool loopback) { DCHECK(CalledOnValidThread()); if (is_connected()) return ERR_SOCKET_IS_CONNECTED; if (loopback) socket_options_ |= SOCKET_OPTION_MULTICAST_LOOP; else socket_options_ &= ~SOCKET_OPTION_MULTICAST_LOOP; return OK; } Commit Message: ...
0
113,461
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 mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFContext *mxf = arg; int item_num = avio_rb32(pb); int item_len = avio_rb32(pb); if (item_len != 18) { avpriv_request_sample(pb, "Primer pack item length %d", item_len); ...
0
74,846
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::string GetRawNondefaultId() { std::string id; BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( &AudioOutputAuthorizationHandlerTest::GetRawNondefaultIdOnIOThread, base::Unretained(this), base::Unretained(&id))); SyncWithAllThreads(); ...
0
128,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: void RenderFrameImpl::OnSwapOut( int proxy_routing_id, bool is_loading, const FrameReplicationState& replicated_frame_state) { TRACE_EVENT1("navigation,rail", "RenderFrameImpl::OnSwapOut", "id", routing_id_); SendUpdateState(); CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE); Ren...
0
139,781
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 SimpleBlock::Parse() { return m_block.Parse(m_pCluster); } 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: Id3e140e7b31ae11294724b1ecf...
0
160,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: void NavigatorImpl::DidNavigate( RenderFrameHostImpl* render_frame_host, const FrameHostMsg_DidCommitProvisionalLoad_Params& params, std::unique_ptr<NavigationHandleImpl> navigation_handle) { FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); bool oopifs_possible = SiteIso...
1
171,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: is_read_comp_null (gnutls_session_t session) { record_parameters_st *record_params; _gnutls_epoch_get (session, EPOCH_READ_CURRENT, &record_params); if (record_params->compression_algorithm == GNUTLS_COMP_NULL) return 0; return 1; } Commit Message: CWE ID: CWE-310
0
11,312
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 dm_sync_table(struct mapped_device *md) { synchronize_srcu(&md->io_barrier); synchronize_rcu_expedited(); } Commit Message: dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c...
0
85,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: pdf_dict_getp(fz_context *ctx, pdf_obj *obj, const char *keys) { char buf[256]; char *k, *e; RESOLVE(obj); if (!OBJ_IS_DICT(obj)) return NULL; if (strlen(keys)+1 > 256) fz_throw(ctx, FZ_ERROR_GENERIC, "path too long"); strcpy(buf, keys); e = buf; while (*e && obj) { k = e; while (*e != '/' && ...
0
13,889
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_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu) { if (!need_emulate_wbinvd(vcpu)) return X86EMUL_CONTINUE; if (kvm_x86_ops->has_wbinvd_exit()) { int cpu = get_cpu(); cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, wbinvd_ipi, NULL, 1); ...
0
57,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: void NavigateNamedFrame(const ToRenderFrameHost& caller_frame, const GURL& url, const std::string& name) { EXPECT_EQ(true, EvalJs(caller_frame, JsReplace("!!window.open($1, $2)", url, name))); } Commit Message: Add a check for disallowing...
0
143,863
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 llcp_sock_destruct(struct sock *sk) { struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); pr_debug("%p\n", sk); if (sk->sk_state == LLCP_CONNECTED) nfc_put_device(llcp_sock->dev); skb_queue_purge(&sk->sk_receive_queue); nfc_llcp_sock_free(llcp_sock); if (!sock_flag(sk, SOCK_DEAD)) { pr...
0
30,486
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 x509_get_ns_cert_type( unsigned char **p, const unsigned char *end, unsigned char *ns_cert_type) { int ret; mbedtls_x509_bitstring bs = { 0, 0, NULL }; if( ( ret = mbedtls_asn1_get_bitstring( p, end, &bs ) ) != 0...
0
61,934
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: resp_print(netdissect_options *ndo, const u_char *bp, u_int length) { int ret_len = 0, length_cur = length; if(!bp || length <= 0) return; ND_PRINT((ndo, ": RESP")); while (length_cur > 0) { /* * This block supports redis pipelining. * For example, multiple oper...
0
62,514
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 fpr_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { #ifdef CONFIG_VSX u64 buf[33]; int i; flush_fp_to_thread(target); for (i = 0; i < 32 ; i++) buf[i] = target->thread.TS_FPR(i); buf[...
0
84,784
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 enum test_return cache_destructor_test(void) { cache_t *cache = cache_create("test", sizeof(uint32_t), sizeof(char*), NULL, cache_destructor); assert(cache != NULL); char *ptr = cache_alloc(cache); cache_free(cache, ptr); cache_destroy(cache); retu...
0
94,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: Ins_SLOOP( TT_ExecContext exc, FT_Long* args ) { if ( args[0] < 0 ) exc->error = FT_THROW( Bad_Argument ); else exc->GS.loop = args[0]; } Commit Message: CWE ID: CWE-476
0
10,672
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 ChildThread::AcceptConnection( const mojo::String& service_name, mojo::ScopedMessagePipeHandle message_pipe) { NOTREACHED(); } Commit Message: [FileAPI] Clean up WebFileSystemImpl before Blink shutdown WebFileSystemImpl should not outlive V8 instance, since it may have references to V8. This CL e...
0
121,292
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 conn_worker_readd(conn *c) { c->ev_flags = EV_READ | EV_PERSIST; event_set(&c->event, c->sfd, c->ev_flags, event_handler, (void *)c); event_base_set(c->thread->base, &c->event); c->state = conn_new_cmd; if (event_add(&c->event, 0) == -1) { perror("event_add"); } } Commit Mes...
0
75,169
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: dns_run_resolution(struct dns_resolution *resolution) { struct dns_resolvers *resolvers = resolution->resolvers; int query_id, i; /* Avoid sending requests for resolutions that don't yet have an * hostname, ie resolutions linked to servers that do not yet have an * fqdn */ if (!resolution->hostname_dn) ...
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: static int handle_exception(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); struct kvm_run *kvm_run = vcpu->run; u32 intr_info, ex_no, error_code; unsigned long cr2, rip, dr6; u32 vect_info; enum emulation_result er; vect_info = vmx->idt_vectoring_info; intr_info = vmx->exit_intr_info; if...
0
53,312
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 compute_avg_bitrate(MOVTrack *track) { uint64_t size = 0; int i; if (!track->track_duration) return 0; for (i = 0; i < track->entry; i++) size += track->cluster[i].size; return size * 8 * track->timescale / track->track_duration; } Commit Message: avformat/move...
0
79,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: void RenderFrameHostImpl::SetUpMojoIfNeeded() { if (registry_.get()) return; associated_registry_ = std::make_unique<AssociatedInterfaceRegistryImpl>(); registry_ = std::make_unique<service_manager::BinderRegistry>(); auto make_binding = [](RenderFrameHostImpl* impl, mojom::...
0
156,008
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: AcpiNsBuildInternalName ( ACPI_NAMESTRING_INFO *Info) { UINT32 NumSegments = Info->NumSegments; char *InternalName = Info->InternalName; const char *ExternalName = Info->NextExternalChar; char *Result = NULL; UINT32 ...
0
95,287
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 kobject *floppy_find(dev_t dev, int *part, void *data) { int drive = (*part & 3) | ((*part & 0x80) >> 5); if (drive >= N_DRIVE || !floppy_available(drive)) return NULL; if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type)) return NULL; *part = 0; return get_disk_and_module(disks[drive]); } ...
0
88,828
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: validate_event(struct pmu_hw_events *hw_events, struct perf_event *event) { struct arm_pmu *armpmu = to_arm_pmu(event->pmu); struct hw_perf_event fake_event = event->hw; struct pmu *leader_pmu = event->group_leader->pmu; if (is_software_event(event)) return 1; if (event->pmu != leader_pmu...
1
167,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: char** lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup) { va_list ap2; size_t count = 1 + skip; char **result; /* first determine size of argument list, we don't want to reallocate * constantly... */ va_copy(ap2, ap); while (1) { char* arg = va_arg(ap2, char*); if (!arg) break; ...
0
44,697
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 FinishParseMediaMetadata( metadata::MediaMetadataParser* /* parser */, const extensions::api::media_galleries::MediaMetadata& metadata, const std::vector<metadata::AttachedImage>& attached_images) { Send(new ChromeUtilityHostMsg_ParseMediaMetadata_Finished( true, *metadata.ToValue(), atta...
0
123,768
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 SyncTest::ReadPasswordFile() { CommandLine* cl = CommandLine::ForCurrentProcess(); password_file_ = cl->GetSwitchValuePath(switches::kPasswordFileForTest); if (password_file_.empty()) LOG(FATAL) << "Can't run live server test without specifying --" << switches::kPasswordFileForTest <...
0
105,050
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 bpf_evict_inode(struct inode *inode) { enum bpf_type type; truncate_inode_pages_final(&inode->i_data); clear_inode(inode); if (!bpf_inode_type(inode, &type)) bpf_any_put(inode->i_private, type); } Commit Message: bpf: fix refcnt overflow On a system with >32Gbyte of phyiscal memory and infin...
0
53,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: parse_RESUBMIT(char *arg, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols OVS_UNUSED) { struct ofpact_resubmit *resubmit; char *in_port_s, *table_s; resubmit = ofpact_put_RESUBMIT(ofpacts); in_port_s = strsep(&arg, ","); if (in_port_s && in_port_s[0]) { ...
0
77,063
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_enable_share_one(const char *sharepath, const char *host, const char *security, const char *access, void *pcookie) { int rc; char *linuxhost, *hostpath, *opts; const char *linux_opts = (const char *)pcookie; char *argv[6]; /* exportfs -i -o sec=XX,rX,<opts> <host>:<sharepath> */ rc = get_linux_hos...
0
96,293
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 EAS_RESULT Parse_rgnh (SDLS_SYNTHESIZER_DATA *pDLSData, EAS_I32 pos, S_DLS_REGION *pRgn) { EAS_RESULT result; EAS_U16 lowKey; EAS_U16 highKey; EAS_U16 lowVel; EAS_U16 highVel; EAS_U16 optionFlags; EAS_U16 keyGroup; /* seek to start of chunk */ if ((result = EAS_HWFileSeek(pDL...
0
157,527
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 acct_clear_integrals(struct task_struct *tsk) { tsk->acct_stimexpd = 0; tsk->acct_rss_mem1 = 0; tsk->acct_vm_mem1 = 0; } Commit Message: [PATCH] xacct_add_tsk: fix pure theoretical ->mm use-after-free Paranoid fix. The task can free its ->mm after the 'if (p->mm)' check. Signed-off-by: Oleg Nesterov <o...
0
19,348
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 noinline int mmc_ioctl_dvd_auth(struct cdrom_device_info *cdi, void __user *arg) { int ret; dvd_authinfo ai; if (!CDROM_CAN(CDC_DVD)) return -ENOSYS; cd_dbg(CD_DO_IOCTL, "entering DVD_AUTH\n"); if (copy_from_user(&ai, (dvd_authinfo __user *)arg, sizeof(ai))) return -EFAULT; ret = dvd_d...
0
76,304
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: jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate) { jpc_ms_t *ms; jpc_mstabent_t *mstabent; jas_stream_t *tmpstream; if (!(ms = jpc_ms_create(0))) { return 0; } /* Get the marker type. */ if (jpc_getuint16(in, &ms->id) || ms->id < JPC_MS_MIN || ms->id > JPC_MS_MAX) { jpc_ms_destroy(ms); ...
0
72,983
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 open_pack_bitmap_1(struct packed_git *packfile) { int fd; struct stat st; char *idx_name; if (open_pack_index(packfile)) return -1; idx_name = pack_bitmap_filename(packfile); fd = git_open_noatime(idx_name); free(idx_name); if (fd < 0) return -1; if (fstat(fd, &st)) { close(fd); re...
0
54,934
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 _yr_scan_verify_literal_match( YR_SCAN_CONTEXT* context, YR_AC_MATCH* ac_match, uint8_t* data, size_t data_size, size_t data_base, size_t offset) { int flags = 0; int forward_matches = 0; CALLBACK_ARGS callback_args; YR_STRING* string = ac_match->string; if (STRING_FITS_IN_...
0
64,590
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: SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */ { zval **val = NULL; char *cafile = NULL; char *capath = NULL; char *certfile = NULL; char *cipherlist = NULL; int ok = 1; ERR_clear_error(); /* look at context options in the stream and set appropriate verification flag...
0
14,231