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 int alloc_fresh_gigantic_page(struct hstate *h, nodemask_t *nodes_allowed) { return 0; } Commit Message: userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size This oops: kernel BUG at fs/hugetlbfs/inode.c:484! RIP: remove_inode_hugepages+0x3d0/0x410 Call Trace: ...
0
86,327
Analyze the following 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 OxideQQuickWebViewPrivate::setLocationBarMode( oxide::qt::LocationBarMode mode) { if (!proxy_) { construct_props_->location_bar_mode = mode; } else { proxy_->setLocationBarMode(mode); } } Commit Message: CWE ID: CWE-20
0
17,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: void StackTrace::Print() const { #if !defined(__UCLIBC__) PrintBacktraceOutputHandler handler; ProcessBacktrace(trace_, count_, &handler); #endif } Commit Message: Convert ARRAYSIZE_UNSAFE -> arraysize in base/. R=thestig@chromium.org BUG=423134 Review URL: https://codereview.chromium.org/656033009 Cr-Co...
0
110,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: gst_qtdemux_get_duration (GstQTDemux * qtdemux, gint64 * duration) { gboolean res = TRUE; *duration = GST_CLOCK_TIME_NONE; if (qtdemux->duration != 0) { if (qtdemux->duration != G_MAXINT32 && qtdemux->timescale != 0) { *duration = gst_util_uint64_scale (qtdemux->duration, GST_SECOND, q...
0
4,941
Analyze the following 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 VideoCaptureManager::GetPhotoState( int session_id, media::VideoCaptureDevice::GetPhotoStateCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); const VideoCaptureController* controller = LookupControllerBySessionId(session_id); if (!controller) return; if (controller->IsDe...
0
153,237
Analyze the following 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 int64_t get_server_clock(HTTPContext *c) { /* compute current pts value from system time */ return (cur_time - c->start_time) * 1000; } Commit Message: ffserver: Check chunk size Fixes out of array access Fixes: poc_ffserver.py Found-by: Paul Cher <paulcher@icloud.com> Signed-off-by: Michael Nie...
0
70,800
Analyze the following 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 block_device *bdgrab(struct block_device *bdev) { ihold(bdev->bd_inode); return bdev; } 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 to ->write_iter()...
0
46,252
Analyze the following 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 UrlmonUrlRequest::me() const { return base::StringPrintf(" id: %i Obj: %X ", id(), this); } Commit Message: iwyu: Include callback_old.h where appropriate, final. BUG=82098 TEST=none Review URL: http://codereview.chromium.org/7003003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85003 0039...
0
100,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: static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, struct msghdr *msg, size_t len) { struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct sock *sk = sock->sk; struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *addr = msg->msg_name; u32 dst_pid; u32 dst_group; struct sk_bu...
1
167,615
Analyze the following 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 BaseRenderingContext2D::strokeRect(double x, double y, double width, double height) { if (!ValidateRectForCanvas(x, y, width, height)) return; if (!DrawingCanvas()) return; ...
0
149,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: static void mergeWithNextTextNode(PassRefPtr<Node> node, ExceptionCode& ec) { ASSERT(node && node->isTextNode()); Node* next = node->nextSibling(); if (!next || !next->isTextNode()) return; RefPtr<Text> textNode = toText(node.get()); RefPtr<Text> textNext = toText(next); textN...
0
100,381
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PixelBufferWorkerPoolTaskImpl(internal::RasterWorkerPoolTask* task, uint8_t* buffer, const Reply& reply) : task_(task), buffer_(buffer), reply_(reply), needs_upload_(false) { } Commit Message: cc: Simplify raster ta...
0
112,818
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: get_minst_from_memory(const gs_memory_t *mem) { #ifdef PSI_INCLUDED extern gs_main_instance *ps_impl_get_minst( const gs_memory_t *mem ); return ps_impl_get_minst(mem); #else return (gs_main_instance*)mem->gs_lib_ctx->top_of_system; #endif } Commit Message: CWE ID: CWE-20
0
14,024
Analyze the following 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 FileManagerPrivateCustomBindings::GetFileSystem( const v8::FunctionCallbackInfo<v8::Value>& args) { DCHECK(args.Length() == 2); DCHECK(args[0]->IsString()); DCHECK(args[1]->IsString()); std::string name(*v8::String::Utf8Value(args[0])); std::string root_url(*v8::String::Utf8Value(args[1])); ...
0
156,425
Analyze the following 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 __die(const char *str, int err, struct pt_regs *regs) { struct task_struct *tsk = current; static int die_counter; int ret; printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP S_ISA "\n", str, err, ++die_counter); /* trap and error numbers are mostly meaningless on ARM */ r...
0
58,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: Browser::CreateParams::CreateParams(Type type, Profile* profile) : type(type), profile(profile), host_desktop_type(kDefaultHostDesktopType), app_type(APP_TYPE_HOST), initial_show_state(ui::SHOW_STATE_DEFAULT), is_session_restore(false), window(NULL) { } Commit Message: Rem...
0
117,761
Analyze the following 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 Document::ClearImportsController() { if (!Loader()) fetcher_->ClearContext(); imports_controller_ = nullptr; } Commit Message: Inherit CSP when we inherit the security origin This prevents attacks that use main window navigation to get out of the existing csp constraints such as the related bug Bu...
0
134,040
Analyze the following 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 test_sqr(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *c, *d, *e; int i, ret = 0; a = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); if (a == NULL || c == NULL || d == NULL || e == NULL) { goto err; } for (i = 0; i < num0; i++) { BN_bntest_rand(a, 40 + i * 10, ...
0
3,669
Analyze the following 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 PepperPlatformAudioInput::StartCapture() { DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); io_message_loop_proxy_->PostTask( FROM_HERE, base::Bind(&PepperPlatformAudioInput::StartCaptureOnIOThread, this)); } Commit Message: Pepper: Access PepperMediaDeviceManager through a WeakP...
0
119,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: int main(int argc, char* argv[]) { char* name = argv[0]; bool applyColorCorrection = false; #if USE(QCMSLIB) if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) applyColorCorrection = (--argc, ++argv, true); if (argc < 2) { fprintf(stderr, "Usage: %s [--color-correct] fil...
1
172,240
Analyze the following 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 Document::SetStateForNewFormElements(const Vector<String>& state_vector) { if (!state_vector.size() && !form_controller_) return; GetFormController().SetStateForNewFormElements(state_vector); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://c...
0
129,873
Analyze the following 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_content_desc(AVFormatContext *s, const GUIDParseTable *g) { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; int i; static const char *const titles[] = { "Title", "Author", "Copyright", "Description", "Rate" }; uint16_t len[5], buflen[5] = { 0 }; uint8_t *ch...
0
74,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: const Cluster* Segment::GetNext(const Cluster* pCurr) { assert(pCurr); assert(pCurr != &m_eos); assert(m_clusters); long idx = pCurr->m_index; if (idx >= 0) { assert(m_clusterCount > 0); assert(idx < m_clusterCount); assert(pCurr == m_clusters[idx]); ...
1
174,347
Analyze the following 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 netdev_queue *dev_ingress_queue_create(struct net_device *dev) { struct netdev_queue *queue = dev_ingress_queue(dev); #ifdef CONFIG_NET_CLS_ACT if (queue) return queue; queue = kzalloc(sizeof(*queue), GFP_KERNEL); if (!queue) return NULL; netdev_init_one_queue(dev, queue, NULL); queue->qdisc = &...
0
35,255
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebContents* GetActiveWebContents() { return browser()->tab_strip_model()->GetActiveWebContents(); } Commit Message: Connect the LocalDB to TabManager. Bug: 773382 Change-Id: Iec8fe5226ee175105d51f300f30b4865478ac099 Reviewed-on: https://chromium-review.googlesource.com/1118611 Commit-Queue: Sébastien M...
0
132,073
Analyze the following 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::Destroy() { if (image_) { DCHECK(texture_ref_); ScopedTextureBinder binder(&decoder_->state_, id(), Target()); DestroyNativeGpuMemoryBuffer(true); } if (texture_ref_) { ScopedGLErrorSuppressor suppressor("BackTexture::Destroy", decode...
0
145,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: error::Error GLES2DecoderImpl::HandleGetActiveUniformBlockiv( uint32_t immediate_data_size, const volatile void* cmd_data) { if (!feature_info_->IsWebGL2OrES3Context()) return error::kUnknownCommand; const volatile gles2::cmds::GetActiveUniformBlockiv& c = *static_cast<const volatile gles2::...
0
141,534
Analyze the following 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 nf_ct_frag6_sysctl_register(struct net *net) { struct ctl_table *table; struct ctl_table_header *hdr; table = nf_ct_frag6_sysctl_table; if (!net_eq(net, &init_net)) { table = kmemdup(table, sizeof(nf_ct_frag6_sysctl_table), GFP_KERNEL); if (table == NULL) goto err_alloc; table[0].dat...
0
47,990
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: init_user_id_from_FQN (const char * _fqn) { char * uid = NULL; char * domain = NULL; char * fqn = NULL; char default_uid [] = "nobody"; if (_fqn) { fqn = strdup (_fqn); uid = fqn; char * pAt = strchr (fqn, '@'); if (pAt) { *pAt='\0'; domain = pAt+1; } } if (uid ...
0
16,110
Analyze the following 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 modbus_mapping_free(modbus_mapping_t *mb_mapping) { if (mb_mapping == NULL) { return; } free(mb_mapping->tab_input_registers); free(mb_mapping->tab_registers); free(mb_mapping->tab_input_bits); free(mb_mapping->tab_bits); free(mb_mapping); } Commit Message: Fix VD-1301 a...
0
88,734
Analyze the following 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 _WM_do_control_dummy(struct _mdi *mdi, struct _event_data *data) { #ifdef DEBUG_MIDI uint8_t ch = data->channel; MIDI_EVENT_DEBUG(__FUNCTION__, ch, data->data.value); #else UNUSED(data); #endif UNUSED(mdi); } Commit Message: Add a new size parameter to _WM_SetupMidiEvent() so that it knows w...
0
63,235
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: decode_NXAST_RAW_SET_TUNNEL64(uint64_t tun_id, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { struct ofpact_tunnel *tunnel = ofpact_put_SET_TUNNEL(out); tunnel->ofpact.raw = NXAST_RAW_SET_TUNNEL64; tunnel->tun_id = tun_id; ...
0
76,815
Analyze the following 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 GlobalConfirmInfoBar::DelegateProxy::Cancel() { base::WeakPtr<GlobalConfirmInfoBar> info_bar = global_info_bar_; if (info_bar) { info_bar->OnInfoBarRemoved(info_bar_, false); info_bar->delegate_->Cancel(); } if (info_bar) info_bar->Close(); return true; } Commit Message: Allow to spe...
0
154,166
Analyze the following 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 paravirt_end_context_switch(struct task_struct *next) { BUG_ON(preemptible()); leave_lazy(PARAVIRT_LAZY_CPU); if (test_and_clear_ti_thread_flag(task_thread_info(next), TIF_LAZY_MMU_UPDATES)) arch_enter_lazy_mmu_mode(); } Commit Message: x86/paravirt: Fix spectre-v2 mitigations for paravirt guests Na...
0
79,059
Analyze the following 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 Document::initContentSecurityPolicy(PassRefPtr<ContentSecurityPolicy> csp) { setContentSecurityPolicy(csp ? csp : ContentSecurityPolicy::create()); if (m_frame && m_frame->tree().parent() && m_frame->tree().parent()->isLocalFrame()) { ContentSecurityPolicy* parentCSP = toLocalFrame(m_frame->t...
0
127,526
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ieee802_15_4_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; int hdrlen; uint16_t fc; uint8_t seq; if (caplen < 3) { ND_PRINT((ndo, "[|802.15.4] %x", caplen)); return caplen; } fc = EXTRACT_LE_16BITS(p); hd...
1
170,030
Analyze the following 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 ExtensionTabUtil::GetWindowIdOfTab(const WebContents* web_contents) { return SessionID::IdForWindowContainingTab(web_contents); } Commit Message: Do not pass URLs in onUpdated events to extensions unless they have the "tabs" permission. BUG=168442 Review URL: https://chromiumcodereview.appspot.com/11824...
0
116,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: static int do_wait_thread(struct wait_opts *wo, struct task_struct *tsk) { struct task_struct *p; list_for_each_entry(p, &tsk->children, sibling) { /* * Do not consider detached threads. */ if (!task_detached(p)) { int ret = wait_consider_task(wo, 0, p); if (ret) return ret; } } return...
0
94,327
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: queue_wildcard_initial_name_ops (FlatpakProxyClient *client, Header *header, Buffer *buffer) { GDBusMessage *decoded_message = g_dbus_message_new_from_blob (buffer->data, buffer->size, 0, NULL); GVariant *body, *arg0; if (decoded_message != NULL && header->type == G_DBUS_MESSAGE_TYPE_METHOD_RETURN &&...
0
84,422
Analyze the following 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 submit_flushes(struct work_struct *ws) { struct mddev *mddev = container_of(ws, struct mddev, flush_work); struct md_rdev *rdev; INIT_WORK(&mddev->flush_work, md_submit_flush_data); atomic_set(&mddev->flush_pending, 1); rcu_read_lock(); rdev_for_each_rcu(rdev, mddev) if (rdev->raid_disk >= 0 ...
0
42,545
Analyze the following 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 int convert_mode(long *msgtyp, int msgflg) { if (msgflg & MSG_COPY) return SEARCH_NUMBER; /* * find message of correct type. * msgtyp = 0 => get first. * msgtyp > 0 => get first message of matching type. * msgtyp < 0 => get message with least type must be < abs(msgtype). */ if (*m...
0
29,502
Analyze the following 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 FLTLayerApplyCondSQLFilterToLayer(FilterEncodingNode *psNode, mapObj *map, int iLayerIndex) { return FLTLayerApplyPlainFilterToLayer(psNode, map, iLayerIndex); } Commit Message: security fix (patch by EvenR) CWE ID: CWE-119
0
69,012
Analyze the following 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 WORD32 ihevcd_parse_vui_parameters(bitstrm_t *ps_bitstrm, vui_t *ps_vui, WORD32 sps_max_sub_layers_minus1) { WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; BITS_PARSE("aspect_ratio_info_present_flag", ps_vui->u1_aspect_ratio_info_present_flag, ps_bitstrm, 1...
0
162,637
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bootp_print(netdissect_options *ndo, register const u_char *cp, u_int length) { register const struct bootp *bp; static const u_char vm_cmu[4] = VM_CMU; static const u_char vm_rfc1048[4] = VM_RFC1048; bp = (const struct bootp *)cp; ND_TCHECK(bp->bp_op); ND_PRINT((ndo, "BOOTP/DHCP, %s", tok2str(bo...
1
170,027
Analyze the following 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 macvlan_link_register(struct rtnl_link_ops *ops) { /* common fields */ ops->priv_size = sizeof(struct macvlan_dev); ops->validate = macvlan_validate; ops->maxtype = IFLA_MACVLAN_MAX; ops->policy = macvlan_policy; ops->changelink = macvlan_changelink; ops->get_size = macvlan_get_size; ops->fill_i...
0
23,816
Analyze the following 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_thread_check_enabled_1(void) { const char *thread_check_str; if ((thread_check_str = getenv("NPW_THREAD_CHECK")) != NULL) return ((strcmp(thread_check_str, "yes") == 0) || (strcmp(thread_check_str, "1") == 0)); /* enable main-thread checks by default for all builds from snapshots */ ...
0
27,149
Analyze the following 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 BetterSniffMPEG4( const sp<DataSource> &source, String8 *mimeType, float *confidence, sp<AMessage> *meta) { static const off64_t kMaxScanOffset = 128ll; off64_t offset = 0ll; bool foundGoodFileType = false; off64_t moovAtomEndOffset = -1ll; bool done = false; while (!done && offset < ...
0
161,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: static void computeJD(DateTime *p){ int Y, M, D, A, B, X1, X2; if( p->validJD ) return; if( p->validYMD ){ Y = p->Y; M = p->M; D = p->D; }else{ Y = 2000; /* If no YMD specified, assume 2000-Jan-01 */ M = 1; D = 1; } if( Y<-4713 || Y>9999 || p->rawS ){ datetimeError(p); ...
0
136,434
Analyze the following 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 BrowserLauncherItemController::HasWindow(aura::Window* window) const { return window_ == window; } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium....
0
117,727
Analyze the following 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 sched_init_numa(void) { } Commit Message: Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <jannh@google.com>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap hand...
0
55,614
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLFormElement* HTMLFormControlElement::formOwner() const { return ListedElement::Form(); } Commit Message: autofocus: Fix a crash with an autofocus element in a document without browsing context. ShouldAutofocus() should check existence of the browsing context. Otherwise, doc.TopFrameOrigin() returns null. ...
0
136,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 HTMLAnchorElement::setRel(const AtomicString& value) { m_linkRelations = 0; SpaceSplitString newLinkRelations(value, SpaceSplitString::ShouldFoldCase); if (newLinkRelations.contains("noreferrer")) m_linkRelations |= RelationNoReferrer; if (newLinkRelations.contains("noopener")) ...
0
132,668
Analyze the following 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_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */ { php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC); php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC); if (MCG(fd[RANDOM]) > 0) { close(MCG(fd[RANDOM])); } if (MCG(fd[URANDOM]) > 0) { close(MCG(fd[URANDOM])); } UNREGISTER_INI_ENTRI...
0
51,374
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group) { return sys_fchownat(AT_FDCWD, filename, user, group, AT_SYMLINK_NOFOLLOW); } Commit Message: get rid of s_files and files_lock The only thing we need it for is alt-sysrq-r (emergency remount r/o) and these days we can do...
0
46,148
Analyze the following 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_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) { bool pr = false; u32 msr = msr_info->index; u64 data = msr_info->data; switch (msr) { case MSR_AMD64_NB_CFG: case MSR_IA32_UCODE_REV: case MSR_IA32_UCODE_WRITE: case MSR_VM_HSAVE_PA: case MSR_AMD64_PATCH_LOADER: case MSR_AMD64_B...
0
57,754
Analyze the following 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 __forceinline void prep_huffman(vorb *f) { if (f->valid_bits <= 24) { if (f->valid_bits == 0) f->acc = 0; do { int z; if (f->last_seg && !f->bytes_in_seg) return; z = get8_packet_raw(f); if (z == EOP) return; f->acc += (unsigned) z << f->valid_bit...
0
75,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: vcard_response_new_data(unsigned char *buf, int len) { VCardResponse *new_response; new_response = g_new(VCardResponse, 1); new_response->b_data = g_malloc(len + 2); memcpy(new_response->b_data, buf, len); new_response->b_total_len = len+2; new_response->b_len = len; new_response->b_t...
0
8,746
Analyze the following 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 ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); struct net_device *dev = dst->dev; struct neighbour *neigh; struct in6_addr *nexthop; int ret; skb->protocol = htons(ETH_P_IPV6); skb->dev = dev; if (ipv6_addr_is_multicast(&ipv6_...
0
64,633
Analyze the following 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_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size) { png_structp png_ptr = *ptr_ptr; #ifdef PNG_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to save current jump buffer */ #endif int i = 0; if (png_ptr == NULL) return; do { if (user_png_ver...
1
172,190
Analyze the following 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 re_yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yylineno; } Commit Message: re_lexer: Make reading escape sequences more robust (#586) * Add test for issue #503 * re_lexer: Make r...
1
168,484
Analyze the following 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 u64 __update_clear_spte_slow(u64 *sptep, u64 spte) { union split_spte *ssptep, sspte, orig; ssptep = (union split_spte *)sptep; sspte = (union split_spte)spte; /* xchg acts as a barrier before the setting of the high bits */ orig.spte_low = xchg(&ssptep->spte_low, sspte.spte_low); orig.spte_high = ...
0
37,398
Analyze the following 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 jp2_box_destroy(jp2_box_t *box) { if (box->ops->destroy) { (*box->ops->destroy)(box); } jas_free(box); } 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 long term) to fix integer ov...
0
67,945
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: b64reverse(char letter) { if ((letter >= 'A') && (letter <= 'Z')) { return letter - 'A'; } if ((letter >= 'a') && (letter <= 'z')) { return letter - 'a' + 26; } if ((letter >= '0') && (letter <= '9')) { return letter - '0' + 52; } if (letter == '+') { return 62; } if (letter == '/') { return 63...
0
81,626
Analyze the following 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 randomize(pam_handle_t *pamh, unsigned char *r, unsigned int r_len) { int ok = 0; int fd = open("/dev/urandom", O_RDONLY); if (0 <= fd && read(fd, r, r_len) == (ssize_t)r_len) { ok = 1; } else { pam_syslog(pamh, LOG_CRIT, "Error reading from /dev/urandom: %s", strerror(errno)); } if (0 <=...
0
87,902
Analyze the following 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 test_mem_cgroup_node_reclaimable(struct mem_cgroup *memcg, int nid, bool noswap) { if (mem_cgroup_node_nr_lru_pages(memcg, nid, LRU_ALL_FILE)) return true; if (noswap || !total_swap_pages) return false; if (mem_cgroup_node_nr_lru_pages(memcg, nid, LRU_ALL_ANON)) return true; return false; ...
0
21,181
Analyze the following 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 cbc3_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct des3_ede_sparc64_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); struct blkcipher_walk walk; const u64 *K; int err; blkcipher_walk_init(&walk, dst, src, nbytes); err = blkc...
0
46,762
Analyze the following 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 arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb) { uint32_t index; uint32_t flag_ccb; struct MessageUnit_B *reg = acb->pmuB; struct ARCMSR_CDB *pARCMSR_CDB; struct CommandControlBlock *pCCB; bool error; index = reg->doneq_index; while ((flag_ccb = reg->done_qbuffer[index]) != 0) { ...
0
49,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 NEVER_INLINE FreeList::ZapFreedMemory(Address address, size_t size) { for (size_t i = 0; i < size; i++) { if (address[i] != kReuseAllowedZapValue) address[i] = kReuseForbiddenZapValue; } } Commit Message: [oilpan] Fix GCInfoTable for multiple threads Previously, grow and access from different...
0
153,761
Analyze the following 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 SSL_set_session(SSL *s, SSL_SESSION *session) { int ret = 0; const SSL_METHOD *meth; if (session != NULL) { meth = s->ctx->method->get_ssl_method(session->ssl_version); if (meth == NULL) meth = s->method->get_ssl_method(session->ssl_version); if (meth == NULL) ...
0
44,214
Analyze the following 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 TEE_Result tee_svc_cryp_obj_populate_type( struct tee_obj *o, const struct tee_cryp_obj_type_props *type_props, const TEE_Attribute *attrs, uint32_t attr_count) { TEE_Result res; uint32_t have_attrs = 0; size_t obj_size = 0; size_t n; int idx; const struct attr_ops *ops; void *attr; for (n...
0
86,893
Analyze the following 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 sysctl_schedstats(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; int err; int state = static_branch_likely(&sched_schedstats); if (write && !capable(CAP_SYS_ADMIN)) return -EPERM; t = *table; t.data = &state; err = proc_dointvec_minmax...
0
55,662
Analyze the following 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 locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); TestObjectPythonV8Internal::locationWithPerWorldBindingsAttributeGetterForMainWorld(info); TRACE_E...
0
122,380
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebView* RenderViewImpl::createView( WebFrame* creator, const WebURLRequest& request, const WebWindowFeatures& features, const WebString& frame_name, WebNavigationPolicy policy) { if (shared_popup_counter_->data > kMaximumNumberOfUnacknowledgedPopups) return NULL; ViewHostMsg_CreateWi...
0
115,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: file_free (File *file) { if (file) { XFREE (file->name); XFREE (file->data); XFREE (file->mime_type); XFREE (file->content_id); XFREE (file->path); memset (file, '\0', sizeof (File)); } } Commit Message: Check types to avoid invalid reads/writes. CWE ID: CWE-125
0
68,234
Analyze the following 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 asf_reset_header(AVFormatContext *s) { ASFContext *asf = s->priv_data; ASFStream *asf_st; int i; asf->packet_size_left = 0; asf->packet_flags = 0; asf->packet_property = 0; asf->packet_timestamp = 0; asf->packet_segsizetype = 0; asf->pac...
0
61,364
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: V8ProfilerAgentImpl* profilerAgent() { if (V8InspectorSessionImpl* session = currentSession()) { if (session && session->profilerAgent()->enabled()) return session->profilerAgent(); } return nullptr; } Commit Message: [DevTools] Copy objects from de...
0
130,325
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { struct file *filp = iocb->ki_filp; ssize_t retval; unsigned long seg; size_t count; loff_t *ppos = &iocb->ki_pos; count = 0; retval = generic_segment_checks(iov, &nr_segs, &count, VERIFY_WRITE); if (...
0
58,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: free_regex_ext(RegexExt* ext) { if (IS_NOT_NULL(ext)) { if (IS_NOT_NULL(ext->pattern)) xfree((void* )ext->pattern); #ifdef USE_CALLOUT if (IS_NOT_NULL(ext->tag_table)) onig_callout_tag_table_free(ext->tag_table); if (IS_NOT_NULL(ext->callout_list)) onig_free_reg_callout_list(ext-...
0
89,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: zend_function *spl_filesystem_object_get_method_check(zval **object_ptr, char *method, int method_len, const struct _zend_literal *key TSRMLS_DC) /* {{{ */ { spl_filesystem_object *fsobj = zend_object_store_get_object(*object_ptr TSRMLS_CC); if (fsobj->u.dir.entry.d_name[0] == '\0' && fsobj->orig_path == NU...
1
167,085
Analyze the following 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 write_to_fifo(AVFifoBuffer *fifo, AVFrame *buf) { int ret; if (!av_fifo_space(fifo) && (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo)))) { av_frame_free(&buf); return ret; } av_fifo_generic_write(fifo, &buf, sizeof(buf), NULL); return 0; } Commit Messa...
0
28,045
Analyze the following 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 RenderFrameHostManager::IsCurrentlySameSite(RenderFrameHostImpl* candidate, const GURL& dest_url) { BrowserContext* browser_context = delegate_->GetControllerForRenderManager().GetBrowserContext(); bool src_has_effective_url = SiteInstanceImpl::HasEf...
0
154,482
Analyze the following 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_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_charp units, png_charpp params) { #ifdef PNG_USE_LOCAL_ARRAYS PNG_pCAL; #endif png_size_t purpose_len, units_len, total_len; png_uint_32p params_len; png_byte buf[10]; png_charp new_pu...
0
131,465
Analyze the following 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 qemu_fdt_setprop_phandle(void *fdt, const char *node_path, const char *property, const char *target_node_path) { uint32_t phandle = qemu_fdt_get_phandle(fdt, target_node_path); return qemu_fdt_setprop_cell(fdt, node_path, property, phandle); } ...
0
13,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: bool SessionCrashedInfoBarDelegate::Accept() { uint32 behavior = 0; Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); if (browser && browser->tab_count() == 1 && browser->GetWebContentsAt(0)->GetURL() == GURL(chrome::kChromeUINewTabURL)) { behavior = SessionRestore::CLOBBER...
0
109,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: fbFetchPixel_g1 (const FbBits *bits, int offset, miIndexedPtr indexed) { CARD32 pixel = ((CARD32 *)bits)[offset >> 5]; CARD32 a; #if BITMAP_BIT_ORDER == MSBFirst a = pixel >> (0x1f - (offset & 0x1f)); #else a = pixel >> (offset & 0x1f); #endif a = a & 1; return indexed->rgba[a]; } Commit ...
0
11,422
Analyze the following 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 omx_venc::dev_get_buf_req(OMX_U32 *min_buff_count, OMX_U32 *actual_buff_count, OMX_U32 *buff_size, OMX_U32 port) { return handle->venc_get_buf_req(min_buff_count, actual_buff_count, buff_size, port); } Commit Message: DO NOT MERGE mm-video-v4l2: ...
0
159,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: AlarmManager* ExtensionSystemImpl::alarm_manager() { return alarm_manager_.get(); } Commit Message: Check prefs before allowing extension file access in the permissions API. R=mpcomplete@chromium.org BUG=169632 Review URL: https://chromiumcodereview.appspot.com/11884008 git-svn-id: svn://svn.chromium.org/...
0
115,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: char *get_revision_mark(const struct rev_info *revs, const struct commit *commit) { if (commit->object.flags & BOUNDARY) return "-"; else if (commit->object.flags & UNINTERESTING) return "^"; else if (commit->object.flags & PATCHSAME) return "="; else if (!revs || revs->left_right) { if (commit->objec...
0
54,998
Analyze the following 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 ssl3_write_pending(SSL *s, int type, const unsigned char *buf, unsigned int len) { int i; SSL3_BUFFER *wb = &(s->s3->wbuf); /* XXXX */ if ((s->s3->wpend_tot > (int)len) || ((s->s3->wpend_buf != buf) && !(s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER)) ...
0
6,191
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofproto_reconnect_controllers(struct ofproto *ofproto) { connmgr_reconnect(ofproto->connmgr); } Commit Message: ofproto: Fix OVS crash when reverting old flows in bundle commit During bundle commit flows which are added in bundle are applied to ofproto in-order. In case if a flow cannot be added (e.g. flow ...
0
77,371
Analyze the following 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 LockContentsView::UpdateAuthForPublicAccount( LoginPublicAccountUserView* opt_to_update, LoginPublicAccountUserView* opt_to_hide, bool animate) { if (opt_to_update) opt_to_update->SetAuthEnabled(true /*enabled*/, animate); if (opt_to_hide) opt_to_hide->SetAuthEnabled(false /*enabled*/...
0
131,549
Analyze the following 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 netdev_init_one_queue(struct net_device *dev, struct netdev_queue *queue, void *_unused) { queue->dev = dev; } Commit Message: veth: Dont kfree_skb() after dev_forward_skb() In case of congestion, netif_rx() frees the skb, so we must assume dev_forward_skb() also consume skb. Bug intro...
0
32,192
Analyze the following 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 OnRegistryKeyChanged() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (--registry_watcher_count_ == 0) { UMA_HISTOGRAM_MEDIUM_TIMES( "DefaultBrowser.SettingsInteraction.RegistryWatcherDuration", base::TimeTicks::Now() - start_time_); ConcludeInteraction(Co...
0
144,677
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: hfs_checked_read_random(TSK_FS_INFO * fs, char *buf, size_t len, TSK_OFF_T offs) { ssize_t r; r = tsk_fs_read(fs, offs, buf, len); if (r != (ssize_t) len) { if (r >= 0) { tsk_error_reset(); tsk_error_set_errno(TSK_ERR_FS_READ); } return 1; } ...
0
75,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 void ReflectLongAttributeAttributeSetter( 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 = V8T...
0
135,083
Analyze the following 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 *am_extract_query_parameter(apr_pool_t *pool, const char *query_string, const char *name) { const char *ip; const char *value_end; apr_size_t namelen; if (query_string == NULL) { return NULL; } ip = query_stri...
0
91,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: static void pharobj_set_compression(HashTable *manifest, php_uint32 compress) /* {{{ */ { zend_hash_apply_with_argument(manifest, phar_set_compression, &compress); } /* }}} */ Commit Message: CWE ID: CWE-20
0
11,194
Analyze the following 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 RenderThread::DoNotSuspendWebKitSharedTimer() { suspend_webkit_shared_timer_ = false; } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-...
0
98,872
Analyze the following 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 FetchManager::Loader::DidReceiveRedirectTo(const KURL& url) { url_list_.push_back(url); } Commit Message: [Fetch API] Fix redirect leak on "no-cors" requests The spec issue is now fixed, and this CL follows the spec change[1]. 1: https://github.com/whatwg/fetch/commit/14858d3e9402285a7ff3b5e47a22896ff3a...
0
154,225
Analyze the following 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 insert_cert( sc_pkcs15_card_t *p15card, const char *path, unsigned char id, int writable, const char *label ){ sc_card_t *card=p15card->card; sc_context_t *ctx=p15card->card->ctx; struct sc_pkcs15_cert_info cert_info; struct sc_pkcs15_object cert_obj; unsigned ch...
0
78,727