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 PDFiumEngine::GetTextRunInfo(int page_index, int start_char_index, uint32_t* out_len, double* out_font_size, pp::FloatRect* out_bounds) { DCHECK(page_index >= 0 && page_in...
0
140,355
Analyze the following 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 trace_module_notify(struct notifier_block *self, unsigned long val, void *data) { struct module *mod = data; switch (val) { case MODULE_STATE_COMING: trace_module_add_evals(mod); break; case MODULE_STATE_GOING: trace_module_remove_evals(mod); break; } return 0; } Commit Messa...
0
81,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: bool ExtensionViewGuest::CanRunInDetachedState() const { return true; } Commit Message: Make extensions use a correct same-origin check. GURL::GetOrigin does not do the right thing for all types of URLs. BUG=573317 Review URL: https://codereview.chromium.org/1658913002 Cr-Commit-Position: refs/heads/master...
0
132,989
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: UNCURL_EXPORT int32_t uncurl_parse_url(char *url, struct uncurl_info *uci) { memset(uci, 0, sizeof(struct uncurl_info)); return http_parse_url(url, &uci->scheme, &uci->host, &uci->port, &uci->path); } Commit Message: origin matching must come at str end CWE ID: CWE-352
0
84,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 opj_bool pi_next_lrcp(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; long index = 0; if (!pi->first) { comp = &pi->comps[pi->compno]; res = &comp->resolutions[pi->resno]; goto LABEL_SKIP; } else { pi->first = 0; ...
0
92,235
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool HevcParameterSets::findParam8(uint32_t key, uint8_t *param) { return findParam(key, param, mParams); } Commit Message: Validate lengths in HEVC metadata parsing Add code to validate the size parameter passed to HecvParameterSets::addNalUnit(). Previously vulnerable to decrementing an unsigned past 0, yie...
0
162,390
Analyze the following 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 AutocompleteEditModel::AcceptCurrentInstantPreview() { return InstantController::CommitIfCurrent(controller_->GetInstant()); } Commit Message: Adds per-provider information to omnibox UMA logs. Adds a fairly general structure to omnibox logs that can be used to pass information (that's not per-result inf...
0
103,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 void voidMethodDocumentTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); TestObjectPythonV8Internal::voidMethodDocumentTypeArgMethod(info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); } Commit Message: docume...
0
122,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: static const QualifiedName& frameOwnerURLAttributeName(const HTMLFrameOwnerElement& frameOwner) { return isHTMLObjectElement(frameOwner) ? HTMLNames::dataAttr : HTMLNames::srcAttr; } Commit Message: Escape "--" in the page URL at page serialization This patch makes page serializer to escape the page URL emb...
0
125,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: finish_info_provider (NautilusDirectory *directory, NautilusFile *file, NautilusInfoProvider *provider) { file->details->pending_info_providers = g_list_remove (file->details->pending_info_providers, provider); g_object_...
0
60,904
Analyze the following 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 addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao) { struct prefix_info *pinfo; __u32 valid_lft; __u32 prefered_lft; int addr_type; struct inet6_dev *in6_dev; struct net *net = dev_net(dev); pinfo = (struct prefix_info *) opt; if (len < sizeof(struct prefix_info)) { ADBG("a...
0
41,790
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MessageService::~MessageService() { STLDeleteContainerPairSecondPointers(channels_.begin(), channels_.end()); channels_.clear(); } Commit Message: Do not pass URLs in onUpdated events to extensions unless they have the "tabs" permission. BUG=168442 Review URL: https://chromiumcodereview.appspot.com/118240...
0
116,006
Analyze the following 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::UpdateToolbar(bool should_restore_state) { window_->UpdateToolbar(chrome::GetActiveTabContents(this), should_restore_state); } Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumco...
0
117,843
Analyze the following 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 perf_event_task_disable(void) { struct perf_event_context *ctx; struct perf_event *event; mutex_lock(&current->perf_event_mutex); list_for_each_entry(event, &current->perf_event_list, owner_entry) { ctx = perf_event_ctx_lock(event); perf_event_for_each_child(event, _perf_event_disable); perf_event_...
0
56,105
Analyze the following 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::OpenHelpWindow(Profile* profile) { Browser* browser = Browser::Create(profile); browser->OpenHelpTab(); browser->window()->Show(); } Commit Message: chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify b...
0
98,277
Analyze the following 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 em_bswap(struct x86_emulate_ctxt *ctxt) { switch (ctxt->op_bytes) { #ifdef CONFIG_X86_64 case 8: asm("bswap %0" : "+r"(ctxt->dst.val)); break; #endif default: asm("bswap %0" : "+r"(*(u32 *)&ctxt->dst.val)); break; } return X86EMUL_CONTINUE; } Commit Message: KVM: emulate: avoid accessing ...
0
35,517
Analyze the following 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 PageInfoBubbleView::DidStartNavigation(content::NavigationHandle* handle) { GetWidget()->Close(); } Commit Message: Desktop Page Info/Harmony: Show close button for internal pages. The Harmony version of Page Info for internal Chrome pages (chrome://, chrome-extension:// and view-source:// pages) show a ...
0
133,987
Analyze the following 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 net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, struct list_head **iter) { struct netdev_adjacent *upper; WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held()); upper = list_entry_rcu((*iter)->next, struct netdev_adjacent, list); if (&upper->list == &dev->al...
0
48,865
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool SimplifiedBackwardsTextIterator::handleTextNode() { m_lastTextNode = m_node; int startOffset; int offsetInNode; RenderText* renderer = handleFirstLetter(startOffset, offsetInNode); if (!renderer) return true; String text = renderer->text(); if (!renderer->firstTextBox() ...
1
171,311
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ServiceWorkerContextCore::ProviderHostIterator::ProviderHostIterator( ProviderByIdMap* map, ProviderHostPredicate predicate) : map_(map), predicate_(std::move(predicate)), provider_host_iterator_(map_->begin()) { ForwardUntilMatchingProviderHost(); } Commit Message: Convert FrameHostMsg...
0
139,481
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int may_flags, struct file **filp) { struct path path; struct inode *inode; struct file *file; int flags = O_RDONLY|O_LARGEFILE; __be32 err; int host_err = 0; validate_process_creds(); /* * If we get here, then the client has al...
0
65,897
Analyze the following 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 XMLHttpRequest::clearResponseBuffers() { m_responseText.clear(); m_responseEncoding = String(); m_createdDocument = false; m_responseDocument = 0; m_responseBlob = 0; m_responseStream = 0; m_binaryResponseBuilder.clear(); m_responseArrayBuffer.clear(); } Commit Message: Don't...
0
110,905
Analyze the following 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 vnc_jobs_clear(VncState *vs) { VncJob *job, *tmp; vnc_lock_queue(queue); QTAILQ_FOREACH_SAFE(job, &queue->jobs, next, tmp) { if (job->vs == vs || !vs) { QTAILQ_REMOVE(&queue->jobs, job, next); } } vnc_unlock_queue(queue); } Commit Message: CWE ID: CWE-125
0
17,906
Analyze the following 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 double clip(void *opaque, double val) { LutContext *s = opaque; double minval = s->var_values[VAR_MINVAL]; double maxval = s->var_values[VAR_MAXVAL]; return av_clip(val, minval, maxval); } Commit Message: avfilter: fix plane validity checks Fixes out of array accesses Signed-off-by: Mic...
0
29,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: explicit ElementsAccessorBase(const char* name) : ElementsAccessor(name) { } Commit Message: Backport: Fix Object.entries/values with changing elements Bug: 111274046 Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \ /data/nativetest64/proxy_resolver_v8_unittest/proxy_resolver_v8_unittes...
1
174,095
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) { cJSON *item = cJSON_New_Item(&global_hooks); if (item != NULL) { item->type = cJSON_String | cJSON_IsReference; item->valuestring = (char*)cast_away_const(string); } return item; } Commit Message: Fix cra...
0
87,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: htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag) { while ((newtag != NULL) && (ctxt->name != NULL) && (htmlCheckAutoClose(newtag, ctxt->name))) { if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL)) ctxt->sax->endElement(ctxt->userData, ctxt->name); htmlname...
0
150,757
Analyze the following 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 long do_splice_to(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags) { ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); int ret; if (unlikely(!(in->f_mode & FMODE_READ))) return -EBADF; ret =...
0
46,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: poppler_page_get_thumbnail_size (PopplerPage *page, int *width, int *height) { Object thumb; Dict *dict; gboolean retval = FALSE; g_return_val_if_fail (POPPLER_IS_PAGE (page), FALSE); g_return_val_if_fail (width != NULL, FALSE); g_return_val_if_fail (height != NULL, FALSE); ...
0
794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CameraService::BasicClient::BasicClient(const sp<CameraService>& cameraService, const sp<IBinder>& remoteCallback, const String16& clientPackageName, int cameraId, int cameraFacing, int clientPid, uid_t clientUid, int servicePid): mClientPackageName(clientPackageName) { mCameraService = cameraSer...
0
161,657
Analyze the following 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 char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit) { int extdatalen=0; unsigned char *orig = buf; unsigned char *ret = buf; #ifndef OPENSSL_NO_NEXTPROTONEG int next_proto_neg_seen; #endif /* don't add extensions for SSLv3, unless doing secure renegotiation */ if (s...
0
12,237
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ResourceFetcher::storeResourceTimingInitiatorInformation(Resource* resource) { if (resource->options().requestInitiatorContext != DocumentContext) return; RefPtr<ResourceTimingInfo> info = ResourceTimingInfo::create(resource->options().initiatorInfo.name, monotonicallyIncreasingTime()); ...
0
121,283
Analyze the following 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 rt_set_nexthop(struct rtable *rt, __be32 daddr, const struct fib_result *res, struct fib_nh_exception *fnhe, struct fib_info *fi, u16 type, u32 itag, const bool do_cache) { bool cached = false; if (fi) { struct fib_nh *nh = &FIB_RES_NH(*res); if (nh->nh_gw && nh->nh_sco...
0
62,080
Analyze the following 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 FlagsState::IsRestartNeededToCommitChanges() { return needs_restart_; } Commit Message: [Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139462 0039d316-...
0
104,816
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void js_pushboolean(js_State *J, int v) { CHECKSTACK(1); STACK[TOP].type = JS_TBOOLEAN; STACK[TOP].u.boolean = !!v; ++TOP; } Commit Message: CWE ID: CWE-119
0
13,458
Analyze the following 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_map_lookup_virt(void __iomem *virt, acpi_size size) { struct acpi_ioremap *map; list_for_each_entry_rcu(map, &acpi_ioremaps, list) if (map->virt <= virt && virt + size <= map->virt + map->size) return map; return NULL; } Commit Message: acpi: Disable ACPI table override if securelevel is set...
0
53,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: FFmpegVideoDecoder::~FFmpegVideoDecoder() { DCHECK_EQ(kUninitialized, state_); DCHECK(!codec_context_); DCHECK(!av_frame_); } Commit Message: Replicate FFmpeg's video frame allocation strategy. This should avoid accidental overreads and overwrites due to our VideoFrame's not being as large as FFmpeg expec...
0
121,360
Analyze the following 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 ExecuteUnderline(LocalFrame& frame, Event*, EditorCommandSource source, const String&) { CSSIdentifierValue* underline = CSSIdentifierValue::Create(CSSValueUnderline); return ExecuteToggleStyleInList( fram...
0
128,620
Analyze the following 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 acm_alloc_minor(struct acm *acm) { int minor; mutex_lock(&acm_minors_lock); minor = idr_alloc(&acm_minors, acm, 0, ACM_TTY_MINORS, GFP_KERNEL); mutex_unlock(&acm_minors_lock); return minor; } Commit Message: USB: cdc-acm: more sanity checking An attack has become available which pretends to be...
0
54,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: resolve_properties(fz_context *ctx, pdf_csi *csi, pdf_obj *obj) { if (pdf_is_name(ctx, obj)) return pdf_dict_get(ctx, pdf_dict_get(ctx, csi->rdb, PDF_NAME_Properties), obj); else return obj; } Commit Message: CWE ID: CWE-20
0
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: void DocumentLoader::setDefersLoading(bool defers) { if (mainResourceLoader() && mainResourceLoader()->documentLoader() == this) mainResourceLoader()->setDefersLoading(defers); setAllDefersLoading(m_subresourceLoaders, defers); setAllDefersLoading(m_plugInStreamLoaders, defers); if (!defe...
0
105,750
Analyze the following 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_postinit(H264Context *h, int setup_finished) { H264Picture *out = h->cur_pic_ptr; H264Picture *cur = h->cur_pic_ptr; int i, pics, out_of_order, out_idx; h->cur_pic_ptr->f.pict_type = h->pict_type; if (h->next_output_pic) return; if (cur->field_poc[0] == INT_MA...
0
43,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: static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, struct xfrm_policy *xp, int dir) { struct net *net = xs_net(x); struct sk_buff *skb; skb = nlmsg_new(xfrm_acquire_msgsize(x, xp), GFP_ATOMIC); if (skb == NULL) return -ENOMEM; if (build_acquire(skb, x, xt, xp, dir) < 0) BU...
0
33,172
Analyze the following 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 WebContentsImpl::IsHidden() { return !IsBeingCaptured() && visibility_ != Visibility::VISIBLE; } Commit Message: Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not ...
0
144,988
Analyze the following 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 TestRenderWidgetHostView::StopSpeaking() {} Commit Message: Correctly reset FP in RFHI whenever origin changes Bug: 713364 Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Change-Id: Id8bb923750e20f3db6fc9358b1d44120513ac95f Revi...
0
127,949
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ref_param_read_string_array(gs_param_list * plist, gs_param_name pkey, gs_param_string_array * pvalue) { iparam_list *const iplist = (iparam_list *) plist; iparam_loc loc; ref aref; int code = ref_param_read_array(iplist, pkey, &loc); gs_param_string *psv; uint ...
0
3,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 RenderProcessHostImpl::RemovePendingView() { DCHECK(pending_views_); pending_views_--; UpdateProcessPriority(); } Commit Message: Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the me...
0
149,325
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::SaveWindowPlacement(const gfx::Rect& bounds, ui::WindowShowState show_state) { SessionService* session_service = SessionServiceFactory::GetForProfileIfExisting(profile()); if (session_service) session_service->SetWindowBounds(session_id_, bounds, show_...
0
97,355
Analyze the following 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 CSSStyleSheet::MatchesMediaQueries(const MediaQueryEvaluator& evaluator) { viewport_dependent_media_query_results_.clear(); device_dependent_media_query_results_.clear(); if (!media_queries_) return true; return evaluator.Eval(*media_queries_, &viewport_dependent_media_qu...
0
153,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: void SkiaOutputSurfaceImpl::CopyOutput( RenderPassId id, const copy_output::RenderPassGeometry& geometry, const gfx::ColorSpace& color_space, std::unique_ptr<CopyOutputRequest> request) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!request->has_result_task_runner()) request->set_r...
0
135,952
Analyze the following 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 OfflinePageModelTaskified::GetOfflineIdsForClientId( const ClientId& client_id, const MultipleOfflineIdCallback& callback) { auto task = GetPagesTask::CreateTaskMatchingClientIds( store_.get(), base::Bind(&WrapInMultipleItemsCallback, callback), {client_id}); task_queue_.AddTask(std::...
0
155,831
Analyze the following 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 Proceed() { interstitial_page_->Proceed(); } Commit Message: Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b...
0
110,543
Analyze the following 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 nick_hash_add(CHANNEL_REC *channel, NICK_REC *nick) { NICK_REC *list; nick->next = NULL; list = g_hash_table_lookup(channel->nicks, nick->nick); if (list == NULL) g_hash_table_insert(channel->nicks, nick->nick, nick); else { /* multiple nicks with same name */ while (...
0
63,676
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: cmsBool isabsolutepath(const char *path) { char ThreeChars[4]; if(path == NULL) return FALSE; if (path[0] == 0) return FALSE; strncpy(ThreeChars, path, 3); ThreeChars[3] = 0; if(ThreeChars[0] == DIR_CHAR) return TRUE; #ifdef CMS_IS_WINDOWS_ if (isalpha((int...
0
78,092
Analyze the following 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 P2PSocketDispatcherHost::OnDestroySocket(const IPC::Message& msg, int socket_id) { SocketsMap::iterator it = sockets_.find( ExtendedSocketId(msg.routing_id(), socket_id)); if (it != sockets_.end()) { delete it->second; sockets_.erase(it); } el...
0
98,466
Analyze the following 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 nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; struct wireless_dev *wdev = dev->ieee80211_ptr; int err; if (!rdev->ops->del_beacon) return -EOPNOTSUPP; if (dev->ieee8021...
0
26,670
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Session* SessionManager::GetSession(const std::string& id) const { std::map<std::string, Session*>::const_iterator it; base::AutoLock lock(map_lock_); it = map_.find(id); if (it == map_.end()) { VLOG(1) << "No such session with ID " << id; return NULL; } return it->second; } Commit Mess...
1
170,463
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _tls_set_certificate (SSL_CTX * ctx, const char *cn) { #ifdef HAVE_WINCRYPT_H PCCERT_CONTEXT pCertCtx; X509 *cert = NULL; HCERTSTORE hStore = CertOpenSystemStore (0, L"CA"); for (pCertCtx = CertEnumCertificatesInStore (hStore, NULL); pCertCtx != NULL; pCertCtx = CertEnumCertificatesInStore (hStore, pCert...
0
17,299
Analyze the following 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 md5_sparc64_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct md5_state *sctx = shash_desc_ctx(desc); unsigned int partial = sctx->byte_count % MD5_HMAC_BLOCK_SIZE; /* Handle the fast case right here */ if (partial + len < MD5_HMAC_BLOCK_SIZE) { sctx->byte_count...
0
46,784
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: DevToolsWindow::InspectedWebContentsObserver::InspectedWebContentsObserver( content::WebContents* web_contents) : WebContentsObserver(web_contents) { } Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception This patch fixes the crash which happenes und...
0
113,177
Analyze the following 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 Tab::ShouldRenderAsNormalTab() const { return !data().pinned || (width() >= (TabStyle::GetPinnedWidth() + kPinnedTabExtraWidthToRenderAsNormal)); } Commit Message: Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. *...
0
140,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: bit_overlay(VarBit *t1, VarBit *t2, int sp, int sl) { VarBit *result; VarBit *s1; VarBit *s2; int sp_pl_sl; /* * Check for possible integer-overflow cases. For negative sp, throw a * "substring length" error because that's what should be expected * according to the spec's definition of OVE...
0
39,072
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType LevelImage(Image *image,const double black_point, const double white_point,const double gamma,ExceptionInfo *exception) { #define LevelImageTag "Level/Image" CacheView *image_view; MagickBooleanType status; MagickOffsetType progress; register ssize_t i...
0
50,553
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) { if (source == cookie_dialog_link_) { presenter_->RecordWebsiteSettingsAction( WebsiteSettings::WEBSITE_SETTINGS_COOKIES_DIALOG_OPENED); if (web_contents_ != NULL) new CollectedCookiesViews(web_contents_); } els...
0
125,222
Analyze the following 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_conf_from_info(struct fst_card_info *card, struct fst_port_info *port, struct fstioc_info *info) { int err; unsigned char my_framing; /* Set things according to the user set valid flags * Several of the old options have been invalidated/replaced by the * generic hdlc package. */ err = 0; if...
0
39,545
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err elst_dump(GF_Box *a, FILE * trace) { GF_EditListBox *p; u32 i; GF_EdtsEntry *t; p = (GF_EditListBox *)a; gf_isom_box_dump_start(a, "EditListBox", trace); fprintf(trace, "EntryCount=\"%d\">\n", gf_list_count(p->entryList)); i=0; while ((t = (GF_EdtsEntry *)gf_list_enum(p->entryList, &i))) { fpri...
0
80,723
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ScriptPromise ImageCapture::getPhotoSettings(ScriptState* script_state) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); if (!service_) { resolver->Reject(DOMException::Create(kNotFoundError, kNoServiceError)); return prom...
0
151,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: X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8) { return ASN1_d2i_fp_of(X509_SIG,X509_SIG_new,d2i_X509_SIG,fp,p8); } Commit Message: Fix various certificate fingerprint issues. By using non-DER or invalid encodings outside the signed portion of a certificate the fingerprint can be changed without breaking th...
0
94,647
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: char * SafeSock::serialize(char *buf) { char sinful_string[28]; char usernamebuf[128]; char *ptmp, *ptr = NULL; ASSERT(buf); memset(sinful_string, 0, 28); memset(usernamebuf, 0, 128); ptmp = Sock::serialize(buf); ASSERT( ptmp ); int itmp; sscanf(ptmp,"%d*",&itmp); _special_state=safesock_st...
0
16,295
Analyze the following 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 NavigationRateLimiter::CanProceed() { if (!enabled) return true; static constexpr int kStateUpdateLimit = 200; static constexpr base::TimeDelta kStateUpdateLimitResetInterval = base::TimeDelta::FromSeconds(10); if (++count_ <= kStateUpdateLimit) return true; const base::TimeTicks n...
1
172,491
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev, unsigned long end) { struct vm_area_struct **insertion_point; struct vm_area_struct *tail_vma = NULL; insertion_point = (prev ? &prev->vm_next : &mm->mmap); vma->vm_prev = NULL; do { vma_rb_erase(vma...
0
90,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: static BOOL region16_simplify_bands(REGION16* region) { /** Simplify consecutive bands that touch and have the same items * * ==================== ==================== * | 1 | | 2 | | | | | * ==================== | | | | * | 1 | | 2 | =...
1
169,497
Analyze the following 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::addPlugInStreamLoader(ResourceLoader* loader) { m_plugInStreamLoaders.add(loader); } Commit Message: Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id=112903 Source/WebCore: * dom/Document.cpp: (WebCore::Document::processH...
0
105,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: static struct hlist_head * __net_init netdev_create_hash(void) { int i; struct hlist_head *hash; hash = kmalloc(sizeof(*hash) * NETDEV_HASHENTRIES, GFP_KERNEL); if (hash != NULL) for (i = 0; i < NETDEV_HASHENTRIES; i++) INIT_HLIST_HEAD(&hash[i]); return hash; } Commit Message: tunnels: Don't apply GR...
0
48,868
Analyze the following 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 qeth_query_setadapterparms_cb(struct qeth_card *card, struct qeth_reply *reply, unsigned long data) { struct qeth_ipa_cmd *cmd; QETH_CARD_TEXT(card, 3, "quyadpcb"); cmd = (struct qeth_ipa_cmd *) data; if (cmd->data.setadapterparms.data.query_cmds_supp.lan_type & 0x7f) { card->info.link_type =...
0
28,617
Analyze the following 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 RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset) { if (!paintInfo.shouldPaintWithinRoot(this)) return; LayoutRect paintRect(paintOffset, size()); borderFitAdjust(paintRect); paintBoxShadow(paintInfo.context, paintRect, style(), Normal); Backg...
0
101,616
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc) { xmlParserCtxtPtr ctxt; xmlParserInputPtr inputStream; xmlParserInputBufferPtr buf; if (ioread == NULL) return(NULL); buf = xmlPars...
0
59,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: static int is_handler(const struct dirent *dirent) { if (strncmp(dirent->d_name, "handler_", 8)) return 0; return 1; } Commit Message: fixed local DoS when UnregisterHandler was called for a not existing handler Any user with DBUS access could cause a SEGFAULT in tcmu-runner by running something like this:...
0
59,038
Analyze the following 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 const char *valid_domain_label(const char *label) { unsigned char ch; if (label[0] == '-') return NULL; for (;;) { ch = *label; if ((ch|0x20) < 'a' || (ch|0x20) > 'z') { if (ch < '0' || ch > '9') { if (ch == '\0' || ch == '.') return label; /* DNS allows only '-', but we are more ...
0
8,784
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void QQuickWebViewExperimental::setFilePicker(QQmlComponent* filePicker) { Q_D(QQuickWebView); if (d->filePicker == filePicker) return; d->filePicker = filePicker; emit filePickerChanged(); } Commit Message: [Qt][WK2] There's no way to test the gesture tap on WTR https://bugs.webkit.org/s...
0
108,049
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XGetModifierMapping(register Display *dpy) { xGetModifierMappingReply rep; register xReq *req; unsigned long nbytes; XModifierKeymap *res; LockDisplay(dpy); GetEmptyReq(GetModifierMapping, req); (void) _XReply (dpy, (xReply *)&rep, 0, xFalse); if (rep.length < (INT_MAX >> 2)) ...
1
164,924
Analyze the following 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 HTMLFormControlElement::resultForDialogSubmit() { return fastGetAttribute(valueAttr); } Commit Message: Form validation: Do not show validation bubble if the page is invisible. BUG=673163 Review-Url: https://codereview.chromium.org/2572813003 Cr-Commit-Position: refs/heads/master@{#438476} CWE ID: CWE...
0
139,987
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint32_t virtio_config_modern_readl(VirtIODevice *vdev, uint32_t addr) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint32_t val; if (addr + sizeof(val) > vdev->config_len) { return (uint32_t)-1; } k->get_config(vdev, vdev->config); val = ldl_le_p(vdev->config + addr)...
0
9,182
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _movU(int n) { int i, m = searchKeyNum(); if (Currentbuf->firstLine == NULL) return; for (i = 0; i < m; i++) cursorUp(Currentbuf, n); displayBuffer(Currentbuf, B_NORMAL); } Commit Message: Make temporary directory safely when ~/.w3m is unwritable CWE ID: CWE-59
0
84,458
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: XGetDeviceControl( register Display *dpy, XDevice *dev, int control) { XDeviceControl *Device = NULL; XDeviceControl *Sav = NULL; xDeviceState *d = NULL; xDeviceState *sav = NULL; xGetDeviceControlReq *req; xGetDeviceControlReply rep; XExtDisplayInfo *info = XInput_find...
1
164,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: PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ExceptionCode& ec) { return create(element, CreatingAuthorShadowRoot, ec); } Commit Message: There are too many poorly named functions to create a fragment from markup https://bugs.webkit.org/show_bug.cgi?id=87339 Reviewed by Eric Seidel. Source/W...
0
100,298
Analyze the following 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 pagemap_pte_hole(unsigned long start, unsigned long end, struct mm_walk *walk) { struct pagemapread *pm = walk->private; unsigned long addr = start; int err = 0; while (addr < end) { struct vm_area_struct *vma = find_vma(walk->mm, addr); pagemap_entry_t pme = make_pme(PM_NOT_PRESENT(pm->v2...
0
55,805
Analyze the following 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 CursorImpl::PrefetchReset( int32_t used_prefetches, int32_t unused_prefetches, const std::vector<std::string>& unused_blob_uuids) { for (const auto& uuid : unused_blob_uuids) dispatcher_host_->DropBlobData(uuid); idb_runner_->PostTask( FROM_HERE, base::Bind(&IDBThreadHelper::...
0
135,537
Analyze the following 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 raw_cmd_copyout(int cmd, void __user *param, struct floppy_raw_cmd *ptr) { int ret; while (ptr) { ret = copy_to_user(param, ptr, sizeof(*ptr)); if (ret) return -EFAULT; param += sizeof(struct floppy_raw_cmd); if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { if (ptr->...
1
166,434
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n) { return radix_tree_lookup(&nm_i->nat_root, n); } Commit Message: f2fs: fix race condition in between free nid allocator/initializer In below concurrent case, allocated nid can be loaded into free nid cache and be allocated again. ...
0
85,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: static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsN...
0
122,021
Analyze the following 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 ParamTraits<GURL>::Log(const GURL& p, std::string* l) { l->append(p.spec()); } Commit Message: Beware of print-read inconsistency when serializing GURLs. BUG=165622 Review URL: https://chromiumcodereview.appspot.com/11576038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173583 0039d316-1c4b-4281-...
0
117,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: static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu) { u8 val; if (pv_eoi_get_user(vcpu, &val) < 0) apic_debug("Can't read EOI MSR value: 0x%llx\n", (unsigned long long)vcpi->arch.pv_eoi.msr_val); return val & 0x1; } Commit Message: KVM: x86: fix guest-initiated crash with x2apic (CVE-2013-6376) A g...
0
28,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: DailyDataSavingUpdate( const char* pref_original, const char* pref_received, PrefService* pref_service) : pref_original_(pref_original), pref_received_(pref_received), original_update_(pref_service, pref_original_), received_update_(pref_service, pref_received_) { ...
1
171,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 int parse_check_done(struct jv_parser* p, jv* out) { if (p->stackpos == 0 && jv_is_valid(p->next)) { *out = p->next; p->next = jv_invalid(); return 1; } else { return 0; } } Commit Message: Heap buffer overflow in tokenadd() (fix #105) This was an off-by one: the NUL terminator byte...
0
56,390
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: browser::NavigateParams Browser::GetSingletonTabNavigateParams( const GURL& url) { browser::NavigateParams params(this, url, PageTransition::AUTO_BOOKMARK); params.disposition = SINGLETON_TAB; params.window_action = browser::NavigateParams::SHOW_WINDOW; params.user_gesture = true; return params; } ...
0
97,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: void HTMLMediaElement::didRecalcStyle() { if (layoutObject()) layoutObject()->updateFromElement(); } Commit Message: [Blink>Media] Allow autoplay muted on Android by default There was a mistake causing autoplay muted is shipped on Android but it will be disabled if the chromium embedder doesn't specify co...
0
128,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 ScriptProfiler::visitNodeWrappers(WrappedNodeVisitor* visitor) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handleScope(isolate); class DOMNodeWrapperVisitor : public v8::PersistentHandleVisitor { public: DOMNodeWrapperVisitor(WrappedNodeVisitor* visitor, v8::I...
0
102,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: pin_and_fence_object(struct drm_i915_gem_object *obj, struct intel_ring_buffer *ring) { struct drm_i915_gem_exec_object2 *entry = obj->exec_entry; bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4; bool need_fence, need_mappable; int ret; need_fence = has_fenced_gpu_access && entry->fla...
0
19,797
Analyze the following 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 led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); struct usb_device *hdev = hub->hdev; unsigned i; unsigned changed = 0; int cursor = -1; if (hdev->state != USB_STATE_CONFIGURED || hub->quiescing) return; for (i = 0; i < hdev->m...
0
56,778