instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebPluginDelegateProxy::OnAcceleratedPluginEnabledRendering() { uses_compositor_ = true; OnSetWindow(gfx::kNullPluginWindow); } Commit Message: Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chr...
0
107,135
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: virDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *file, unsigned int flags) { VIR_DEBUG("conn=%p, file=%s, flags=%x", conn, NULLSTR(file), flags); virResetLastError(); virCheckConnectReturn(conn, NULL); virCheckNonNullArgGoto(file, error); ...
0
93,908
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofputil_encode_table_config(enum ofputil_table_miss miss, enum ofputil_table_eviction eviction, enum ofputil_table_vacancy vacancy, enum ofp_version version) { uint32_t config = 0; /* Search for "OFPTC_* Table Configuratio...
0
77,600
Analyze the following 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 dns_send_query(struct dns_resolution *resolution) { struct dns_resolvers *resolvers = resolution->resolvers; struct dns_nameserver *ns; list_for_each_entry(ns, &resolvers->nameservers, list) { int fd = ns->dgram->t.sock.fd; if (fd == -1) { if (dns_connect_namesaver(ns) == -1) continue; ...
0
711
Analyze the following 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 netif_device_detach(struct net_device *dev) { if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && netif_running(dev)) { netif_tx_stop_all_queues(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_...
0
32,206
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: zip_read_data_zipx_xz(struct archive_read *a, const void **buff, size_t *size, int64_t *offset) { struct zip* zip = (struct zip *)(a->format->data); int ret; lzma_ret lz_ret; const void* compressed_buf; ssize_t bytes_avail, in_bytes, to_consume = 0; (void) offset; /* UNUSED */ /* Initialize decompressor...
0
90,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 ConfirmInfoBar::Layout() { InfoBarView::Layout(); int x = StartX(); Labels labels; labels.push_back(label_); labels.push_back(link_); AssignWidths(&labels, std::max(0, EndX() - x - NonLabelWidth())); ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get(); label_->SetPosition(g...
0
154,202
Analyze the following 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 ExtensionApiTest::SetUpOnMainThread() { ExtensionBrowserTest::SetUpOnMainThread(); DCHECK(!test_config_.get()) << "Previous test did not clear config state."; test_config_.reset(new base::DictionaryValue()); test_config_->SetString(kTestDataDirectory, net::FilePathToFileURL(...
0
151,560
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: create_mainbar () { GUI *g = &uzbl.gui; g->mainbar = gtk_hbox_new (FALSE, 0); g->mainbar_label = gtk_label_new (""); gtk_label_set_selectable((GtkLabel *)g->mainbar_label, TRUE); gtk_label_set_ellipsize(GTK_LABEL(g->mainbar_label), PANGO_ELLIPSIZE_END); gtk_misc_set_alignment (GTK_MISC(g-...
0
18,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: static bool SniffCRX(const char* content, size_t size, const GURL& url, const std::string& type_hint, bool* have_enough_content, std::string* result) { static const struct MagicNumber kCRXMagicNumbers[] = { ...
0
148,402
Analyze the following 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 FileAPIMessageFilter::OnCloneBlob( const GURL& url, const GURL& src_url) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); blob_storage_context_->controller()->CloneBlob(url, src_url); blob_urls_.insert(url.spec()); } Commit Message: File permission fix: now we selectively grant read permis...
0
119,022
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const AtomicString& HTMLLinkElement::Rel() const { return getAttribute(relAttr); } 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=...
0
143,335
Analyze the following 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 MagickBooleanType WriteJNGImage(const ImageInfo *image_info,Image *image) { MagickBooleanType logging, status; MngInfo *mng_info; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); assert(image != (Ima...
0
77,948
Analyze the following 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 read_int32_info (WavpackStream *wps, WavpackMetadata *wpmd) { int bytecnt = wpmd->byte_length; char *byteptr = (char *)wpmd->data; if (bytecnt != 4) return FALSE; wps->int32_sent_bits = *byteptr++; wps->int32_zeros = *byteptr++; wps->int32_ones = *byteptr++; wps->i...
0
75,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: Ins_NEQ( INS_ARG ) { DO_NEQ } Commit Message: CWE ID: CWE-119
0
10,139
Analyze the following 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 ChromeClientImpl::statusbarVisible() { return m_statusbarVisible; } Commit Message: Delete apparently unused geolocation declarations and include. BUG=336263 Review URL: https://codereview.chromium.org/139743014 git-svn-id: svn://svn.chromium.org/blink/trunk@165601 bbb929c8-8fbe-4397-9dbb-9b2b2021853...
0
118,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 inline void preempt_latency_stop(int val) { } 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 m...
0
55,573
Analyze the following 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 __net_exit default_device_exit_batch(struct list_head *net_list) { /* At exit all network devices most be removed from a network * namespace. Do this in the reverse order of registeration. * Do this across as many network namespaces as possible to * improve batching efficiency. */ struct ne...
0
32,086
Analyze the following 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 ecryptfs_put_lower_file(struct inode *inode) { struct ecryptfs_inode_info *inode_info; inode_info = ecryptfs_inode_to_private(inode); if (atomic_dec_and_mutex_lock(&inode_info->lower_file_count, &inode_info->lower_file_mutex)) { filemap_write_and_wait(inode->i_mapping); fput(inode_info->low...
0
74,573
Analyze the following 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 InspectorNetworkAgent::DidCreateWebSocket(Document* document, unsigned long identifier, const KURL& request_url, const String&) { std::unique_ptr<v8_inspector::protoc...
0
138,479
Analyze the following 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::setPreventsScreenDimming(bool keepAwake) { if (keepAwake) { if (!m_preventIdleDimmingCount) m_client->setPreventsScreenIdleDimming(true); m_preventIdleDimmingCount++; } else if (m_preventIdleDimmingCount > 0) { m_preventIdleDimmingCount--; i...
0
104,415
Analyze the following 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 PermissionsGetAllFunction::RunImpl() { scoped_ptr<Permissions> permissions = helpers::PackPermissionSet(GetExtension()->GetActivePermissions()); results_ = GetAll::Results::Create(*permissions); return true; } Commit Message: Check prefs before allowing extension file access in the permissions A...
0
115,915
Analyze the following 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::HandleGenSharedIdsCHROMIUM( uint32 immediate_data_size, const cmds::GenSharedIdsCHROMIUM& c) { GLuint namespace_id = static_cast<GLuint>(c.namespace_id); GLuint id_offset = static_cast<GLuint>(c.id_offset); GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size; if (!...
0
120,943
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ospf6_print_lsa(netdissect_options *ndo, register const struct lsa6 *lsap, const u_char *dataend) { register const struct rlalink6 *rlp; #if 0 register const struct tos_metric *tosp; #endif register const rtrid_t *ap; #if 0 register const struct aslametric *almp; register const struct mcla *m...
0
93,175
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: content::PreviewsState ChromeContentBrowserClient::DetermineAllowedPreviews( content::PreviewsState initial_state, content::NavigationHandle* navigation_handle, const GURL& current_navigation_url) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!navigation_handle->IsInMainFrame() || ...
0
152,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: static void CacheThru_put_string(HTStream *me, const char *str) { if (me->status == HT_OK) { if (me->fp) { fputs(str, me->fp); } else if (me->chunk) { me->last_chunk = HTChunkPuts2(me->last_chunk, str); if (me->last_chunk == NULL || me->last_chunk->allocated == 0) me->status = HT_ERROR; } ...
0
58,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: static int check_stack_boundary(struct bpf_verifier_env *env, int regno, int access_size, bool zero_size_allowed, struct bpf_call_arg_meta *meta) { struct bpf_verifier_state *state = env->cur_state; struct bpf_reg_state *regs = state->regs; int off, i, slot, spi; if (regs[regno].type != PTR_TO_STACK)...
0
59,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: static void remove_pidfile(const char *pid_file) { if (pid_file == NULL) return; if (unlink(pid_file) != 0) { vperror("Could not remove the pid file %s", pid_file); } } Commit Message: Don't overflow item refcount on get Counts as a miss if the refcount is too high. ASCII multigets are the o...
0
75,206
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NTSTATUS ZeroUnreadableSectors (PDEVICE_OBJECT deviceObject, LARGE_INTEGER startOffset, ULONG size, uint64 *zeroedSectorCount) { NTSTATUS status; ULONG sectorSize; ULONG sectorCount; byte *sectorBuffer = NULL; *zeroedSectorCount = 0; status = GetDeviceSectorSize (deviceObject, &sectorSize); if (!NT_SUCCE...
0
87,230
Analyze the following 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 efx_update_name(struct efx_nic *efx) { strcpy(efx->name, efx->net_dev->name); efx_mtd_rename(efx); efx_set_channel_names(efx); } Commit Message: sfc: Fix maximum number of TSO segments and minimum TX queue size [ Upstream commit 7e6d06f0de3f74ca929441add094518ae332257c ] Currently an skb requiri...
0
19,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: String Document::visibilityState() const { return PageHiddenStateString(hidden()); } Commit Message: Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could c...
0
130,005
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SWFInput_getUInt32_BE(SWFInput input) { unsigned long num = SWFInput_getChar(input) << 24; num += SWFInput_getChar(input) << 16; num += SWFInput_getChar(input) << 8; num += SWFInput_getChar(input); return num; } Commit Message: Fix left shift of a negative value in SWFInput_readSBits. Check for number befor...
0
89,560
Analyze the following 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 enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledAtRuntimeMethod", "TestObject", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { exceptionState.throwTypeError(Ex...
0
121,661
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DownloadItem* CreateSlowTestDownload() { std::unique_ptr<content::DownloadTestObserver> observer( CreateInProgressDownloadObserver(1)); embedded_test_server()->RegisterRequestHandler(base::Bind( &content::SlowDownloadHttpResponse::HandleSlowDownloadRequest)); EXPECT_TRUE(embedded_tes...
0
151,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: SProcXvListImageFormats(ClientPtr client) { REQUEST(xvListImageFormatsReq); REQUEST_SIZE_MATCH(xvListImageFormatsReq); swaps(&stuff->length); swapl(&stuff->port); return XvProcVector[xv_ListImageFormats] (client); } Commit Message: CWE ID: CWE-20
0
17,485
Analyze the following 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 android_net_wifi_hal_cleaned_up_handler(wifi_handle handle) { ALOGD("In wifi cleaned up handler"); JNIHelper helper(mVM); helper.setStaticLongField(mCls, WifiHandleVarName, 0); helper.deleteGlobalRef(mCls); mCls = NULL; mVM = NULL; } Commit Message: Deal correctly with short strings ...
0
159,087
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _nextA(int visited) { HmarkerList *hl = Currentbuf->hmarklist; BufferPoint *po; Anchor *an, *pan; int i, x, y, n = searchKeyNum(); ParsedURL url; if (Currentbuf->firstLine == NULL) return; if (!hl || hl->nmark == 0) return; an = retrieveCurrentAnchor(Currentbuf); if (visite...
0
84,460
Analyze the following 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 Automation::ExecuteScript(int tab_id, const FramePath& frame_path, const std::string& script, std::string* result, Error** error) { int windex = 0, tab_index = 0; *error = GetIndice...
0
100,701
Analyze the following 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 verify_aead(struct nlattr **attrs) { struct nlattr *rt = attrs[XFRMA_ALG_AEAD]; struct xfrm_algo_aead *algp; if (!rt) return 0; algp = nla_data(rt); if (nla_len(rt) < aead_len(algp)) return -EINVAL; algp->alg_name[CRYPTO_MAX_ALG_NAME - 1] = '\0'; return 0; } Commit Message: xfrm_user: re...
0
33,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: static void _regulator_enable_delay(unsigned int delay) { unsigned int ms = delay / 1000; unsigned int us = delay % 1000; if (ms > 0) { /* * For small enough values, handle super-millisecond * delays in the usleep_range() call below. */ if (ms < 20) us += ms * 1000; else msleep(ms); } ...
0
74,455
Analyze the following 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::MediaQueryAffectingValueChanged() { GetStyleEngine().MediaQueryAffectingValueChanged(); if (NeedsLayoutTreeUpdate()) evaluate_media_queries_on_style_recalc_ = true; else EvaluateMediaQueryList(); probe::mediaQueryResultChanged(this); } Commit Message: Inherit CSP when we inherit th...
0
134,115
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: htmlParseHTMLName_nonInvasive(htmlParserCtxtPtr ctxt) { int i = 0; xmlChar loc[HTML_PARSER_BUFFER_SIZE]; if (!IS_ASCII_LETTER(NXT(1)) && (NXT(1) != '_') && (NXT(1) != ':')) return(NULL); while ((i < HTML_PARSER_BUFFER_SIZE) && ((IS_ASCII_LETTER(NXT(1+i))) || (IS_ASCII_DIGIT(NX...
0
150,820
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SPL_METHOD(SplDoublyLinkedList, unserialize) { spl_dllist_object *intern = Z_SPLDLLIST_P(getThis()); zval *flags, *elem; char *buf; size_t buf_len; const unsigned char *p, *s; php_unserialize_data_t var_hash; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) { return; } if (...
0
54,296
Analyze the following 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 ScrollHitTestDisplayItem::Equals(const DisplayItem& other) const { return DisplayItem::Equals(other) && &scroll_node() == &static_cast<const ScrollHitTestDisplayItem&>(other).scroll_node(); } Commit Message: Reland "[CI] Make paint property nodes non-ref-counted" This reverts commit...
0
125,706
Analyze the following 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 RELOC_PTRS_WITH(dc_colored_masked_reloc_ptrs, gx_device_color *cptr) { RELOC_SUPER(gx_device_color, st_client_color, ccolor); if (cptr->colors.colored.c_ht != 0) { RELOC_PTR(gx_device_color, colors.colored.c_ht); } } Commit Message: CWE ID: CWE-704
0
1,648
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LocalFrame& GetFrame() const { return dummy_page_holder_->GetFrame(); } Commit Message: Move SelectionTemplate::is_handle_visible_ to FrameSelection This patch moves |is_handle_visible_| to |FrameSelection| from |SelectionTemplate| since handle visibility is used only for setting |FrameSelection|, hence it is...
0
124,836
Analyze the following 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 InspectorTraceEvents::Init(CoreProbeSink* instrumenting_agents, protocol::UberDispatcher*, protocol::DictionaryValue*) { instrumenting_agents_ = instrumenting_agents; instrumenting_agents_->addInspectorTraceEvents(this); } Commit Message: D...
0
138,678
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XineramaPointInWindowIsVisible(WindowPtr pWin, int x, int y) { BoxRec box; int i, xoff, yoff; if (!pWin->realized) return FALSE; if (RegionContainsPoint(&pWin->borderClip, x, y, &box)) return TRUE; if (!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE; ...
0
4,908
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static u64 get_coherent_dma_mask(struct device *dev) { u64 mask = (u64)arm_dma_limit; if (dev) { mask = dev->coherent_dma_mask; /* * Sanity check the DMA mask - it must be non-zero, and * must be able to be satisfied by a DMA allocation. */ if (mask == 0) { dev_warn(dev, "coherent DMA mask i...
0
58,322
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: callout_tag_table_new(CalloutTagTable** rt) { CalloutTagTable* t; *rt = 0; t = onig_st_init_strend_table_with_size(INIT_TAG_NAMES_ALLOC_NUM); CHECK_NULL_RETURN_MEMERR(t); *rt = t; return ONIG_NORMAL; } Commit Message: fix #147: Stack Exhaustion Problem caused by some parsing functions in regcomp.c ...
0
87,856
Analyze the following 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 ParaNdis_DeviceFiltersUpdateVlanId(PARANDIS_ADAPTER *pContext) { if (pContext->bHasHardwareFilters) { ULONG newFilterSet; if (IsVlanSupported(pContext)) newFilterSet = pContext->VlanId ? pContext->VlanId : (MAX_VLAN_ID + 1); else newFilterSet = IsPriori...
0
74,369
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WinScreenKeyboardObserver(RenderWidgetHostImpl* host, const gfx::Point& location_in_screen, float scale_factor, aura::Window* window) : host_(host), location_in_screen_(location_in_screen), device_scale_fac...
0
132,322
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void dumpnode(Renode *node) { Rune *p; if (!node) { printf("Empty"); return; } switch (node->type) { case P_CAT: printf("Cat("); dumpnode(node->x); printf(", "); dumpnode(node->y); printf(")"); break; case P_ALT: printf("Alt("); dumpnode(node->x); printf(", "); dumpnode(node->y); printf(")"); break; ...
0
90,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: static void write_response(ESPState *s) { trace_esp_write_response(s->status); s->ti_buf[0] = s->status; s->ti_buf[1] = 0; if (s->dma) { s->dma_memory_write(s->dma_opaque, s->ti_buf, 2); s->rregs[ESP_RSTAT] = STAT_TC | STAT_ST; s->rregs[ESP_RINTR] = INTR_BS | INTR_FC; ...
0
10,410
Analyze the following 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 ImageLoader::updateFromElementIgnoringPreviousError() { clearFailedLoadURL(); updateFromElement(); } Commit Message: Error event was fired synchronously blowing away the input element from underneath. Remove the FIXME and fire it asynchronously using errorEventSender(). BUG=240124 Review URL: http...
0
113,493
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int hns_ppe_get_regs_count(void) { return ETH_PPE_DUMP_NUM; } Commit Message: net: hns: fix ethtool_get_strings overflow in hns driver hns_get_sset_count() returns HNS_NET_STATS_CNT and the data space allocated is not enough for ethtool_get_strings(), which will cause random memory corruption. When SLAB and D...
0
85,568
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: inline ImageInputType::ImageInputType(HTMLInputElement& element) : BaseButtonInputType(element) , m_useFallbackContent(false) { } Commit Message: ImageInputType::ensurePrimaryContent should recreate UA shadow tree. Once the fallback shadow tree was created, it was never recreated even if ensurePrimaryCo...
0
132,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 OnAudioTimeCallback( base::TimeDelta current_time, base::TimeDelta max_time) { CHECK(current_time <= max_time); } 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.chrom...
0
108,322
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderFrameHostImpl::OnSetHasReceivedUserGestureBeforeNavigation( bool value) { frame_tree_node_->OnSetHasReceivedUserGestureBeforeNavigation(value); } Commit Message: Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnl...
0
139,368
Analyze the following 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_GetBase(XML_Parser parser) { if (parser == NULL) return NULL; return parser->m_curBase; } Commit Message: xmlparse.c: Fix extraction of namespace prefix from XML name (#186) CWE ID: CWE-611
0
92,244
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: idToName(struct rx_call *call, idlist *aid, namelist *aname) { afs_int32 code; struct ubik_trans *tt; afs_int32 i; int size; int count = 0; /* leave this first for rpc stub */ size = aid->idlist_len; if (size == 0) return 0; if (size < 0 || size > INT_MAX / PR_MAXNAMELEN) re...
0
12,539
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bgp_notification_print(netdissect_options *ndo, const u_char *dat, int length) { struct bgp_notification bgpn; const u_char *tptr; ND_TCHECK2(dat[0], BGP_NOTIFICATION_SIZE); memcpy(&bgpn, dat, BGP_NOTIFICATION_SIZE); /* some little sanity checking */ if (length<BGP_NOT...
0
93,155
Analyze the following 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 DateTimeFieldElement::setReadOnly() { setBooleanAttribute(readonlyAttr, true); setNeedsStyleRecalc(); } Commit Message: INPUT_MULTIPLE_FIELDS_UI: Inconsistent value of aria-valuetext attribute https://bugs.webkit.org/show_bug.cgi?id=107897 Reviewed by Kentaro Hara. Source/WebCore: aria-valuetext ...
0
103,239
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: acpi_status acpi_os_delete_semaphore(acpi_handle handle) { struct semaphore *sem = (struct semaphore *)handle; if (!sem) return AE_BAD_PARAMETER; ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle)); BUG_ON(!list_empty(&sem->wait_list)); kfree(sem); sem = NULL; return AE_OK; } Comm...
0
53,838
Analyze the following 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 InputHandler::handleInputLocaleChanged(bool isRTL) { if (!isActiveTextEdit()) return; ASSERT(m_currentFocusElement->document() && m_currentFocusElement->document()->frame()); RenderObject* renderer = m_currentFocusElement->renderer(); if (!renderer) return; Editor* edito...
0
104,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: void HTMLIFrameElement::ParseAttribute( const AttributeModificationParams& params) { const QualifiedName& name = params.name; const AtomicString& value = params.new_value; if (name == nameAttr) { if (IsInDocumentTree() && GetDocument().IsHTMLDocument()) { HTMLDocument& document = ToHTMLDocumen...
0
150,346
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int hub_set_port_link_state(struct usb_hub *hub, int port1, unsigned int link_status) { return set_port_feature(hub->hdev, port1 | (link_status << 3), USB_PORT_FEAT_LINK_STATE); } Commit Message: USB: fix invalid memory access in hub_activate() Commit 8520f38099cc ("USB: change hub initializati...
0
56,773
Analyze the following 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 ApplyFilePathAlias(blink::WebURLRequest* request) { const base::CommandLine::StringType file_url_path_alias = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( switches::kFileUrlPathAlias); if (file_url_path_alias.empty()) return; const auto alias_mapping = base::...
0
139,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: poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) { if (! pool->ptr && ! poolGrow(pool)) { /* The following line is unreachable given the current usage of * poolCopyStringN(). Currently it is called from exactly one * place to copy the text of a simple general entity. By that * p...
0
88,296
Analyze the following 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 comps_mrtree_data_destroy(COMPS_MRTreeData * rtd) { free(rtd->key); comps_hslist_destroy(&rtd->data); comps_hslist_destroy(&rtd->subnodes); free(rtd); } Commit Message: Fix UAF in comps_objmrtree_unite function The added field is not used at all in many places and it is probably the left-ov...
0
91,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: bool checkComposite(StateBase* top) { ASSERT(top); if (m_depth > maxDepth) return false; if (!shouldCheckForCycles(m_depth)) return true; v8::Handle<v8::Value> composite = top->composite(); for (StateBase* state = top->nextState(); state; sta...
0
120,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: static WORD32 ihevcd_parse_sub_layer_hrd_parameters(bitstrm_t *ps_bitstrm, sub_lyr_hrd_params_t *ps_sub_layer_hrd_params, WORD32 cpb_cnt, WORD32 sub_pic_cpb_params_present_flag) { WORD32 ret = (IHEVCD_ERRO...
0
162,352
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __attribute__((no_instrument_function)) trace_swap_gd(void) { } Commit Message: Merge branch '2020-01-22-master-imports' - Re-add U8500 platform support - Add bcm968360bg support - Assorted Keymile fixes - Other assorted bugfixes CWE ID: CWE-787
0
89,405
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebKeyEvent::WebKeyEvent(automation::KeyEventTypes type, ui::KeyboardCode key_code, const std::string& unmodified_text, const std::string& modified_text, int modifiers) : type(type), key_code(key_code), ...
0
100,689
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AP_DECLARE(void) ap_register_errorlog_handler(apr_pool_t *p, char *tag, ap_errorlog_handler_fn_t *handler, int flags) { ap_errorlog_handler *log_struct = apr_palloc(p, sizeof(*log_struct)); log_struct->func = handl...
0
64,208
Analyze the following 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 shouldFlipBeforeAfterMargins(const RenderStyle* containingBlockStyle, const RenderStyle* childStyle) { ASSERT(containingBlockStyle->isHorizontalWritingMode() != childStyle->isHorizontalWritingMode()); WritingMode childWritingMode = childStyle->writingMode(); bool shouldFlip = false; sw...
0
116,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: void Browser::OpenAboutChromeDialog() { UserMetrics::RecordAction(UserMetricsAction("AboutChrome")); #if defined(OS_CHROMEOS) std::string chrome_settings(chrome::kChromeUISettingsURL); ShowSingletonTab(GURL(chrome_settings.append(chrome::kAboutOptionsSubPage))); #else window_->ShowAboutChromeDialog(); #en...
0
97,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: ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC) { ftpbuf_t *ftp; socklen_t size; struct timeval tv; /* alloc the ftp structure */ ftp = ecalloc(1, sizeof(*ftp)); tv.tv_sec = timeout_sec; tv.tv_usec = 0; ftp->fd = php_network_connect_socket_to_host(host, (unsigned short) (port ...
0
14,799
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ieee80211_iface_exit(void) { unregister_netdevice_notifier(&mac80211_netdev_notifier); } Commit Message: net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume tha...
0
24,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: icc_base_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv) { const fz_colorspace *srcs = cc->ss; float local_src_map[FZ_MAX_COLORS]; float local_src_map2[FZ_MAX_COLORS]; float *src_map = local_src_map; do { srcs->to_ccs(ctx, srcs, srcv, src_map); srcs = srcs->get_base...
0
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: status_t IPCThreadState::requestDeathNotification(int32_t handle, BpBinder* proxy) { mOut.writeInt32(BC_REQUEST_DEATH_NOTIFICATION); mOut.writeInt32((int32_t)handle); mOut.writePointer((uintptr_t)proxy); return NO_ERROR; } Commit Message: Fix issue #27252896: Security Vulnerability -- weak binder S...
0
161,158
Analyze the following 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 SoftG711::onQueueFilled(OMX_U32 /* portIndex */) { if (mSignalledError) { return; } List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); while (!inQueue.empty() && !outQueue.empty()) { BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHe...
0
163,984
Analyze the following 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 get_openreq4(struct sock *sk, struct request_sock *req, struct seq_file *f, int i, int uid, int *len) { const struct inet_request_sock *ireq = inet_rsk(req); int ttd = req->expires - jiffies; seq_printf(f, "%4d: %08X:%04X %08X:%04X" " %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %p%n", i, ...
0
18,993
Analyze the following 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 calculate_nss_hash( struct crypto_instance *instance, const unsigned char *buf, const size_t buf_len, unsigned char *hash) { PK11Context* hash_context = NULL; SECItem hash_param; unsigned int hash_tmp_outlen = 0; unsigned char hash_block[hash_block_len[instance->crypto_hash_type]]; int err =...
0
41,054
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: parse_METER(char *arg, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols) { *usable_protocols &= OFPUTIL_P_OF13_UP; return str_to_u32(arg, &ofpact_put_METER(ofpacts)->meter_id); } Commit Message: ofp-actions: Avoid buffer overread in BUNDLE action decoding. Reported-at: https:/...
0
77,052
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: prepare_task_switch(struct rq *rq, struct task_struct *prev, struct task_struct *next) { sched_info_switch(prev, next); perf_event_task_sched_out(prev, next); fire_sched_out_preempt_notifiers(prev, next); prepare_lock_switch(rq, next); prepare_arch_switch(next); trace_sched_switch(prev, next); } Comm...
0
26,317
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) { vm_flags_t vm_flags = vma->vm_flags; int write = (gup_flags & FOLL_WRITE); int foreign = (gup_flags & FOLL_REMOTE); if (vm_flags & (VM_IO | VM_PFNMAP)) return -EFAULT; if (gup_flags & FOLL_ANON && !vma_is_anonymous(vma)) ...
0
96,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: static void ssh_hostport_setup(const char *host, int port, Conf *conf, char **savedhost, int *savedport, char **loghost_ret) { char *loghost = conf_get_str(conf, CONF_loghost); if (loghost_ret) *loghost_ret = loghost; if (*loghost)...
0
8,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: void DatabaseImpl::IDBThreadHelper::Commit(int64_t transaction_id) { DCHECK(idb_thread_checker_.CalledOnValidThread()); if (!connection_->IsConnected()) return; IndexedDBTransaction* transaction = connection_->GetTransaction(transaction_id); if (!transaction) return; if (transaction->siz...
0
136,611
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int tracing_saved_cmdlines_open(struct inode *inode, struct file *filp) { if (tracing_disabled) return -ENODEV; return seq_open(filp, &tracing_saved_cmdlines_seq_ops); } Commit Message: Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixe...
0
81,508
Analyze the following 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 llc_sk_reset(struct sock *sk) { struct llc_sock *llc = llc_sk(sk); llc_conn_ac_stop_all_timers(sk, NULL); skb_queue_purge(&sk->sk_write_queue); skb_queue_purge(&llc->pdu_unack_q); llc->remote_busy_flag = 0; llc->cause_flag = 0; llc->retry_count = 0; llc_conn_set_p_flag(sk, 0); llc->f_flag = 0; l...
0
68,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: void RenderWidgetHostViewAura::InitAsFullscreen( RenderWidgetHostView* reference_host_view) { is_fullscreen_ = true; CreateDelegatedFrameHostClient(); CreateAuraWindow(ui::wm::WINDOW_TYPE_NORMAL); window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); aura::Window* parent = N...
0
132,249
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: HRESULT CGaiaCredentialBase::GetStringValue(DWORD field_id, wchar_t** value) { return GetStringValueImpl(field_id, value); } Commit Message: [GCPW] Disallow sign in of consumer accounts when mdm is enabled. Unless the registry key "mdm_aca" is explicitly set to 1, always fail sign in of consumer accounts when...
0
130,698
Analyze the following 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 SampleTable::setCompositionTimeToSampleParams( off64_t data_offset, size_t data_size) { ALOGI("There are reordered frames present."); if (mCompositionTimeDeltaEntries != NULL || data_size < 8) { return ERROR_MALFORMED; } uint8_t header[8]; if (mDataSource->readAt( data_offset,...
1
173,337
Analyze the following 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 GDataFileSystem::CloseFileOnUIThread( const FilePath& file_path, const FileOperationCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (open_files_.find(file_path) == open_files_.end()) { MessageLoop::current()->PostTask( FROM_HERE, base::Bind(cal...
0
116,927
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ACodec::BaseState::onOMXMessageList(const sp<AMessage> &msg) { sp<RefBase> obj; CHECK(msg->findObject("messages", &obj)); sp<MessageList> msgList = static_cast<MessageList *>(obj.get()); bool receivedRenderedEvents = false; for (std::list<sp<AMessage>>::const_iterator it = msgList->getList().c...
0
164,108
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const SSL_CIPHER *dtls1_get_cipher(unsigned int u) { const SSL_CIPHER *ciph = ssl3_get_cipher(u); if (ciph != NULL) { if (ciph->algorithm_enc == SSL_RC4) return NULL; } return ciph; } Commit Message: CWE ID:
0
6,492
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: camera_metadata_t *allocate_camera_metadata(size_t entry_capacity, size_t data_capacity) { size_t memory_needed = calculate_camera_metadata_size(entry_capacity, data_capacity); void *buffer = malloc(memory_needed); return place_camera_metadata(buffer,...
0
157,916
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, js...
0
101,389
Analyze the following 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 updateProgramMapPID(unsigned programMapPID) { mProgramMapPID = programMapPID; } Commit Message: Check section size when verifying CRC Bug: 28333006 Change-Id: Ief7a2da848face78f0edde21e2f2009316076679 CWE ID: CWE-119
0
160,520