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: static int32_t getColorFormat(const char* colorFormat) { if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV420P)) { return OMX_COLOR_FormatYUV420Planar; } if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV422SP)) { return OMX_COLOR_FormatYUV422SemiPlanar; } if (!strcmp(colorFormat, Came...
0
16,205
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: long long VideoTrack::GetWidth() const { return m_width; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c8...
0
15,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: static struct bmc_device *ipmi_find_bmc_guid(struct device_driver *drv, guid_t *guid) { struct device *dev; struct bmc_device *bmc = NULL; dev = driver_find_device(drv, NULL, guid, __find_bmc_guid); if (dev) { bmc = to_bmc_device(dev); put_device(dev); } return bmc; } Commit Message: ipmi: f...
0
22,930
Analyze the following 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 WorkerProcessLauncherTest::KillProcess(DWORD exit_code) { exit_code_ = exit_code; BOOL result = SetEvent(process_exit_event_); EXPECT_TRUE(result); } Commit Message: Validate and report peer's PID to WorkerProcessIpcDelegate so it will be able to duplicate handles to and from the worker process. ...
1
763
Analyze the following 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 kvm_arch_destroy_vm(struct kvm *kvm) { if (current->mm == kvm->mm) { /* * Free memory regions allocated on behalf of userspace, * unless the the memory map has changed due to process exit * or fd copying. */ struct kvm_userspace_memory_region mem; memset(&mem, 0, sizeof(mem)); mem.slot =...
0
16,348
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Node* Document::adoptNode(Node* source, ExceptionState& exception_state) { EventQueueScope scope; switch (source->getNodeType()) { case kDocumentNode: exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError, "The node provided is of type '" + ...
0
13,162
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: LayoutUnit RenderBlock::startAlignedOffsetForLine(LayoutUnit position, bool firstLine) { ETextAlign textAlign = style()->textAlign(); if (textAlign == TASTART) // FIXME: Handle TAEND here return startOffsetForLine(position, firstLine); float totalLogicalWidth = 0; float logicalLeft = log...
0
18,577
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: launch_location_list_free (GList *list) { g_list_foreach (list, (GFunc) launch_location_free, NULL); g_list_free (list); } Commit Message: mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed ic...
0
25,195
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size > 512) return 0; net::ProxyBypassRules rules; std::string input(data, data + size); rules.ParseFromString(input); rules.ParseFromStringUsingSuffixMatching(input); return 0; } Commit Message: Implicitly bypass...
1
19,018
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: pgp_erase_card(sc_card_t *card) { /* Special series of commands to erase OpenPGP card, * according to https://www.crypto-stick.com/en/faq * (How to reset a Crypto Stick? question). * Gnuk is known not to support this feature. */ const char *apdu_hex[] = { /* block PIN1 */ "00:20:00:81:08:40:40:40:40:4...
0
18,321
Analyze the following 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 snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks) { struct snd_timer *timer; int result = -EINVAL; unsigned long flags; if (timeri == NULL || ticks < 1) return -EINVAL; if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) { result = snd_timer_start_slave(timeri); snd_timer_notify1(time...
0
27,605
Analyze the following 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 pptp_getname(struct socket *sock, struct sockaddr *uaddr, int *usockaddr_len, int peer) { int len = sizeof(struct sockaddr_pppox); struct sockaddr_pppox sp; memset(&sp.sa_addr, 0, sizeof(sp.sa_addr)); sp.sa_family = AF_PPPOX; sp.sa_protocol = PX_PROTO_PPTP; sp.sa_addr.pptp = pppox_sk(sock-...
0
27,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: MessageLoop::DestructionObserver::~DestructionObserver() { } Commit Message: Introduce RunLoop::Type::NESTABLE_TASKS_ALLOWED to replace MessageLoop::ScopedNestableTaskAllower. (as well as MessageLoop::SetNestableTasksAllowed()) Surveying usage: the scoped object is always instantiated right before RunLoop().Ru...
0
23,520
Analyze the following 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 qeth_core_init(void) { int rc; pr_info("loading core functions\n"); INIT_LIST_HEAD(&qeth_core_card_list.list); INIT_LIST_HEAD(&qeth_dbf_list); rwlock_init(&qeth_core_card_list.rwlock); mutex_init(&qeth_mod_mutex); qeth_wq = create_singlethread_workqueue("qeth_wq"); rc = qeth_register_...
0
12,717
Analyze the following 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 SVGEntityDeclaration(void *context,const xmlChar *name,int type, const xmlChar *public_id,const xmlChar *system_id,xmlChar *content) { SVGInfo *svg_info; /* An entity definition has been parsed. */ (void) LogMagickEvent(CoderEvent,GetMagickModule(), " SAX.entityDecl(%s, %d, %s,...
0
22,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: sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer) { int sector_size; struct scsi_device *sdp = sdkp->device; sector_t old_capacity = sdkp->capacity; if (sd_try_rc16_first(sdp)) { sector_size = read_capacity_16(sdkp, sdp, buffer); if (sector_size == -EOVERFLOW) goto got_data; if (sector...
0
26,094
Analyze the following 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 RenderViewTest::SetFocused(const WebKit::WebNode& node) { RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); impl->focusedNodeChanged(node); } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review ...
0
11,160
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GF_Err paen_AddBox(GF_Box *s, GF_Box *a) { FDPartitionEntryBox *ptr = (FDPartitionEntryBox *)s; switch(a->type) { case GF_ISOM_BOX_TYPE_FPAR: if (ptr->blocks_and_symbols) ERROR_ON_DUPLICATED_BOX(a, ptr) ptr->blocks_and_symbols = (FilePartitionBox *)a; return GF_OK; case GF_ISOM_BOX_TYPE_FECR: if (ptr-...
0
9,501
Analyze the following 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 assoc_array_insert_in_empty_tree(struct assoc_array_edit *edit) { struct assoc_array_node *new_n0; pr_devel("-->%s()\n", __func__); new_n0 = kzalloc(sizeof(struct assoc_array_node), GFP_KERNEL); if (!new_n0) return false; edit->new_meta[0] = assoc_array_node_to_ptr(new_n0); edit->leaf_p = &...
0
25,731
Analyze the following 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 bpf_flush_icache(void *start, void *end) { mm_segment_t old_fs = get_fs(); set_fs(KERNEL_DS); smp_wmb(); flush_icache_range((unsigned long)start, (unsigned long)end); set_fs(old_fs); } Commit Message: net: bpf_jit: fix an off-one bug in x86_64 cond jump target x86 jump instruction size ...
0
8,506
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: AccessibilityOrientation AXNodeObject::orientation() const { const AtomicString& ariaOrientation = getAOMPropertyOrARIAAttribute(AOMStringProperty::kOrientation); AccessibilityOrientation orientation = AccessibilityOrientationUndefined; if (equalIgnoringCase(ariaOrientation, "horizontal")) ori...
1
17,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: WebContents* Browser::OpenURLFromTab(WebContents* source, const OpenURLParams& params) { chrome::NavigateParams nav_params(this, params.url, params.transition); nav_params.source_contents = chrome::GetTabContentsAt(this, tab_strip_model_->GetIndexOfWebContents(source...
0
21,713
Analyze the following 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 ethernet_present(void) { uchar buf; int ret = 0; if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) { printf("%s: Error reading Boco\n", __func__); return -1; } if ((buf & MASK_RBX_PGY_PRESENT) == MASK_RBX_PGY_PRESENT) ret = 1; return ret; } Commit Message: Merge branch '2020-01-22-master-imports...
0
10,159
Analyze the following 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, pop) { spl_dllist_object *intern; if (zend_parse_parameters_none() == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); spl_ptr_llist_pop(intern->llist, return_value); if (Z_ISUNDEF_P(return_value)) { zend_throw_exception(spl_ce_RuntimeException, "Can't pop from ...
0
17,579
Analyze the following 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 ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on) { struct ib_uverbs_completion_event_file *comp_ev_file = filp->private_data; return fasync_helper(fd, filp, on, &comp_ev_file->ev_queue.async_queue); } Commit Message: coredump: fix race condition between mmget_not_zero()/get_task_mm(...
0
10,817
Analyze the following 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 AppResult::OnShutdown(extensions::ExtensionRegistry* registry) { DCHECK_EQ(extension_registry_, registry); StopObservingExtensionRegistry(); } Commit Message: [Extensions] Add GetInstalledExtension() method to ExtensionRegistry This CL adds GetInstalledExtension() method to ExtensionRegistry and uses i...
0
11,872
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void print_guid(ff_asf_guid *g) { int i; PRINT_IF_GUID(g, ff_asf_header); else PRINT_IF_GUID(g, ff_asf_file_header); else PRINT_IF_GUID(g, ff_asf_stream_header); else PRINT_IF_GUID(g, ff_asf_audio_stream); else PRINT_IF_GUID(g, ff_asf_audio_conceal_none); else PRINT_IF_GUID(g, f...
0
2,602
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FLAC__StreamDecoderReadStatus file_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) { (void)client_data; if(*bytes > 0) { *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, decoder->private_->file); if(ferror(decoder->private_->file)) return FLAC__STR...
0
16,934
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static char *skip_idf(char *start, char out_idf[256]) { char *s; char c; s = skip_white(start); if (s == NULL) { return NULL; } start = s; while (*s) { if (isalpha(*s) || *s == '_') { ++s; continue; } break; } c = *s; ...
0
10,148
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: u32 h264bsdStorePicParamSet(storage_t *pStorage, picParamSet_t *pPicParamSet) { /* Variables */ u32 id; /* Code */ ASSERT(pStorage); ASSERT(pPicParamSet); ASSERT(pPicParamSet->picParameterSetId < MAX_NUM_PIC_PARAM_SETS); ASSERT(pPicParamSet->seqParameterSetId < MAX_NUM_SEQ_PARAM_SETS); ...
0
17,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: void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest) { struct rds_message *rm, *tmp; struct rds_connection *conn; unsigned long flags; LIST_HEAD(list); /* get all the messages we're dropping under the rs lock */ spin_lock_irqsave(&rs->rs_lock, flags); list_for_each_entry_safe(rm, tmp, &rs...
0
21,901
Analyze the following 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 arch_init_sched_domains(const struct cpumask *cpu_map) { int err; arch_update_cpu_topology(); ndoms_cur = 1; doms_cur = alloc_sched_domains(ndoms_cur); if (!doms_cur) doms_cur = &fallback_doms; cpumask_andnot(doms_cur[0], cpu_map, cpu_isolated_map); dattr_cur = NULL; err = build_sched_domain...
0
23,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: MojoResult Core::WrapPlatformSharedBufferHandle( const MojoPlatformHandle* platform_handle, size_t size, const MojoSharedBufferGuid* guid, MojoPlatformSharedBufferHandleFlags flags, MojoHandle* mojo_handle) { DCHECK(size); ScopedPlatformHandle handle; MojoResult result = MojoPlatfo...
1
1,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: int32_t PPB_Flash_MessageLoop_Impl::InternalRun( const RunFromHostProxyCallback& callback) { if (state_->run_called()) { if (!callback.is_null()) callback.Run(PP_ERROR_FAILED); return PP_ERROR_FAILED; } state_->set_run_called(); state_->set_run_callback(callback); scoped_refptr<State>...
1
1,000
Analyze the following 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 hub_usb3_port_prepare_disable(struct usb_hub *hub, struct usb_port *port_dev) { } Commit Message: USB: check usb_get_extra_descriptor for proper size When reading an extra descriptor, we need to properly check the minimum and maximum size allowed, to prevent from invalid data being sen...
0
8,973
Analyze the following 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 GetDisplayRemovedMessage( const display::ManagedDisplayInfo& removed_display_info, base::string16* out_additional_message) { return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_REMOVED, base::UTF8ToUTF16(removed_display_info.name())); } Commit Message: Avoid Showin...
0
26,034
Analyze the following 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 copyIPv6IfDifferent(void * dest, const void * src) { if(dest != src) { memcpy(dest, src, sizeof(struct in6_addr)); } } Commit Message: pcpserver.c: copyIPv6IfDifferent() check for NULL src argument CWE ID: CWE-476
1
24,147
Analyze the following 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
28,503
Analyze the following 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 pmcraid_shutdown(struct pci_dev *pdev) { struct pmcraid_instance *pinstance = pci_get_drvdata(pdev); pmcraid_reset_bringdown(pinstance); } Commit Message: [SCSI] pmcraid: reject negative request size There's a code path in pmcraid that can be reached via device ioctl that causes all sorts of uglin...
0
3,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: void GLES2DecoderImpl::RestoreClearState() { framebuffer_state_.clear_state_dirty = true; api()->glClearColorFn(state_.color_clear_red, state_.color_clear_green, state_.color_clear_blue, state_.color_clear_alpha); api()->glClearStencilFn(state_.stencil_clear); api()->glClearDepthFn...
0
1,879
Analyze the following 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 gen_movs(DisasContext *s, TCGMemOp ot) { gen_string_movl_A0_ESI(s); gen_op_ld_v(s, ot, cpu_T0, cpu_A0); gen_string_movl_A0_EDI(s); gen_op_st_v(s, ot, cpu_T0, cpu_A0); gen_op_movl_T0_Dshift(ot); gen_op_add_reg_T0(s->aflag, R_ESI); gen_op_add_reg_T0(s->aflag, R_EDI); }...
0
20,454
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE5(add_key, const char __user *, _type, const char __user *, _description, const void __user *, _payload, size_t, plen, key_serial_t, ringid) { key_ref_t keyring_ref, key_ref; char type[32], *description; void *payload; long ret; ret = -EINVAL; if (plen > 1024 * 1024 - 1) goto error;...
1
21,309
Analyze the following 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 CALLBACK WinMain(HINSTANCE instance, HINSTANCE previous_instance, LPSTR command_line, int show_command) { #ifdef OFFICIAL_BUILD if (remoting::IsUsageStatsAllowed()) { remoting::InitializeCrashReporting(); } #endif // OFFICIAL_BUILD g_h...
0
6,642
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: FlagsStateSingleton() : flags_state_(std::make_unique<flags_ui::FlagsState>( kFeatureEntries, base::size(kFeatureEntries), base::Bind(&FlagsStateSingleton::IsFlagExpired))) {} Commit Message: Add Virtual Keyboard bordered key experiment to chrome flag BUG: b/143232594...
0
11,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 WebContentsImpl::CreateRenderWidgetHostViewForRenderManager( RenderViewHost* render_view_host) { RenderWidgetHostViewBase* rwh_view = view_->CreateViewForWidget(render_view_host->GetWidget(), false); if (rwh_view) rwh_view->SetSize(GetSizeForNewRenderView()); } Commit Message: If JavaScri...
0
25,132
Analyze the following 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 RenderViewTest::LoadHTML(const char* html) { std::string url_str = "data:text/html;charset=utf-8,"; url_str.append(html); GURL url(url_str); GetMainFrame()->loadRequest(WebURLRequest(url)); ProcessPendingMessages(); } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TES...
0
25,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: error::Error GLES2DecoderPassthroughImpl::DoColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) { api()->glColorMaskFn(red, gre...
0
23,106
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: QWebPreferences* QQuickWebViewExperimental::preferences() const { QQuickWebViewPrivate* const d = d_ptr; if (!d->preferences) d->preferences = adoptPtr(QWebPreferencesPrivate::createPreferences(d)); return d->preferences.get(); } Commit Message: [Qt][WK2] Allow transparent WebViews https://bu...
0
23,131
Analyze the following 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 activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) { long long t = dictGetSignedIntegerVal(de); if (now > t) { sds key = dictGetKey(de); robj *keyobj = createStringObject(key,sdslen(key)); propagateExpire(db,keyobj); dbDelete(db,keyobj); noti...
0
24,224
Analyze the following 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 ResourceDispatcherHostImpl::OnUploadProgressACK(int request_id) { int child_id = filter_->child_id(); PendingRequestList::iterator i = pending_requests_.find( GlobalRequestID(child_id, request_id)); if (i == pending_requests_.end()) return; ResourceRequestInfoImpl* info = ResourceReq...
0
9,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 LockScreenMediaControlsView::MediaSessionPositionChanged( const base::Optional<media_session::MediaPosition>& position) { if (hide_controls_timer_->IsRunning()) return; position_ = position; if (!position.has_value()) { if (progress_->GetVisible()) { progress_->SetVisible(false); ...
0
1,849
Analyze the following 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 long Chapters::Atom::GetStartTimecode() const { return m_start_timecode; } Commit Message: external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31...
0
21,145
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(stream_socket_get_name) { php_stream *stream; zval *zstream; zend_bool want_peer; char *name = NULL; int name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &zstream, &want_peer) == FAILURE) { RETURN_FALSE; } php_stream_from_zval(stream, &zstream); if (0 != php_stream_x...
0
29,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: static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, unsigned char __user *buf, size_t nr) { struct n_tty_data *ldata = tty->disc_data; unsigned char __user *b = buf; DEFINE_WAIT_FUNC(wait, woken_wake_function); int c; int minimum, time; ssize_t retval = 0; long timeout; int packet; s...
0
12,936
Analyze the following 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::HandleVertexAttribPointer( uint32 immediate_data_size, const gles2::VertexAttribPointer& c) { if (!bound_array_buffer_ || bound_array_buffer_->IsDeleted()) { SetGLError(GL_INVALID_VALUE, "glVertexAttribPointer", "no array buffer bound"); return error::kN...
0
17,219
Analyze the following 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::CreateBrowserWindow() { DCHECK(!window_); window_ = BrowserWindow::CreateBrowserWindow(this); #if defined(OS_WIN) { base::ThreadRestrictions::ScopedAllowIO allow_io; app::win::SetAppIdForWindow( type_ & TYPE_APP ? ShellIntegration::GetAppId(UTF8ToWide(app_name_), pro...
0
10,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: void WebContentsImpl::HandleMouseUp() { if (delegate_) delegate_->HandleMouseUp(); } 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/trun...
0
3,328
Analyze the following 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 virtio_net_get_config(VirtIODevice *vdev, uint8_t *config) { VirtIONet *n = VIRTIO_NET(vdev); struct virtio_net_config netcfg; stw_p(&netcfg.status, n->status); stw_p(&netcfg.max_virtqueue_pairs, n->max_queues); memcpy(netcfg.mac, n->mac, ETH_ALEN); memcpy(config, &netcfg, n->...
0
10,730
Analyze the following 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::DoFramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint client_texture_id, GLint level) { FramebufferManager::FramebufferInfo* framebuffer_info = GetFramebufferInfoForTarget(target); if (!framebuffer_info) { SetGLError(GL_INVALID_OPERATION, ...
0
10,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 OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData, OPJ_UINT32 stride, OPJ_UINT32 width, OPJ_UINT32 height) { OPJ_UINT32 x, y; OPJ_UINT8 *pix; const OPJ_UINT8 *beyond; beyond = pData + stride * height; pix = pData; x = y = 0U; whi...
1
3,236
Analyze the following 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_rcv_skb(struct sock *sk, struct sk_buff *skb) { /* Charge it to the socket. */ ipv4_pktinfo_prepare(sk, skb); if (sock_queue_rcv_skb(sk, skb) < 0) { kfree_skb(skb); return NET_RX_DROP; } return NET_RX_SUCCESS; } Commit Message: inet: prevent leakage of uninitialized memory to user in re...
0
1,470
Analyze the following 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::OnSelectRange(const gfx::Point& base, const gfx::Point& extent) { Send(new InputHostMsg_SelectRange_ACK(GetRenderWidget()->routing_id())); base::AutoReset<bool> handling_select_range(&handling_select_range_, true); frame_->selectRange(base, extent);...
0
18,248
Analyze the following 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 perf_event_context_sched_in(struct perf_event_context *ctx, struct task_struct *task) { struct perf_cpu_context *cpuctx; cpuctx = __get_cpu_context(ctx); if (cpuctx->task_ctx == ctx) return; perf_ctx_lock(cpuctx, ctx); perf_pmu_disable(ctx->pmu); /* * We want to keep the following pri...
0
7,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: upnp_get_portmapping_number_of_entries() { int n = 0, r = 0; unsigned short eport, iport; char protocol[4], iaddr[32], desc[64], rhost[32]; unsigned int leaseduration; do { protocol[0] = '\0'; iaddr[0] = '\0'; desc[0] = '\0'; r = upnp_get_redirection_infos_by_index(n, &eport, protocol, &iport, ...
0
29,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 MagickDLLCall PostscriptDelegateMessage(void *handle, const char *message,int length) { char **messages; ssize_t offset; offset=0; messages=(char **) handle; if (*messages == (char *) NULL) *messages=(char *) AcquireQuantumMemory(length+1,sizeof(char *)); else { of...
0
14,482
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderViewHostImpl::OnDocumentAvailableInMainFrame() { delegate_->DocumentAvailableInMainFrame(this); } Commit Message: Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chromiumcodereview.appspot.com/12036002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178728 0...
0
25,777
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SplitString(const std::wstring& str, wchar_t c, std::vector<std::wstring>* r) { SplitStringT(str, c, true, r); } Commit Message: wstring: remove wstring version of SplitString Retry of r84336. BUG=23581 Review URL: http://codereview.chromium.org/6930047 git-svn-id: sv...
1
6,404
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: g_NPP_SetWindow(NPP instance, NPWindow *np_window) { if (instance == NULL) return NPERR_INVALID_INSTANCE_ERROR; PluginInstance *plugin = PLUGIN_INSTANCE(instance); if (plugin == NULL) return NPERR_INVALID_INSTANCE_ERROR; if (plugin_funcs.setwindow == NULL) return NPERR_INVALID_FUNCTABLE_ERROR; plu...
0
25,848
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: evutil_rtrim_lws_(char *str) { char *cp; if (str == NULL) return; if ((cp = strchr(str, '\0')) == NULL || (cp == str)) return; --cp; while (*cp == ' ' || *cp == '\t') { *cp = '\0'; if (cp == str) break; --cp; } } Commit Message: evutil_parse_sockaddr_port(): fix buffer overflow @asn-the-g...
0
13,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: void ConversionContext::StartEffect(const EffectPaintPropertyNode* effect) { if (effect->OutputClip()) SwitchToClip(effect->OutputClip()); else EndClips(); int saved_count = 0; size_t save_layer_id = kNotFound; SwitchToTransform(effect->LocalTransformSpace()); bool has_filter = !effect->Fil...
0
14,522
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: NavigationControllerOopifBrowserTest() {} Commit Message: Abort navigations on 304 responses. A recent change (https://chromium-review.googlesource.com/1161479) accidentally resulted in treating 304 responses as downloads. This CL treats them as ERR_ABORTED instead. This doesn't exactly match old behavior, wh...
0
17,809
Analyze the following 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 ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, GLXContextTag tag) { __GLXcontext **table = cl->currentContexts; table[tag-1] = glxc; } Commit Message: CWE ID: CWE-20
0
23,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sctp_disposition_t sctp_sf_cookie_wait_icmp_abort(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { return sctp_stop_t1_and_abort(net, commands, SCTP_ERROR_NO_ERROR, ENOPROTOOP...
0
439
Analyze the following 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
482
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RenderFrameImpl::UniqueNameFrameAdapter::CollectAncestorNames( BeginPoint begin_point, bool (*should_stop)(base::StringPiece)) const { std::vector<base::StringPiece> result; for (blink::WebFrame* frame = begin_point == BeginPoint::kParentFrame ? GetWebFrame()->Paren...
0
8,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: u64 __blkg_prfill_u64(struct seq_file *sf, struct blkg_policy_data *pd, u64 v) { const char *dname = blkg_dev_name(pd->blkg); if (!dname) return 0; seq_printf(sf, "%s %llu\n", dname, (unsigned long long)v); return v; } Commit Message: blkcg: fix double free of new_blkg in blkcg_init_queue If blkg_create...
0
6,227
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: copy_attrs(ipp_t *to, /* I - Destination request */ ipp_t *from, /* I - Source request */ cups_array_t *ra, /* I - Requested attributes */ ipp_tag_t group, /* I - Group to copy */ int quickcopy, /* I - Do a quick copy? */ cups_array_t *exclude) /* I ...
0
13,903
Analyze the following 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 netsnmp_session_free(php_snmp_session **session) /* {{{ */ { if (*session) { PHP_SNMP_SESSION_FREE(peername); PHP_SNMP_SESSION_FREE(community); PHP_SNMP_SESSION_FREE(securityName); PHP_SNMP_SESSION_FREE(contextEngineID); efree(*session); *session = NULL; } } /* }}} */ Commit Message: C...
0
487
Analyze the following 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 PreProcessingFx_Process(effect_handle_t self, audio_buffer_t *inBuffer, audio_buffer_t *outBuffer) { preproc_effect_t * effect = (preproc_effect_t *)self; int status = 0; if (effect == NULL){ ALOGV("PreProcessingFx_Process() ERROR effect == NULL"); return -EINVAL; } preproc_session_t *...
0
28,638
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v) { return sshbuf_get_bignum1(ssh->state->incoming_packet, v); } Commit Message: CWE ID: CWE-119
0
21,578
Analyze the following 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 AsyncFileSystemChromium::remove(const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { m_webFileSystem->remove(path, new WebKit::WebFileSystemCallbacksImpl(callbacks)); } Commit Message: Remove BlobRegistry indirection since there is only one implementation. BUG= Review URL: https://chrom...
0
6,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: bool HTMLMediaElement::hasPendingActivity() const { if (m_shouldDelayLoadEvent) return true; if (m_networkState == kNetworkLoading) return true; { AutoReset<bool> scope(&m_officialPlaybackPositionNeedsUpdate, false); if (couldPlayIfEnoughData()) return true; } if (m_seeking) ...
0
19,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: static void encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args, struct compound_hdr *hdr) { __be32 *p; p = reserve_space(xdr, 24); *p++ = cpu_to_be32(OP_LOCKT); *p++ = cpu_to_be32(nfs4_lock_type(args->fl, 0)); p = xdr_encode_hyper(p, args->fl->fl_start); p = xdr_encode_hyper(p, nfs4_loc...
0
6,162
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: mrb_gc_free_mt(mrb_state *mrb, struct RClass *c) { kh_destroy(mt, mrb, c->mt); } Commit Message: `mrb_class_real()` did not work for `BasicObject`; fix #4037 CWE ID: CWE-476
0
14,148
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ssdpDiscoverAll(int s, int ipv6) { static const char MSearchMsgFmt[] = "M-SEARCH * HTTP/1.1\r\n" "HOST: %s:" XSTR(PORT) "\r\n" "ST: ssdp:all\r\n" "MAN: \"ssdp:discover\"\r\n" "MX: %u\r\n" "\r\n"; char bufr[512]; int n; int mx = 3; int linklocal = 1; struct sockaddr_storage sockudp_w; { n = sn...
0
8,350
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { long size, sent; int n; size = len; while (size) { n = php_pollfd_for_ms(s, POLLOUT, ftp->timeout_sec * 1000); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) { errno = ETI...
0
2,427
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(openssl_pkey_export_to_file) { struct php_x509_request req; zval * zpkey, * args = NULL; char * passphrase = NULL; size_t passphrase_len = 0; char * filename = NULL; size_t filename_len = 0; zend_resource *key_resource = NULL; int pem_write = 0; EVP_PKEY * key; BIO * bio_out = NULL; const ...
0
24,011
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: poly_same(PG_FUNCTION_ARGS) { POLYGON *polya = PG_GETARG_POLYGON_P(0); POLYGON *polyb = PG_GETARG_POLYGON_P(1); bool result; if (polya->npts != polyb->npts) result = false; else result = plist_same(polya->npts, polya->p, polyb->p); /* * Avoid leaking memory for toasted inputs ... needed for r...
0
21,961
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: CreateSaverWindow(ScreenPtr pScreen) { SetupScreen(pScreen); ScreenSaverStuffPtr pSaver; ScreenSaverAttrPtr pAttr; WindowPtr pWin; int result; unsigned long mask; Colormap wantMap; ColormapPtr pCmap; pSaver = &pScreen->screensaver; if (pSaver->pWindow) { pSaver->pW...
0
3,131
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nautilus_file_operations_duplicate (GList *files, GArray *relative_item_points, GtkWindow *parent_window, NautilusCopyCallback done_callback, ...
0
15,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: void OneClickSigninSyncStarter::SigninDialogDelegate::OnCancelSignin() { sync_starter_->CancelSigninAndDelete(); } Commit Message: Display confirmation dialog for untrusted signins BUG=252062 Review URL: https://chromiumcodereview.appspot.com/17482002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2085...
0
23,650
Analyze the following 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 RenderBlock::computePreferredLogicalWidths() { ASSERT(preferredLogicalWidthsDirty()); updateFirstLetter(); m_minPreferredLogicalWidth = 0; m_maxPreferredLogicalWidth = 0; RenderStyle* styleToUse = style(); if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->lo...
0
23,885
Analyze the following 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 shadow_copy2_chmod(vfs_handle_struct *handle, const char *fname, mode_t mode) { time_t timestamp; char *stripped; int ret, saved_errno; char *conv; if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname, &timestamp, &stripped)) { return -1; } if (timestamp == 0) { retur...
0
3,800
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int i2d_X509_bio(BIO *bp, X509 *x509) { return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509); } 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 the signature. Alth...
0
6,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: internalEntityProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { ENTITY *entity; const char *textStart, *textEnd; const char *next; enum XML_Error result; OPEN_INTERNAL_ENTITY *openEntity = parser->m_openInternalEntities; if (! openEntity) ...
1
5,061
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, char __user *, type, unsigned long, flags, void __user *, data) { int ret; char *kernel_type; char *kernel_dev; unsigned long data_page; kernel_type = copy_mount_string(type); ret = PTR_ERR(kernel_type); if (IS_ERR(kernel_type)) ...
0
6,761
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int perf_event_period(struct perf_event *event, u64 __user *arg) { struct perf_event_context *ctx = event->ctx; int ret = 0; u64 value; if (!is_sampling_event(event)) return -EINVAL; if (copy_from_user(&value, arg, sizeof(value))) return -EFAULT; if (!value) return -EINVAL; raw_spin_lock_i...
0
14,107
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void __init ion_reserve(struct ion_platform_data *data) { int i; for (i = 0; i < data->nr; i++) { if (data->heaps[i].size == 0) continue; if (data->heaps[i].base == 0) { phys_addr_t paddr; paddr = memblock_alloc_base(data->heaps[i].size, data->heaps[i].align, MEMBLOCK_ALLOC_A...
0
10,084
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: clamp_default_icc(const fz_colorspace *cs, const float *src, float *dst) { int i; fz_iccprofile *profile = cs->data; for (i = 0; i < profile->num_devcomp; i++) dst[i] = fz_clamp(src[i], 0, 1); } Commit Message: CWE ID: CWE-20
0
15,958
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FrameLoader::CommitProvisionalLoad() { DCHECK(Client()->HasWebView()); if (frame_->GetDocument()) { scoped_refptr<const SecurityOrigin> security_origin = SecurityOrigin::Create(provisional_document_loader_->Url()); provisional_document_loader_->GetTiming() .SetHasSameOriginAsPrev...
0
2,215