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 int do_get_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data) { struct msr_data msr; int r; msr.index = index; msr.host_initiated = true; r = kvm_get_msr(vcpu, &msr); if (r) return r; *data = msr.data; return 0; } Commit Message: KVM: x86: Reload pit counters for all channels when restoring...
0
57,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: static unsigned int multi_tx_empty(struct sb_uart_port *port) { struct mp_port *mtpt = (struct mp_port *)port; unsigned long flags; unsigned int ret; spin_lock_irqsave(&mtpt->port.lock, flags); ret = serial_in(mtpt, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; spin_unlock_irqrestore(&mtpt->port.lock, flag...
0
29,441
Analyze the following 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 *ReadWPGImage(const ImageInfo *image_info, ExceptionInfo *exception) { typedef struct { size_t FileId; MagickOffsetType DataOffset; unsigned int ProductType; unsigned int FileType; unsigned char MajorVersion; unsigned char MinorVersion; unsigned int EncryptKey; u...
0
73,595
Analyze the following 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::FailedNavigation( const CommonNavigationParams& common_params, const BeginNavigationParams& begin_params, const RequestNavigationParams& request_params, bool has_stale_copy_in_cache, int error_code) { UpdatePermissionsForNavigation(common_params, request_params); ...
0
127,775
Analyze the following 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 Camera3Device::notify(const camera3_notify_msg *msg) { ATRACE_CALL(); NotificationListener *listener; { Mutex::Autolock l(mOutputLock); listener = mListener; } if (msg == NULL) { SET_ERR("HAL sent NULL notify message!"); return; } switch (msg->type) { case CAMERA3_MSG_ERROR: { ...
0
161,069
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mark_inode_as_seen (DeepCountState *state, GFileInfo *info) { guint64 inode; inode = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_UNIX_INODE); if (inode != 0) { g_array_append_val (state->seen_deep_count_inodes, inode); } } Commit Message: mime-ac...
0
60,940
Analyze the following 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 ipx_interface *ipxitf_find_using_net(__be32 net) { struct ipx_interface *i; spin_lock_bh(&ipx_interfaces_lock); if (net) { list_for_each_entry(i, &ipx_interfaces, node) if (i->if_netnum == net) goto hold; i = NULL; goto unlock; } i = ipx_primary_net; if (i) hold: ipxitf_hold(i); unlo...
0
40,457
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: v8::Isolate* WorkerThread::initializeIsolate() { ASSERT(isCurrentThread()); ASSERT(!m_isolate); v8::Isolate* isolate = V8PerIsolateData::initialize(); V8Initializer::initializeWorker(isolate); m_interruptor = adoptPtr(new V8IsolateInterruptor(isolate)); ThreadState::current()->addInterrup...
0
127,606
Analyze the following 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 skb_set_err_queue(struct sk_buff *skb) { /* pkt_type of skbs received on local sockets is never PACKET_OUTGOING. * So, it is safe to (mis)use it to mark skbs on the error queue. */ skb->pkt_type = PACKET_OUTGOING; BUILD_BUG_ON(PACKET_OUTGOING == 0); } Commit Message: tcp: mark skbs with SCM_TI...
0
95,416
Analyze the following 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_meta_text(struct _mdi *mdi, struct _event_data *data) { /* placeholder function so we can record tempo in the event stream * for conversion function _WM_Event2Midi */ #ifdef DEBUG_MIDI uint8_t ch = data->channel; MIDI_EVENT_SDEBUG(__FUNCTION__, ch, data->data.string); #endif if (mdi->extr...
0
63,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: void btif_dm_load_ble_local_keys(void) { memset(&ble_local_key_cb, 0, sizeof(btif_dm_local_key_cb_t)); if (btif_storage_get_ble_local_key(BTIF_DM_LE_LOCAL_KEY_ER,(char*)&ble_local_key_cb.er[0], BT_OCTET16_LEN)== BT_STATUS_SUCCESS) { ble_local_key_cb.is_er_r...
0
158,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: static int lock_fdc(int drive, bool interruptible) { if (WARN(atomic_read(&usage_count) == 0, "Trying to lock fdc while usage count=0\n")) return -1; if (wait_event_interruptible(fdc_wait, !test_and_set_bit(0, &fdc_busy))) return -EINTR; command_status = FD_COMMAND_NONE; reschedule_timeout(drive, "l...
0
39,395
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: brcmf_set_wsec_mode(struct net_device *ndev, struct cfg80211_connect_params *sme) { struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); struct brcmf_cfg80211_security *sec; s32 pval = 0; s32 gval = 0; s32 wsec; s32 err = 0; if (sme->crypto.n_ciphers_pairwise) { switch (sme->crypto.ciphers...
0
49,118
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WritingMode RenderFlexibleBox::transformedWritingMode() const { WritingMode mode = style()->writingMode(); if (!isColumnFlow()) return mode; switch (mode) { case TopToBottomWritingMode: case BottomToTopWritingMode: return style()->isLeftToRightDirection() ? LeftToRightWritingM...
0
116,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: void ResetScreenHandler::HandleOnCancel() { if (delegate_) delegate_->OnExit(); DBusThreadManager::Get()->GetUpdateEngineClient()->RemoveObserver(this); } Commit Message: Rollback option put behind the flag. BUG=368860 Review URL: https://codereview.chromium.org/267393011 git-svn-id: svn://svn.chromiu...
0
111,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 ChromeClientImpl::DetachCompositorAnimationTimeline( CompositorAnimationTimeline* compositor_timeline, LocalFrame* local_frame) { WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(local_frame)->LocalRoot(); if (web_frame->FrameWidget()) { if (CompositorAnimationHost* animatio...
0
148,134
Analyze the following 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 WebGLRenderingContextBase::AddCompressedTextureFormat(GLenum format) { if (!compressed_texture_formats_.Contains(format)) compressed_texture_formats_.push_back(format); } Commit Message: Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them...
0
133,570
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ConfirmInfoBar::~ConfirmInfoBar() { elevation_icon_setter_.reset(); } Commit Message: Allow to specify elide behavior for confrim infobar message Used in "<extension name> is debugging this browser" infobar. Bug: 823194 Change-Id: Iff6627097c020cccca8f7cc3e21a803a41fd8f2c Reviewed-on: https://chromium-review...
0
154,205
Analyze the following 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 crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src) { aes_enc_blk(ctx, dst, src); } Commit Message: crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a cry...
0
46,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: static void hw_perf_event_destroy(struct perf_event *event) { /* Nothing to be done! */ return; } 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...
0
25,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: bool WebPagePrivate::lockOrientation(bool landscape) { return m_client->lockOrientation(landscape); } Commit Message: [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos. Sour...
0
104,259
Analyze the following 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 Browser::ViewSourceForTab(WebContents* source, const GURL& page_url) { DCHECK(source); chrome::ViewSource(this, source); } Commit Message: Don't focus the location bar for NTP navigations in non-selected tabs. BUG=677716 TEST=See bug for repro steps. Review-Url: https://codereview.chromium.org/2624373...
0
139,088
Analyze the following 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* LockContentsView::TestApi::main_view() const { return view_->main_view_; } Commit Message: cros: Check initial auth type when showing views login. Bug: 859611 Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058 Reviewed-on: https://chromium-review.googlesource.com/1123056 Reviewed-by: Xiaoyin ...
0
131,554
Analyze the following 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 WebMediaPlayerMS::OnFrameClosed() { DCHECK(thread_checker_.CalledOnValidThread()); #if defined(OS_ANDROID) if (!paused_) { Pause(); should_play_upon_shown_ = true; } delegate_->PlayerGone(delegate_id_); #endif // defined(OS_ANDROID) if (frame_deliverer_) { io_task_runner_->PostTask(...
0
144,160
Analyze the following 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 nntp_mbox_sync(struct Context *ctx, int *index_hint) { struct NntpData *nntp_data = ctx->data; int rc; #ifdef USE_HCACHE header_cache_t *hc = NULL; #endif /* check for new articles */ nntp_data->nserv->check_time = 0; rc = check_mailbox(ctx); if (rc) return rc; #ifdef USE_HCACHE n...
0
79,507
Analyze the following 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 SessionService::SetSelectedNavigationIndex(const SessionID& window_id, const SessionID& tab_id, int index) { if (!ShouldTrackChangesToWindow(window_id)) return; if (tab_to_available_range_.find(tab_id.id(...
0
108,837
Analyze the following 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 u64 perf_cgroup_event_time(struct perf_event *event) { return 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 the resulting...
0
26,032
Analyze the following 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 cdxl_decode_rgb(CDXLVideoContext *c, AVFrame *frame) { uint32_t *new_palette = (uint32_t *)frame->data[1]; memset(frame->data[1], 0, AVPALETTE_SIZE); import_palette(c, new_palette); import_format(c, frame->linesize[0], frame->data[0]); } Commit Message: avcodec/cdxl: Check format for...
0
63,928
Analyze the following 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 BaseAudioContext::HandleDecodeAudioData( AudioBuffer* audio_buffer, ScriptPromiseResolver* resolver, V8PersistentCallbackFunction<V8DecodeSuccessCallback>* success_callback, V8PersistentCallbackFunction<V8DecodeErrorCallback>* error_callback) { DCHECK(IsMainThread()); if (audio_buffer) {...
0
153,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: mrb_proc_exec(const char *pname) { const char *s; s = pname; while (*s == ' ' || *s == '\t' || *s == '\n') s++; if (!*s) { errno = ENOENT; return -1; } execl("/bin/sh", "sh", "-c", pname, (char *)NULL); return -1; } Commit Message: Fix `use after free in File#initilialize_copy`; fix ...
0
83,165
Analyze the following 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 RenderViewHostImpl::OnRenderViewReady() { render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING; SendScreenRects(); WasResized(); delegate_->RenderViewReady(this); } Commit Message: Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chromiumcodere...
0
117,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: static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk, struct tcp_sacktag_state *state, int dup_sack, int pcount) { struct tcp_sock *tp = tcp_sk(sk); u8 sacked = TCP_SKB_CB(skb)->sacked; int fack_count = state->fack_count; /* Account D-SACK for retransmitted packet. */ if (dup_sack ...
0
41,203
Analyze the following 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 nlm_lockowner *nlm_find_lockowner(struct nlm_host *host, fl_owner_t owner) { struct nlm_lockowner *res, *new = NULL; spin_lock(&host->h_lock); res = __nlm_find_lockowner(host, owner); if (res == NULL) { spin_unlock(&host->h_lock); new = kmalloc(sizeof(*new), GFP_KERNEL); spin_lock(&host->...
0
34,855
Analyze the following 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 addResource(const char* url, const char* mime, PassRefPtr<SharedBuffer> data) { SerializedResource resource(toKURL(url), mime, data); m_resources.append(resource); } Commit Message: Revert 162155 "This review merges the two existing page serializ..." Change r162155 broke the wor...
0
118,874
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: IntRect FrameView::windowResizerRect() const { Page* page = frame().page(); if (!page) return IntRect(); return page->chrome().windowResizerRect(); } Commit Message: Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tre...
0
119,965
Analyze the following 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 on_cl_l2cap_le_connect_l(tBTA_JV_L2CAP_LE_OPEN *p_open, l2cap_socket *sock) { bd_copy(sock->addr.address, p_open->rem_bda, 0); if (!send_app_psm_or_chan_l(sock)) { APPL_TRACE_ERROR("send_app_psm_or_chan_l failed"); return; } if (send_app_connect_signal(sock->our_fd, &sock->addr, sock...
0
158,853
Analyze the following 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 DocumentLoader::SetHistoryItemStateForCommit( HistoryItem* old_item, WebFrameLoadType load_type, HistoryNavigationType navigation_type) { if (!history_item_ || !IsBackForwardLoadType(load_type)) history_item_ = HistoryItem::Create(); history_item_->SetURL(UrlForHistory()); history_item...
0
144,104
Analyze the following 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 size_t strlcpy(char *d, const char *s, size_t bufsize) { size_t len = strlen(s); size_t ret = len; if (bufsize <= 0) return 0; if (len >= bufsize) len = bufsize-1; memcpy(d, s, len); d[len] = 0; return ret; } Commit Message: CWE ID: CWE-59
0
12,443
Analyze the following 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 jpc_getdata(jas_stream_t *in, jas_stream_t *out, long len) { return jas_stream_copy(out, in, len); } Commit Message: The generation of the configuration file jas_config.h has been completely reworked in order to avoid pollution of the global namespace. Some problematic types like uchar, ulong, and friends ...
0
72,852
Analyze the following 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 __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, struct rb_node **rb_link, struct rb_node *rb_parent) { /* Update tracking information for the gap following the new vma. */ if (vma->vm_next) vma_gap_update(vma->vm_next); else mm->highest_vm_end = vm_end_gap(vma); /* * vma->vm_prev...
0
90,535
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len) { struct mddev *my_mddev = rdev->mddev; sector_t oldsectors = rdev->sectors; sector_t sectors; if (strict_blocks_to_sectors(buf, &sectors) < 0) return -EINVAL; if (rdev->data_offset != rdev->new_data_offset) return -EINVAL; /* too confus...
0
42,512
Analyze the following 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 palm_os_3_probe(struct usb_serial *serial, const struct usb_device_id *id) { struct device *dev = &serial->dev->dev; struct visor_connection_info *connection_info; unsigned char *transfer_buffer; char *string; int retval = 0; int i; int num_ports = 0; transfer_buffer = kmalloc(sizeof(*co...
0
54,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: PHP_FUNCTION(openssl_x509_export_to_file) { X509 * cert; zval ** zcert; zend_bool notext = 1; BIO * bio_out; long certresource; char * filename; int filename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|b", &zcert, &filename, &filename_len, &notext) == FAILURE) { return; } RETVAL_FAL...
0
98
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: BGD_DECLARE(gdImagePtr) gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h) { _noLibzError(); return NULL; } Commit Message: gd2: handle corrupt images better (CVE-2016-3074) Make sure we do some range checking on corrupted chunks. Thanks to Hans Jerry Illikainen <hji@dyntopia.com> for...
0
54,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 bool propertyMissingOrEqualToNone(StylePropertySet* style, CSSPropertyID propertyID) { if (!style) return false; RefPtr<CSSValue> value = style->getPropertyCSSValue(propertyID); if (!value) return true; if (!value->isPrimitiveValue()) return false; return static_...
0
100,334
Analyze the following 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 RenderFrameDevToolsAgentHost::IsChildFrame() { return frame_tree_node_ && frame_tree_node_->parent(); } Commit Message: [DevTools] Do not allow Page.setDownloadBehavior for extensions Bug: 866426 Change-Id: I71b672978e1a8ec779ede49da16b21198567d3a4 Reviewed-on: https://chromium-review.googlesource.com/c/...
0
143,671
Analyze the following 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 FrameLoader::DidExplicitOpen() { if (!state_machine_.CommittedFirstRealDocumentLoad()) state_machine_.AdvanceTo(FrameLoaderStateMachine::kCommittedFirstRealLoad); if (Frame* parent = frame_->Tree().Parent()) { if ((parent->IsLocalFrame() && ToLocalFrame(parent)->GetDocument()->LoadEvent...
0
154,923
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlParseComment(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; int size = XML_PARSER_BUFFER_SIZE; int len = 0; xmlParserInputState state; const xmlChar *in; int nbchar = 0, ccol; int inputid; /* * Check that there is a comment right here. */ if ((RAW != '<') || (NXT(1...
1
171,278
Analyze the following 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 GLES2DecoderImpl::DoGetRenderbufferParameteriv( GLenum target, GLenum pname, GLint* params) { Renderbuffer* renderbuffer = GetRenderbufferInfoForTarget(GL_RENDERBUFFER); if (!renderbuffer) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, "glGetRenderbufferParameteriv", "no render...
0
120,823
Analyze the following 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 ContentSecurityPolicy::allowScriptFromSource( const KURL& url, const String& nonce, ParserDisposition parserDisposition, RedirectStatus redirectStatus, SecurityViolationReportingPolicy reportingPolicy) const { if (shouldBypassContentSecurityPolicy(url)) { UseCounter::count( ...
0
136,741
Analyze the following 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 UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) { EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); if (!service) return; service->AttemptAuth(account_id); } Commit Message: cros: Check initial auth type when showing views login. Bug: 859611 Change-Id: I029...
0
131,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: jbig2_decode_generic_template0_unopt(Jbig2Ctx *ctx, Jbig2Segment *segment, const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats) { const int GBW = image->width; const int GBH = image...
0
18,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: static void *make_block_array(void *mem, int count, int size) { int i; void ** p = (void **) mem; char *q = (char *) (p + count); for (i=0; i < count; ++i) { p[i] = q; q += size; } return p; } Commit Message: fix unchecked length in stb_vorbis that could crash on corrupt/invalid fil...
0
75,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: int dns_packet_append_opt(DnsPacket *p, uint16_t max_udp_size, bool edns0_do, int rcode, size_t *start) { size_t saved_size; int r; assert(p); /* we must never advertise supported packet size smaller than the legacy max */ assert(max_udp_size >= DNS_PACKET_UNICAST_SIZE_MAX...
0
64,728
Analyze the following 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 set_debugt(void) { debugtimer = jiffies; } Commit Message: floppy: don't write kernel-only members to FDRAWCMD ioctl output Do not leak kernel-only floppy_raw_cmd structure members to userspace. This includes the linked-list pointer and the pointer to the allocated DMA space. Signed-off-by:...
0
39,430
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: StaticRangeVector* RangesFromCurrentSelectionOrExtendCaret( const LocalFrame& frame, SelectionModifyDirection direction, TextGranularity granularity) { frame.GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); SelectionModifier selection_modifier( frame, frame.Selection().ComputeV...
0
128,640
Analyze the following 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 Browser::ViewSourceForTab(TabContents* source, const GURL& page_url) { DCHECK(source); int index = tabstrip_model()->GetWrapperIndex(source); TabContentsWrapper* wrapper = tabstrip_model()->GetTabContentsAt(index); ViewSource(wrapper); } Commit Message: Implement a bubble that appears at the top of ...
0
97,443
Analyze the following 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 decode_cpe(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld, uint8_t id_syn_ele) { uint8_t channels = hDecoder->fr_channels; uint8_t tag = 0; if (channels+2 > MAX_CHANNELS) { hInfo->error = 12; return; } if (hDecoder->fr_ch...
0
88,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: static int nfsd_open_break_lease(struct inode *inode, int access) { unsigned int mode; if (access & NFSD_MAY_NOT_BREAK_LEASE) return 0; mode = (access & NFSD_MAY_WRITE) ? O_WRONLY : O_RDONLY; return break_lease(inode, mode | O_NONBLOCK); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfie...
0
65,898
Analyze the following 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 perf_addr_filter_match(struct perf_addr_filter *filter, struct file *file, unsigned long offset, unsigned long size) { if (filter->inode != file_inode(file)) return false; if (filter->offset > offset + size) return false; if (filter->offset + filter->size < offset) return ...
0
68,336
Analyze the following 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 UrlData::IncreaseLoadersInState( UrlDataWithLoadingState::LoadingState state) { switch (state) { case UrlDataWithLoadingState::LoadingState::kIdle: break; case UrlDataWithLoadingState::LoadingState::kPreload: preloading_++; break; case UrlDataWithLoadingState::LoadingState...
0
144,326
Analyze the following 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 zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC) /* {{{ */ { return do_register_internal_class(orig_class_entry, ZEND_ACC_INTERFACE TSRMLS_CC); } /* }}} */ Commit Message: CWE ID: CWE-416
0
13,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: spnego_gss_inquire_sec_context_by_oid( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_OID desired_object, gss_buffer_set_t *data_set) { OM_uint32 ret; ret = gss_inquire_sec_context_by_oid(minor_status, context_handle, desired_object, data_set); return ...
1
166,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: void numa_default_policy(void) { do_set_mempolicy(MPOL_DEFAULT, 0, NULL); } Commit Message: mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode commit 1a5a9906d4e8d1976b701f889d8f35d54b928f25 upstream. In some cases it may happen that pmd_none_or_clear_bad() is called with the mmap_sem ...
0
21,345
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: status_t MediaPlayer::getDuration_l(int *msec) { ALOGV("getDuration_l"); bool isValidState = (mCurrentState & (MEDIA_PLAYER_PREPARED | MEDIA_PLAYER_STARTED | MEDIA_PLAYER_PAUSED | MEDIA_PLAYER_STOPPED | MEDIA_PLAYER_PLAYBACK_COMPLETE)); if (mPlayer != 0 && isValidState) { int durationMs; statu...
0
159,488
Analyze the following 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 unsigned int obj_to_index(const struct kmem_cache *cache, const struct page *page, void *obj) { u32 offset = (obj - page->s_mem); return reciprocal_divide(offset, cache->reciprocal_buffer_size); } Commit Message: mm/slab.c: fix SLAB freelist randomization duplicate entries This patch fixes ...
0
68,914
Analyze the following 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 cma_init_conn_qp(struct rdma_id_private *id_priv, struct ib_qp *qp) { struct ib_qp_attr qp_attr; int qp_attr_mask, ret; qp_attr.qp_state = IB_QPS_INIT; ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask); if (ret) return ret; return ib_modify_qp(qp, &qp_attr, qp_attr_mask); } Comm...
0
38,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: get_ovsinst_map(enum ofp_version version) { /* OpenFlow 1.1 and 1.2 instructions. */ static const struct ovsinst_map of11[] = { { OVSINST_OFPIT11_GOTO_TABLE, 1 }, { OVSINST_OFPIT11_WRITE_METADATA, 2 }, { OVSINST_OFPIT11_WRITE_ACTIONS, 3 }, { OVSINST_OFPIT11_APPLY_ACTIONS, 4...
0
76,970
Analyze the following 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 language_range_match(const char *range, int range_len, const char *tag, int tag_len) { const char *end = range + range_len; const char *tend = tag + tag_len; while (range < end) { if (*range == '-' && tag == tend) return 1; if (*range != *tag || t...
0
6,870
Analyze the following 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 populate_vma_page_range(struct vm_area_struct *vma, unsigned long start, unsigned long end, int *nonblocking) { struct mm_struct *mm = vma->vm_mm; unsigned long nr_pages = (end - start) / PAGE_SIZE; int gup_flags; VM_BUG_ON(start & ~PAGE_MASK); VM_BUG_ON(end & ~PAGE_MASK); VM_BUG_ON_VMA(start < vm...
0
52,119
Analyze the following 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 smbXcli_conn_destructor(struct smbXcli_conn *conn) { /* * NT_STATUS_OK, means we do not notify the callers */ smbXcli_conn_disconnect(conn, NT_STATUS_OK); while (conn->sessions) { conn->sessions->conn = NULL; DLIST_REMOVE(conn->sessions, conn->sessions); } if (conn->smb1.trans_enc) { T...
0
2,456
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType DrawPatternPath(Image *image, const DrawInfo *draw_info,const char *name,Image **pattern) { char property[MaxTextExtent]; const char *geometry, *path, *type; DrawInfo *clone_info; ImageInfo *image_info; MagickBooleanType status; assert(...
0
71,999
Analyze the following 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 MockRenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { filter->OnFilterRemoved(); } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-s...
0
108,488
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PrintWebViewHelperTest() {} Commit Message: Fix print preview workflow to reflect settings of selected printer. BUG=95110 TEST=none Review URL: http://codereview.chromium.org/7831041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102242 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-399
0
97,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 ssize_t map_size_show(struct uio_mem *mem, char *buf) { return sprintf(buf, "0x%lx\n", mem->size); } Commit Message: Fix a few incorrectly checked [io_]remap_pfn_range() calls Nico Golde reports a few straggling uses of [io_]remap_pfn_range() that really should use the vm_iomap_memory() helper. This tr...
0
28,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: void MarkingVisitor::ConservativelyMarkAddress(BasePage* page, Address address) { #if DCHECK_IS_ON() DCHECK(page->Contains(address)); #endif HeapObjectHeader* const header = page->IsLargeObjectPage() ? static_cast<LargeObjectPage*>(page)->GetHeapO...
0
153,829
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AcceleratedSurfaceBuffersSwappedCompleted(int host_id, int route_id, bool alive) { if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { GpuProcessHost* host = GpuProcessHost::FromID(host_id); if (host) { ...
0
102,944
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer, struct ring_buffer_event *event) { unsigned long addr = (unsigned long)event; struct buffer_page *bpage = cpu_buffer->commit_page; struct buffer_page *start; addr &= PAGE_MASK; /* Do the likely case first */ if (likely(bpage->page == (void *)...
0
72,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: set_default_mcast_group(data_t * data) { inet_stosockaddr(INADDR_VRRP_GROUP, 0, (struct sockaddr_storage *)&data->vrrp_mcast_group4); inet_stosockaddr(INADDR6_VRRP_GROUP, 0, (struct sockaddr_storage *)&data->vrrp_mcast_group6); } Commit Message: Add command line and configuration option to set umask Issue #10...
0
75,802
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: size_t jsvGetCharsOnLine(JsVar *v, size_t line) { size_t currentLine = 1; size_t chars = 0; JsvStringIterator it; jsvStringIteratorNew(&it, v, 0); while (jsvStringIteratorHasChar(&it)) { if (jsvStringIteratorGetChar(&it)=='\n') { currentLine++; if (currentLine > line) break; } else i...
0
82,407
Analyze the following 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 nf_ct_frag6_cleanup(void) { inet_frags_fini(&nf_frags); nf_init_frags.low_thresh = 0; nf_ct_frag6_evictor(); } Commit Message: netfilter: nf_conntrack_reasm: properly handle packets fragmented into a single fragment When an ICMPV6_PKT_TOOBIG message is received with a MTU below 1280, all further packet...
0
19,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 Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define ...
1
168,540
Analyze the following 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_process_gsave(fz_context *ctx, pdf_processor *proc, pdf_csi *csi) { if (proc->op_q) proc->op_q(ctx, proc); ++csi->gstate; } Commit Message: CWE ID: CWE-20
0
588
Analyze the following 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 WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, ...
0
133,391
Analyze the following 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 nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) { rpc_authflavor_t authflavor = clp->cl_rpcclient->cl_auth->au_flavor; int status; /* try SP4_MACH_CRED if krb5i/p */ if (authflavor == RPC_AUTH_GSS_KRB5I || authflavor == RPC_AUTH_GSS_KRB5P) { status = _nfs4_proc_exchange_id(clp...
0
57,187
Analyze the following 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 HTMLFormControlElement::willChangeForm() { ListedElement::willChangeForm(); formOwnerSetNeedsValidityCheck(); if (formOwner() && canBeSuccessfulSubmitButton()) formOwner()->invalidateDefaultButtonStyle(); } Commit Message: Form validation: Do not show validation bubble if the page is invisible. B...
0
140,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 gboolean webkit_web_view_scroll_event(GtkWidget* widget, GdkEventScroll* event) { WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); Frame* frame = core(webView)->mainFrame(); if (!frame->view()) return FALSE; PlatformWheelEvent wheelEvent(event); return frame->eventHandler()->...
0
100,630
Analyze the following 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 AXObjectCacheImpl::selectionChanged(Node* node) { while (node) { if (AXObject* obj = get(node)) { obj->selectionChanged(); return; } node = node->parentNode(); } } Commit Message: Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://c...
0
127,384
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: perform_one_test(FILE *fp, int argc, const char **argv, png_uint_32 *default_flags, display *d, int set_callback) { int def; png_uint_32 flags[2][4]; rewind(fp); clear_keep(); memcpy(flags[0], default_flags, sizeof flags[0]); def = check(fp, argc, argv, flags[1], d, set_callback); /* Chunks...
0
159,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: ScriptValue Document::registerElement(ScriptState* script_state, const AtomicString& name, const ElementRegistrationOptions& options, ExceptionState& exception_state) { if (!RegistrationContext()) {...
0
144,047
Analyze the following 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 dateMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::dateMethodMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: document.location bindings fix BUG=...
0
122,261
Analyze the following 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_renegotiate(SSL *s) { if (s->handshake_func == NULL) return(1); if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); s->s3->renegotiate=1; return(1); } Commit Message: CWE ID: CWE-310
0
95
Analyze the following 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 android_net_wifi_setLinkLayerStats (JNIEnv *env, jclass cls, jint iface, int enable) { JNIHelper helper(env); wifi_interface_handle handle = getIfaceHandle(helper, cls, iface); wifi_link_layer_params params; params.aggressive_statistics_gathering = enable; params.mpdu_size_threshold ...
0
159,099
Analyze the following 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 dispatchCarrierRestrictions(Parcel &p, RequestInfo *pRI) { RIL_CarrierRestrictions cr; RIL_Carrier * allowed_carriers = NULL; RIL_Carrier * excluded_carriers = NULL; int32_t t; status_t status; memset(&cr, 0, sizeof(RIL_CarrierRestrictions)); if (s_callbacks.version < 14) { ...
0
162,088
Analyze the following 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 remote_function(void *data) { struct remote_function_call *tfc = data; struct task_struct *p = tfc->p; if (p) { /* -EAGAIN */ if (task_cpu(p) != smp_processor_id()) return; /* * Now that we're on right CPU with IRQs disabled, we can test * if we hit the right task without races. ...
0
68,423
Analyze the following 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 HTMLInputElement::InitializeTypeInParsing() { DCHECK(parsing_in_progress_); DCHECK(!input_type_); DCHECK(!input_type_view_); const AtomicString& new_type_name = InputType::NormalizeTypeName(FastGetAttribute(typeAttr)); input_type_ = InputType::Create(*this, new_type_name); input_type_view_...
0
126,042
Analyze the following 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 net_interface *find_socket(unsigned char *mac) { struct net_interface *interface; DL_FOREACH(interfaces, interface) { if (memcmp(mac, interface->mac_addr, ETH_ALEN) == 0) { return interface; } } return NULL; } Commit Message: Merge pull request #20 from eyalitki/master 2nd round securi...
0
50,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: static int x86_pmu_commit_txn(struct pmu *pmu) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); int assign[X86_PMC_IDX_MAX]; int n, ret; n = cpuc->n_events; if (!x86_pmu_initialized()) return -EAGAIN; ret = x86_pmu.schedule_events(cpuc, n, assign); if (ret) return ret; /* * copy new...
0
25,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: static void init_font_scale(ASS_Renderer *render_priv) { ASS_Settings *settings_priv = &render_priv->settings; render_priv->font_scale = ((double) render_priv->orig_height) / render_priv->track->PlayResY; if (settings_priv->storage_height) render_priv->blur_scale...
0
73,370
Analyze the following 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 aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) { struct aes_ctx *ctx = aes_ctx(tfm); int ts_state; padlock_reset_key(&ctx->cword.encrypt); ts_state = irq_ts_save(); ecb_crypt(in, out, ctx->E, &ctx->cword.encrypt, 1); irq_ts_restore(ts_state); padlock_store_cword(&ctx->cword.encrypt...
0
47,427