instruction
stringclasses
1 value
input
stringlengths
64
129k
output
int64
0
1
__index_level_0__
int64
0
30k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HTMLDocument::HTMLDocument(const DocumentInit& initializer, DocumentClassFlags extendedDocumentClasses) : Document(initializer, HTMLDocumentClass | extendedDocumentClasses) { ScriptWrappable::init(this); clearXMLVersion(); } Commit Message: Fix tracking of the id attribute string if it is shared acro...
0
7,589
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MODRET set_loginpasswordprompt(cmd_rec *cmd) { int bool = -1; config_rec *c = NULL; CHECK_ARGS(cmd, 1); CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL|CONF_ANON); bool = get_boolean(cmd, 1); if (bool == -1) CONF_ERROR(cmd, "expected Boolean parameter"); c = add_config_param(cmd->argv[0], ...
0
14,665
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: stf_status ikev2_send_informational(struct state *st) { struct state *pst = NULL; if (st->st_clonedfrom != SOS_NOBODY) { pst = state_with_serialno(st->st_clonedfrom); if (!pst) { DBG(DBG_CONTROL, DBG_log( "IKE SA does not exist for this child SA - should not happen")); DBG(DBG_CONTROL,...
0
12,114
Analyze the following 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 hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) { struct snd_hrtimer *stime = container_of(hrt, struct snd_hrtimer, hrt); struct snd_timer *t = stime->timer; unsigned long oruns; if (!atomic_read(&stime->running)) return HRTIMER_NORESTART; oruns = hrtimer_forward_now(hrt, ns_to_ktim...
0
2,652
Analyze the following 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 FLACSource::read( MediaBuffer **outBuffer, const ReadOptions *options) { MediaBuffer *buffer; int64_t seekTimeUs; ReadOptions::SeekMode mode; if ((NULL != options) && options->getSeekTo(&seekTimeUs, &mode)) { FLAC__uint64 sample; if (seekTimeUs <= 0LL) { sample = 0LL; } else { ...
0
20,886
Analyze the following 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 NavigationControllerImpl::CanGoForward() const { int index = GetCurrentEntryIndex(); return index >= 0 && index < (static_cast<int>(entries_.size()) - 1); } Commit Message: Delete unneeded pending entries in DidFailProvisionalLoad to prevent a spoof. BUG=280512 BUG=278899 TEST=See bug for repro steps. ...
0
9,258
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ChromeURLRequestContextFactory() {} Commit Message: Revert a workaround commit for a Use-After-Free crash. Revert a workaround commit r20158 for a Use-After-Free issue (http://crbug.com/244746) because a cleaner CL r207218 is landed. URLRequestContext does not inherit SupportsWeakPtr now. R=mmenke BUG=244746...
0
6,559
Analyze the following 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 overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { if (((info.Length() == 1))) { overloadedMethodB1Method(info); return; } if (((info.Length() == 1) && (isUndefinedOrNull(info[0]) || info[0]->IsString() || info[0]->IsObject()))) { overloadedM...
0
10,388
Analyze the following 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::Initialize() { if (IsDestinationInitialized()) return; FFTFrame::Initialize(); audio_worklet_ = AudioWorklet::Create(this); if (destination_node_) { destination_node_->Handler().Initialize(); listener_ = AudioListener::Create(*this); } } Commit Message: Audio t...
1
14,953
Analyze the following 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 bdrv_rebind(BlockDriverState *bs) { if (bs->drv && bs->drv->bdrv_rebind) { bs->drv->bdrv_rebind(bs); } } Commit Message: CWE ID: CWE-190
0
15,771
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) { hdlc_device *hdlc = dev_to_hdlc(frad); pvc_device *pvc; struct net_device *dev; int used; if ((pvc = add_pvc(frad, dlci)) == NULL) { netdev_warn(frad, "Memory squeeze on fr_add_pvc()\n"); return -ENOBUFS; } if (*get_dev_p(p...
1
23,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: void GLES2DecoderImpl::DoFramebufferTextureMultiviewOVR( GLenum target, GLenum attachment, GLuint client_texture_id, GLint level, GLint base_view_index, GLsizei num_views) { NOTREACHED(); } Commit Message: Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_S...
0
9,173
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GURL RenderFrameImpl::GetLoadingUrl() const { WebDocumentLoader* document_loader = frame_->GetDocumentLoader(); GURL overriden_url; if (MaybeGetOverriddenURL(document_loader, &overriden_url)) return overriden_url; const WebURLRequest& request = document_loader->GetRequest(); return request.Url(); ...
0
9,417
Analyze the following 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 __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) { xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; return DoGetDrawableAttributes(cl, req->drawable); } Commit Message: CWE ID: CWE-20
0
12,417
Analyze the following 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 ecp_double_add_mxz( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, const mbedtls_ecp_point *Q, const mbedtls_mpi *d ) { int ret; mbedtls_mpi A, AA,...
0
15,276
Analyze the following 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 pack_offset_sort(const void *_a, const void *_b) { const struct object_entry *a = *(struct object_entry **)_a; const struct object_entry *b = *(struct object_entry **)_b; /* avoid filesystem trashing with loose objects */ if (!a->in_pack && !b->in_pack) return hashcmp(a->idx.sha1, b->idx.sha1); ...
0
25,138
Analyze the following 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_unixctl_init(void) { static bool registered; if (registered) { return; } registered = true; unixctl_command_register("ofproto/list", "", 0, 0, ofproto_unixctl_list, NULL); } Commit Message: ofproto: Fix OVS crash when reverting old flows in bundle...
0
129
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mojom::FetchCacheMode DetermineFrameCacheMode(Frame* frame, ResourceType resource_type) { if (!frame) return mojom::FetchCacheMode::kDefault; if (!frame->IsLocalFrame()) return DetermineFrameCacheMode(frame->Tree().Parent(), resource_type); if (resource...
0
5,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: gray_raster_render( PRaster raster, const FT_Raster_Params* params ) { const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; PWorker worker; if ( !raster || !raster->buffer || !ras...
0
2,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: static int __init crypto_ccm_module_init(void) { int err; err = crypto_register_template(&crypto_cbcmac_tmpl); if (err) goto out; err = crypto_register_template(&crypto_ccm_base_tmpl); if (err) goto out_undo_cbcmac; err = crypto_register_template(&crypto_ccm_tmpl); if (err) goto out_undo_base; e...
0
25,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: static int jas_iccprof_readhdr(jas_stream_t *in, jas_icchdr_t *hdr) { if (jas_iccgetuint32(in, &hdr->size) || jas_iccgetuint32(in, &hdr->cmmtype) || jas_iccgetuint32(in, &hdr->version) || jas_iccgetuint32(in, &hdr->clas) || jas_iccgetuint32(in, &hdr->colorspc) || jas_iccgetuint32(in, &hdr->refcolo...
0
1,281
Analyze the following 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::CloseContents(WebContents* source) { bool can_close_contents; if (IsFastTabUnloadEnabled()) can_close_contents = fast_unload_controller_->CanCloseContents(source); else can_close_contents = unload_controller_->CanCloseContents(source); if (can_close_contents) chrome::CloseWebCon...
0
1,499
Analyze the following 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 tcp_fast_parse_options(const struct sk_buff *skb, const struct tcphdr *th, struct tcp_sock *tp) { /* In the spirit of fast parsing, compare doff directly to constant * values. Because equality is used, short doff can be ignored here. */ if (th->doff == (sizeof(*th) / 4)) { tp->rx_opt.s...
0
27,712
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xml_acl_denied(xmlNode *xml) { if(xml && xml->doc && xml->doc->_private){ xml_private_t *p = xml->doc->_private; return is_set(p->flags, xpf_acl_denied); } return FALSE; } Commit Message: Fix: acl: Do not delay evaluation of added nodes in some situations It is not appropriate when...
0
10,445
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ExprCreateFieldRef(xkb_atom_t element, xkb_atom_t field) { EXPR_CREATE(ExprFieldRef, expr, EXPR_FIELD_REF, EXPR_TYPE_UNKNOWN); expr->field_ref.element = element; expr->field_ref.field = field; return expr; } Commit Message: xkbcomp: fix pointer value for FreeStmt Signed-off-by: Peter Hutterer <p...
0
3,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: void WebPagePrivate::setTextReflowAnchorPoint(const Platform::IntPoint& documentFocalPoint) { ASSERT(m_webPage->settings()->textReflowMode() == WebSettings::TextReflowEnabled); m_currentPinchZoomNode = bestNodeForZoomUnderPoint(documentFocalPoint); if (!m_currentPinchZoomNode) return; In...
0
157
Analyze the following 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 ne2000_buffer_full(NE2000State *s) { int avail, index, boundary; index = s->curpag << 8; boundary = s->boundary << 8; if (index < boundary) avail = boundary - index; else avail = (s->stop - s->start) - (index - boundary); if (avail < (MAX_ETH_FRAME_SIZE + 4)) ...
0
27,542
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: iperf_get_control_socket(struct iperf_test *ipt) { return ipt->ctrl_sck; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already fixed upstream, so was addressed here ...
0
12,528
Analyze the following 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 cqspi_suspend(struct device *dev) { struct cqspi_st *cqspi = dev_get_drvdata(dev); cqspi_controller_enable(cqspi, 0); return 0; } Commit Message: mtd: spi-nor: Off by one in cqspi_setup_flash() There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=. Fixes: 140623410...
0
9,755
Analyze the following 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 DIR *open_cwd(pid_t pid) { char buf[sizeof("/proc/%lu/cwd") + sizeof(long)*3]; sprintf(buf, "/proc/%lu/cwd", (long)pid); DIR *cwd = opendir(buf); if (cwd == NULL) perror_msg("Can't open process's CWD for CompatCore"); return cwd; } Commit Message: ccpp: save abrt core files o...
0
6,051
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: freebuffer(Image *image) { if (image->buffer) free(image->buffer); image->buffer = NULL; image->bufsize = 0; image->allocsize = 0; } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa...
0
10,716
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: TestAudioObserver() : output_mute_changed_count_(0) { } Commit Message: Enforce the WebUsbAllowDevicesForUrls policy This change modifies UsbChooserContext to use the UsbAllowDevicesForUrls class to consider devices allowed by the WebUsbAllowDevicesForUrls policy. The WebUsbAllowDevicesForUrls policy overri...
0
4,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: static ut8 getsib(const ut8 sib) { if (!sib) { return 0; } return (sib & 0x8) ? 3 : getsib ((sib << 1) | 1) - 1; } Commit Message: Fix #12372 and #12373 - Crash in x86 assembler (#12380) 0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL- mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL- leA ,0,[...
0
26,262
Analyze the following 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 php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC) { if (!stack_allocation) { MYSQLND_PACKET_SHA256_PK_REQUEST * p = (MYSQLND_PACKET_SHA256_PK_REQUEST *) _packet; mnd_pefree(p, p->header.persistent); } } Commit Message: Fix bug #72293 - Heap overflow in mysqln...
0
6,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: const Extension* ExtensionBrowserTest::LoadExtensionAsComponent( const base::FilePath& path) { return LoadExtensionAsComponentWithManifest(path, extensions::kManifestFilename); } Commit Message: [Extensions] Update navigations across hypothetical extension exte...
0
21,062
Analyze the following 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 CSSPaintValue::Equals(const CSSPaintValue& other) const { return GetName() == other.GetName() && CustomCSSText() == other.CustomCSSText(); } Commit Message: [PaintWorklet] Do not paint when paint target is associated with a link When the target element of a paint worklet has an associated link, ...
0
9,137
Analyze the following 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 page_readlink(struct dentry *dentry, char __user *buffer, int buflen) { DEFINE_DELAYED_CALL(done); int res = readlink_copy(buffer, buflen, page_get_link(dentry, d_inode(dentry), &done)); do_delayed_call(&done); return res; } Commit Message: vfs: rename: check backing inode being equal If ...
0
29,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: void PushMessagingServiceImpl::OnMessage(const std::string& app_id, const gcm::IncomingMessage& message) { if (g_browser_process->IsShuttingDown() || shutdown_started_) return; in_flight_message_deliveries_.insert(app_id); #if BUILDFLAG(ENABLE_BACKGROUND) if (g...
0
28,684
Analyze the following 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 GLES2DecoderPassthroughImpl::DoBeginQueryEXT( GLenum target, GLuint id, int32_t sync_shm_id, uint32_t sync_shm_offset) { GLuint service_id = GetQueryServiceID(id, &query_id_map_); QueryInfo* query_info = &query_info_map_[service_id]; scoped_refptr<gpu::Buffer> buffer = GetShare...
1
13,399
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void tty_ldisc_deref(struct tty_ldisc *ld) { ldsem_up_read(&ld->tty->ldisc_sem); } Commit Message: tty: Prevent ldisc drivers from re-using stale tty fields Line discipline drivers may mistakenly misuse ldisc-related fields when initializing. For example, a failure to initialize tty->receive_room in the N_GIGA...
0
25,567
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: unsigned int full_name_hash(const void *salt, const char *name, unsigned int len) { unsigned long hash = init_name_hash(salt); while (len--) hash = partial_name_hash((unsigned char)*name++, hash); return end_name_hash(hash); } Commit Message: dentry name snapshots take_dentry_name_snapshot() takes a safe s...
0
29,862
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: media::MediaPermission* RenderFrameImpl::GetMediaPermission() { if (!media_permission_dispatcher_) media_permission_dispatcher_.reset(new MediaPermissionDispatcher(this)); return media_permission_dispatcher_.get(); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this r...
0
28,822
Analyze the following 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 ext4_lblk_t ext4_ext_determine_hole(struct inode *inode, struct ext4_ext_path *path, ext4_lblk_t *lblk) { int depth = ext_depth(inode); struct ext4_extent *ex; ext4_lblk_t len; ex = path[depth].p_ext; if (ex == NULL) { /* there is no extent yet, so gap is [0;-] */ *lblk = 0; len...
0
4,251
Analyze the following 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 StaticNullableTestDictionaryMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestDictionary* result = TestObject::staticNullableTestDictionaryMethod(); V8SetReturnValue(info, result, info.GetIsolate()->GetCurrentContext()->Global()); } Commit Message: bindings: Support "attribute F...
0
16,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: Ins_EIF( INS_ARG ) { /* nothing to do */ } Commit Message: CWE ID: CWE-119
0
20,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: gx_device_init_on_stack(gx_device * dev, const gx_device * proto, gs_memory_t * mem) { memcpy(dev, proto, proto->params_size); dev->memory = mem; dev->retained = 0; dev->pad = proto->pad; dev->log2_align_mod = proto->log2_align_mod; dev->is_planar = proto->is_planar...
0
26,782
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OnDataChannelImpl(std::unique_ptr<RtcDataChannelHandler> handler) { DCHECK(main_thread_->BelongsToCurrentThread()); if (handler_) handler_->OnDataChannel(std::move(handler)); } Commit Message: Check weak pointers in RTCPeerConnectionHandler::WebRtcSetDescriptionObserverImpl Bug: 912074 Ch...
0
25,029
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ArcPolicyTest() {} Commit Message: Enforce the WebUsbAllowDevicesForUrls policy This change modifies UsbChooserContext to use the UsbAllowDevicesForUrls class to consider devices allowed by the WebUsbAllowDevicesForUrls policy. The WebUsbAllowDevicesForUrls policy overrides the other WebUSB policies. Unit tes...
0
6,996
Analyze the following 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* GetInspectedTab() { return browser()->tab_strip_model()->GetWebContentsAt(0); } Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes under the following conditions: 1. DevTools window is in undoc...
0
4,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 HarfBuzzShaperBase::setPadding(int padding) { m_padding = padding; m_padError = 0; if (!m_padding) return; unsigned numWordEnds = 0; for (unsigned i = 0; i < m_normalizedBufferLength; i++) { if (isWordEnd(i)) numWordEnds++; } if (numWordEnds) ...
0
12,690
Analyze the following 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 PPAPITestBase::SetUpCommandLine(CommandLine* command_line) { command_line->AppendSwitch(switches::kEnableFileCookies); command_line->AppendSwitch(switches::kEnablePepperTesting); command_line->AppendSwitch(switches::kDisableSmoothScrolling); } Commit Message: Disable OutOfProcessPPAPITest.VarDepreca...
0
1,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: SiteInstanceTest() : ui_thread_(BrowserThread::UI, &message_loop_), old_browser_client_(NULL) { } 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/96630...
1
22,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: UninstalledExtensionInfo::~UninstalledExtensionInfo() {} Commit Message: Extend TTS extension API to support richer events returned from the engine to the client. Previously we just had a completed event; this adds start, word boundary, sentence boundary, and marker boundary. In addition, interrupted and cancele...
0
9,643
Analyze the following 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 CuePoint* Cues::GetFirst() const { if (m_cue_points == NULL) return NULL; if (m_count == 0) return NULL; #if 0 LoadCuePoint(); //init cues const size_t count = m_count + m_preload_count; if (count == 0) //weird return NULL; #endif CuePoint* const* const pp = m_cue_po...
1
27,651
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ModuleExport size_t RegisterRLAImage(void) { MagickInfo *entry; entry=SetMagickInfo("RLA"); entry->decoder=(DecodeImageHandler *) ReadRLAImage; entry->adjoin=MagickFalse; entry->seekable_stream=MagickTrue; entry->description=ConstantString("Alias/Wavefront image"); entry->module=ConstantString(...
0
13,438
Analyze the following 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::blur() { m_inputTypeView->blur(); } Commit Message: Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control can hanlde 'autofocucs' attribute if it is specified. Note: HTMLInputElement::supportsAutofocus reuse...
0
7,266
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: input_userauth_ext_info(int type, u_int32_t seqnr, void *ctxt) { return kex_input_ext_info(type, seqnr, active_state); } Commit Message: Remove support for pre-authentication compression. Doing compression early in the protocol probably seemed reasonable in the 1990s, but today it's clearly a bad idea in terms ...
0
3,372
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: store_read_imp(png_store *ps, png_bytep pb, png_size_t st) { if (ps->current == NULL || ps->next == NULL) png_error(ps->pread, "store state damaged"); while (st > 0) { size_t cbAvail = store_read_buffer_size(ps) - ps->readpos; if (cbAvail > 0) { if (cbAvail > st) cbAvail = st; memcpy(pb, p...
0
20,546
Analyze the following 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 fuse_writepage_end(struct fuse_conn *fc, struct fuse_req *req) { struct inode *inode = req->inode; struct fuse_inode *fi = get_fuse_inode(inode); mapping_set_error(inode->i_mapping, req->out.h.error); spin_lock(&fc->lock); while (req->misc.write.next) { struct fuse_conn *fc = get_fuse_conn(ino...
0
22,193
Analyze the following 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 mac80211_hwsim_add_vendor_rtap(struct sk_buff *skb) { /* * To enable this code, #define the HWSIM_RADIOTAP_OUI, * e.g. like this: * #define HWSIM_RADIOTAP_OUI "\x02\x00\x00" * (but you should use a valid OUI, not that) * * If anyone wants to 'donate' a radiotap OUI/subns code * please s...
0
12,453
Analyze the following 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::BuildCommandsFromBrowsers( std::vector<SessionCommand*>* commands, IdToRange* tab_to_available_range, std::set<SessionID::id_type>* windows_to_track) { DCHECK(commands); for (BrowserList::const_iterator i = BrowserList::begin(); i != BrowserList::end(); ++i) { if (s...
0
27,233
Analyze the following 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 FilePath test_path() const { return dir_.path().AppendASCII("test"); } Commit Message: Convert ARRAYSIZE_UNSAFE -> arraysize in base/. R=thestig@chromium.org BUG=423134 Review URL: https://codereview.chromium.org/656033009 Cr-Commit-Position: refs/heads/master@{#299835} CWE ID: CWE-189
0
2,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: ScreenOrientationDispatcherHost::LockInformation::LockInformation( int request_id, int process_id, int routing_id) : request_id(request_id), process_id(process_id), routing_id(routing_id) { } Commit Message: Cleanups in ScreenOrientationDispatcherHost. BUG=None Review URL: https://coderevie...
0
26,122
Analyze the following 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 csum_len_for_type(int cst) { switch (cst) { case CSUM_NONE: return 1; case CSUM_MD4_ARCHAIC: return 2; case CSUM_MD4: case CSUM_MD4_OLD: case CSUM_MD4_BUSTED: return MD4_DIGEST_LEN; case CSUM_MD5: return MD5_DIGEST_LEN; } return 0; } Commit Message: CWE ID: CWE-354
0
22,622
Analyze the following 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 H264DPB::GetShortTermRefPicsAppending(H264Picture::PtrVector& out) { for (size_t i = 0; i < pics_.size(); ++i) { H264Picture* pic = pics_[i]; if (pic->ref && !pic->long_term) out.push_back(pic); } } Commit Message: Revert 137988 - VAVDA is the hardware video decode accelerator for Chrome o...
0
25,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: void PaintPropertyTreeBuilder::UpdatePaintingLayer() { bool changed_painting_layer = false; if (object_.HasLayer() && ToLayoutBoxModelObject(object_).HasSelfPaintingLayer()) { context_.painting_layer = ToLayoutBoxModelObject(object_).Layer(); changed_painting_layer = true; } else if (object_.I...
0
28,480
Analyze the following 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 dumpV8Message(v8::Local<v8::Context> context, v8::Local<v8::Message> message) { if (message.IsEmpty()) return; message->GetScriptOrigin(); v8::Maybe<int> unused = message->GetLineNumber(context); ALLOW_UNUSED_LOCAL(unused); v8::Local<v8::Value> resourceName = message->Get...
0
7,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 AcceptMojoConnection(base::ScopedFD handle) { DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_); DCHECK(pending_token_); pending_token_ = {}; mojo_connection_delegate_->AcceptMojoConnection(std::move(handle)); } Commit Message: Add a fake DriveFS launcher client. Using DriveFS r...
0
14,440
Analyze the following 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 HTMLLinkElement::HasActivationBehavior() const { return false; } Commit Message: Avoid crash when setting rel=stylesheet on <link> in shadow root. Link elements in shadow roots without rel=stylesheet are currently not added as stylesheet candidates upon insertion. This causes a crash if rel=stylesheet is...
0
10,765
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: error::Error GLES2DecoderPassthroughImpl::DoFramebufferTextureMultiviewOVR( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint base_view_index, GLsizei num_views) { if (IsEmulatedFramebufferBound(target)) { InsertError(GL_INVALID_OPERATION, "Cannot c...
0
6,473
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ModuleExport size_t RegisterPSDImage(void) { MagickInfo *entry; entry=AcquireMagickInfo("PSD","PSB","Adobe Large Document Format"); entry->decoder=(DecodeImageHandler *) ReadPSDImage; entry->encoder=(EncodeImageHandler *) WritePSDImage; entry->magick=(IsImageFormatHandler *) IsPSD; entry->flags|=...
0
18,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: virtual status_t configureVideoTunnelMode( node_id node, OMX_U32 portIndex, OMX_BOOL tunneled, OMX_U32 audioHwSync, native_handle_t **sidebandHandle ) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); d...
0
12,216
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: expand_idref(xmlNode * input, xmlNode * top) { const char *tag = NULL; const char *ref = NULL; xmlNode *result = input; char *xpath_string = NULL; if (result == NULL) { return NULL; } else if (top == NULL) { top = input; } tag = crm_element_name(result); ref ...
0
2,918
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ChromeDownloadManagerDelegate::CheckIfSuggestedPathExists( int32 download_id, const FilePath& unverified_path, bool should_prompt, bool is_forced_path, content::DownloadDangerType danger_type, const FilePath& default_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); ...
1
5,058
Analyze the following 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::TexImageHelperCanvasRenderingContextHost( const SecurityOrigin* security_origin, TexImageFunctionID function_id, GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, GLint xoffset, GLint yoffset, GLint zoffset, Ca...
0
11,687
Analyze the following 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::DidFinishDocumentLoad() { TRACE_EVENT1("navigation,benchmark,rail", "RenderFrameImpl::didFinishDocumentLoad", "id", routing_id_); Send(new FrameHostMsg_DidFinishDocumentLoad(routing_id_)); { SCOPED_UMA_HISTOGRAM_TIMER("RenderFrameObservers.DidFinishDocumentLoad"); ...
0
12,933
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vc4_submit_next_bin_job(struct drm_device *dev) { struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_exec_info *exec; again: exec = vc4_first_bin_job(vc4); if (!exec) return; vc4_flush_caches(dev); /* Either put the job in the binner if it uses the binner, or * immediately move it to the to-be-rendere...
0
791
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static enum ssb_mitigation __init __ssb_select_mitigation(void) { enum ssb_mitigation mode = SPEC_STORE_BYPASS_NONE; enum ssb_mitigation_cmd cmd; if (!boot_cpu_has(X86_FEATURE_SSBD)) return mode; cmd = ssb_parse_cmdline(); if (!boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS) && (cmd == SPEC_STORE_BYPASS...
0
27,918
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sequential_row(standard_display *dp, png_structp pp, png_infop pi, PNG_CONST int iImage, PNG_CONST int iDisplay) { PNG_CONST int npasses = dp->npasses; PNG_CONST int do_interlace = dp->do_interlace && dp->interlace_type == PNG_INTERLACE_ADAM7; PNG_CONST png_uint_32 height = s...
1
26,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: disp_srchresult(int result, char *prompt, char *str) { if (str == NULL) str = ""; if (result & SR_NOTFOUND) disp_message(Sprintf("Not found: %s", str)->ptr, TRUE); else if (result & SR_WRAPPED) disp_message(Sprintf("Search wrapped: %s", str)->ptr, TRUE); else if (show_srch_str) disp_message(Sp...
0
3,985
Analyze the following 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 port_is_power_on(struct usb_hub *hub, unsigned portstatus) { int ret = 0; if (hub_is_superspeed(hub->hdev)) { if (portstatus & USB_SS_PORT_STAT_POWER) ret = 1; } else { if (portstatus & USB_PORT_STAT_POWER) ret = 1; } return ret; } Commit Message: USB: fix invalid memory access in hub...
0
9,555
Analyze the following 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 mtrr_lookup_init(struct mtrr_iter *iter, struct kvm_mtrr *mtrr_state, u64 start, u64 end) { iter->mtrr_state = mtrr_state; iter->start = start; iter->end = end; iter->mtrr_disabled = false; iter->partial_map = false; iter->fixed = false; iter->range = NULL; mtrr_lookup_start(iter); } ...
0
27,866
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virtual void ShowCreatedFullscreenWidget(int route_id) {} Commit Message: Add unit test for AllowBindings check. BUG=117418 TEST=none Review URL: http://codereview.chromium.org/9701038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126929 0039d316-1c4b-4281-b951-d872f2087c98 CWE ID: CWE-264
0
3,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static uint32_t NumberOfElementsImpl(JSObject* receiver, FixedArrayBase* backing_store) { uint32_t max_index = Subclass::GetMaxIndex(receiver, backing_store); if (IsFastPackedElementsKind(Subclass::kind())) return max_index; Isolate* isolate = receiver->GetIsolate(); uint32_t count = 0; for (uint32_t i = 0...
0
29,435
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: modify_environment (const struct passwd *pw, const char *shell) { if (simulate_login) { /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. Unset all other environment variables. */ char *term = getenv ("TERM"); if (term) term = xstrdup (term); environ = xmallo...
0
25,058
Analyze the following 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 Chunk::changesAndSize( RIFF_MetaHandler* handler ) { hasChange = false; // unknown chunk ==> no change, naturally this->newSize = this->oldSize; } Commit Message: CWE ID: CWE-190
0
11,801
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void OffscreenCanvas::SetSize(const IntSize& size) { if (context_) { if (context_->Is3d()) { if (size != size_) context_->Reshape(size.Width(), size.Height()); } else if (context_->Is2d()) { context_->Reset(); origin_clean_ = true; } } if (size != size_) { UpdateMem...
0
6,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: void AssertCBIsNull() { ASSERT_TRUE(cb.is_null()); cb_already_run = true; } Commit Message: Convert Uses of base::RepeatingCallback<>::Equals to Use == or != in //base Staging this change because some conversions will have semantic changes. BUG=937566 Change-Id: I2d4950624c0fab00e107814421a161e43d...
0
26,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: get_external_key_retries(struct sc_card *card, unsigned char kid, unsigned char *retries) { int r; struct sc_apdu apdu; unsigned char random[16] = { 0 }; r = sc_get_challenge(card, random, 8); LOG_TEST_RET(card->ctx, r, "get challenge get_external_key_retries failed"); sc_format_apdu(card, &apdu, SC_APDU_...
0
10,840
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RVHObserver(RenderViewHostObserverArray* parent, RenderViewHost* rvh) : content::RenderViewHostObserver(rvh), parent_(parent) { } Commit Message: Use a new scheme for swapping out RenderViews. BUG=118664 TEST=none Review URL: http://codereview.chromium.org/9720004 git-svn-id: svn://...
0
6,841
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: base::string16 PageInfoUI::PermissionDecisionReasonToUIString( Profile* profile, const PageInfoUI::PermissionInfo& permission, const GURL& url) { ContentSetting effective_setting = GetEffectiveSetting( profile, permission.type, permission.setting, permission.default_setting); int message_id ...
0
2,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 int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, struct xdr_stream *xdr, struct nfs4_fs_locations_res *res) { struct compound_hdr hdr; int status; status = decode_compound_hdr(xdr, &hdr); if (status) goto out; status = decode_sequence(xdr, &res->seq_res, req); if (status) go...
0
5,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: ProfilingProcessHost::ProfilingProcessHost() : is_registered_(false), background_triggers_(this), mode_(Mode::kNone), profiled_renderer_(nullptr), always_sample_for_tests_(false) {} Commit Message: [Reland #1] Add Android OOP HP end-to-end tests. The original CL added a javatest and ...
0
15,607
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PassRefPtrWillBeRawPtr<Document> Document::cloneDocumentWithoutChildren() { DocumentInit init(url()); if (isXMLDocument()) { if (isXHTMLDocument()) return XMLDocument::createXHTML(init.withRegistrationContext(registrationContext())); return XMLDocument::create(init); } ...
0
14,452
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: psf_close_rsrc (SF_PRIVATE *psf) { psf_close_handle (psf->rsrc.handle) ; psf->rsrc.handle = NULL ; return 0 ; } /* psf_close_rsrc */ Commit Message: src/file_io.c : Prevent potential divide-by-zero. Closes: https://github.com/erikd/libsndfile/issues/92 CWE ID: CWE-189
0
22,780
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool BrowserView::IsToolbarVisible() const { if (immersive_mode_controller_->ShouldHideTopViews()) return false; return (browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) && toolbar_; } Commit Message: Mac: turn ...
0
17,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: apprentice_1(struct magic_set *ms, const char *fn, int action) { struct magic_map *map; #ifndef COMPILE_ONLY struct mlist *ml; size_t i; #endif if (magicsize != FILE_MAGICSIZE) { file_error(ms, 0, "magic element size %lu != %lu", (unsigned long)sizeof(*map->magic[0]), (unsigned long)FILE_MAGICS...
0
738
Analyze the following 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 avcc_Write(GF_Box *s, GF_BitStream *bs) { u32 i, count; GF_Err e; GF_AVCConfigurationBox *ptr = (GF_AVCConfigurationBox *) s; if (!s) return GF_BAD_PARAM; if (!ptr->config) return GF_OK; e = gf_isom_box_write_header(s, bs); if (e) return e; gf_bs_write_u8(bs, ptr->config->configurationVersion); g...
0
17,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 delayed_fput(struct work_struct *unused) { struct llist_node *node = llist_del_all(&delayed_fput_list); struct llist_node *next; for (; node; node = next) { next = llist_next(node); __fput(llist_entry(node, struct file, f_u.fu_llist)); } } Commit Message: get rid of s_files and files_lock T...
0
29,414
Analyze the following 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 keyctl_keyring_clear(key_serial_t ringid) { key_ref_t keyring_ref; struct key *keyring; long ret; keyring_ref = lookup_user_key(ringid, KEY_LOOKUP_CREATE, KEY_NEED_WRITE); if (IS_ERR(keyring_ref)) { ret = PTR_ERR(keyring_ref); /* Root is permitted to invalidate certain special keyrings */ if (ca...
0
17,569