instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, struct nfs4_state_owner *sp, fmode_t fmode, int flags, const struct iattr *attrs, gfp_t gfp_mask) { struct dentry *parent = dget_parent(dentry); struct inode *dir = parent->d_inode; struct nfs_server *server = NFS_SERVER(dir); struc...
0
19,953
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void invalidate_stack_devices(i_ctx_t *i_ctx_p) { os_ptr op = osbot; while (op != ostop) { if (r_has_type(op, t_device)) op->value.pdevice = 0; op++; } } Commit Message: CWE ID:
0
1,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: static ssize_t ucma_query_path(struct ucma_context *ctx, void __user *response, int out_len) { struct rdma_ucm_query_path_resp *resp; int i, ret = 0; if (out_len < sizeof(*resp)) return -ENOSPC; resp = kzalloc(out_len, GFP_KERNEL); if (!resp) return -ENOMEM; resp->num_paths = ctx->cm_id->ro...
0
79,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: static void exit_handler(int signo) { (void)signo; running = 0; } Commit Message: Fix #1: Ensure recv buf is always NUL terminated Signed-off-by: Joachim Nilsson <troglobit@gmail.com> CWE ID: CWE-119
0
88,792
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SkBitmap TaskManagerTableModel::GetIcon(int row) { return model_->GetResourceIcon(row); } Commit Message: accelerators: Remove deprecated Accelerator ctor that takes booleans. BUG=128242 R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10399085 git-svn-id: svn://svn.chromium.org/chrome/...
0
106,547
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: GetCipherPtr(VALUE obj) { if (rb_obj_is_kind_of(obj, cCipher)) { EVP_CIPHER_CTX *ctx; GetCipher(obj, ctx); return EVP_CIPHER_CTX_cipher(ctx); } else { const EVP_CIPHER *cipher; StringValueCStr(obj); cipher = EVP_get_cipherbyname(RSTRING_PTR(obj)); if (!cipher) ossl_raise(rb_eArgError, ...
0
73,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: InputMethodStatusConnection* ChromeOSMonitorInputMethodStatus( void* language_library, LanguageCurrentInputMethodMonitorFunction current_input_method_changed, LanguageRegisterImePropertiesFunction register_ime_properties, LanguageUpdateImePropertyFunction update_ime_property, LanguageConnectio...
1
170,524
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: JSValue jsTestObjContentDocument(ExecState* exec, JSValue slotBase, const Identifier&) { JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase)); TestObj* impl = static_cast<TestObj*>(castedThis->impl()); return shouldAllowAccessToNode(exec, impl->contentDocument()) ? toJS(exec, castedThis->glo...
0
101,238
Analyze the following 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 ProfileSyncService::OnEncryptedTypesChanged( syncable::ModelTypeSet encrypted_types, bool encrypt_everything) { encrypted_types_ = encrypted_types; encrypt_everything_ = encrypt_everything; DVLOG(1) << "Encrypted types changed to " << syncable::ModelTypeSetToString(encrypted_types_) ...
0
104,963
Analyze the following 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 BookmarkManagerView::FileSelected(const FilePath& path, int index, void* params) { int id = reinterpret_cast<int>(params); if (id == IDS_BOOKMARK_MANAGER_IMPORT_MENU) { ImporterHost* host = new ImporterHost(); ProfileIn...
0
109,093
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos, loff_t *ppos, size_t count, ssize_t written) { struct file *file = iocb->ki_filp; struct address_space *mapping = file->f_mapping; const struct address_space_operations *a_ops = mapping->a_ops; stru...
0
58,813
Analyze the following 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 Ins_MSIRP( INS_ARG ) { Int point; TT_F26Dot6 distance; point = (Int)args[0]; if ( BOUNDS( args[0], CUR.zp1.n_points ) ) { CUR.error = TT_Err_Invalid_Reference; return; } /* XXX: Undocumented behaviour */ if ( CUR.GS.gep0 == 0 ) /* if in t...
0
5,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 lockdep_rtnl_is_held(void) { return lockdep_is_held(&rtnl_mutex); } Commit Message: net: fix infoleak in rtnetlink The stack object “map” has a total size of 32 bytes. Its last 4 bytes are padding generated by compiler. These padding bytes are not initialized and sent out via “nla_put”. Signed-off-by: Ka...
0
53,127
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: M_fs_system_t M_fs_path_get_system_type(M_fs_system_t sys_type) { if (sys_type == M_FS_SYSTEM_AUTO) { #ifdef _WIN32 return M_FS_SYSTEM_WINDOWS; #else return M_FS_SYSTEM_UNIX; #endif } return sys_type; } Commit Message: fs: Don't try to delete the file when copying. It could cause a security issue if the f...
0
79,643
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CastCastView::UpdateLabel() { if (cast_config_delegate_ == nullptr || cast_config_delegate_->HasCastExtension() == false) return; cast_config_delegate_->GetReceiversAndActivities( base::Bind(&CastCastView::UpdateLabelCallback, base::Unretained(this))); } Commit Message: Allow the cast t...
0
119,728
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MagickExport MagickBooleanType GetImageEntropy(const Image *image, double *entropy,ExceptionInfo *exception) { MagickBooleanType status; status=GetImageChannelEntropy(image,CompositeChannels,entropy,exception); return(status); } Commit Message: https://github.com/ImageMagick/ImageMagick/issues/1615 ...
0
88,933
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int proc_nr_files(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { files_stat.nr_files = get_nr_files(); return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); } Commit Message: get rid of s_files and files_lock The only thing we need it for is alt...
0
46,129
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int jas_stream_puts(jas_stream_t *stream, const char *s) { while (*s != '\0') { if (jas_stream_putc_macro(stream, *s) == EOF) { return -1; } ++s; } return 0; } Commit Message: The generation of the configuration file jas_config.h has been completely reworked in order to avoid pollution of the global ...
0
72,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 int jffs2_acl_count(size_t size) { size_t s; size -= sizeof(struct jffs2_acl_header); s = size - 4 * sizeof(struct jffs2_acl_entry_short); if (s < 0) { if (size % sizeof(struct jffs2_acl_entry_short)) return -1; return size / sizeof(struct jffs2_acl_entry_short); } else { if (s % sizeof(stru...
0
1,808
Analyze the following 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 RenderWidgetHostViewAura::GetCompositionCharacterBounds(uint32 index, gfx::Rect* rect) { DCHECK(rect); if (index >= composition_character_bounds_.size()) return false; *rect = ConvertRectToScreen(composition_character_bounds_[index]); r...
0
114,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: int ar6000_init(struct net_device *dev) { struct ar6_softc *ar; int status; s32 timeleft; s16 i; int ret = 0; if((ar = ar6k_priv(dev)) == NULL) { return -EIO; } if (wlaninitmode == WLAN_INIT_MODE_USR || wlaninitmode == WLAN_INIT_MODE_DRV) { ar6...
0
24,193
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int sctp_wait_for_connect(struct sctp_association *asoc, long *timeo_p) { struct sock *sk = asoc->base.sk; int err = 0; long current_timeo = *timeo_p; DEFINE_WAIT(wait); pr_debug("%s: asoc:%p, timeo:%ld\n", __func__, asoc, *timeo_p); /* Increment the association's refcnt. */ sctp_association_hold...
0
43,588
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void lockd_exit_net(struct net *net) { } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits)...
0
65,200
Analyze the following 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 atalk_create(struct net *net, struct socket *sock, int protocol, int kern) { struct sock *sk; int rc = -ESOCKTNOSUPPORT; if (!net_eq(net, &init_net)) return -EAFNOSUPPORT; /* * We permit SOCK_DGRAM and RAW is an extension. It is trivial to do * and gives you the full ELAP frame. Should b...
0
40,304
Analyze the following 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 __nd_alloc_stack(struct nameidata *nd) { struct saved *p; if (nd->flags & LOOKUP_RCU) { p= kmalloc(MAXSYMLINKS * sizeof(struct saved), GFP_ATOMIC); if (unlikely(!p)) return -ECHILD; } else { p= kmalloc(MAXSYMLINKS * sizeof(struct saved), GFP_KERNEL); if (unlikely(!p)) retu...
0
51,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: bool DownloadItemImpl::GetAutoOpened() { return auto_opened_; } Commit Message: Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, which could be dangerous and undesir...
0
146,304
Analyze the following 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 signed short ReadPropertySignedShort(const EndianType endian, const unsigned char *buffer) { union { unsigned short unsigned_value; signed short signed_value; } quantum; unsigned short value; if (endian == LSBEndian) { value=(unsigned short) buffer[1]...
0
50,609
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: compat_copy_entry_to_user(struct ip6t_entry *e, void __user **dstptr, unsigned int *size, struct xt_counters *counters, unsigned int i) { struct xt_entry_target *t; struct compat_ip6t_entry __user *ce; u_int16_t target_offset, next_offset; compat_uint_t origsize; const struct xt_entry_match *ematch...
0
85,015
Analyze the following 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 AXNodeObject::isTextControl() const { if (hasContentEditableAttributeSet()) return true; switch (roleValue()) { case TextFieldRole: case ComboBoxRole: case SearchBoxRole: case SpinButtonRole: return true; default: return false; } } Commit Message: Switch to equalI...
0
127,188
Analyze the following 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 ServiceWorkerHandler::Wire(UberDispatcher* dispatcher) { frontend_.reset(new ServiceWorker::Frontend(dispatcher->channel())); ServiceWorker::Dispatcher::wire(dispatcher, this); } Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StorageParti...
0
148,618
Analyze the following 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 cancel_budget(struct ubifs_info *c, struct page *page, struct ubifs_inode *ui, int appending) { if (appending) { if (!ui->dirty) ubifs_release_dirty_inode_budget(c, ui); mutex_unlock(&ui->ui_mutex); } if (!PagePrivate(page)) { if (PageChecked(page)) release_new_page_budget(c); el...
0
46,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: static ssize_t ucma_disconnect(struct ucma_file *file, const char __user *inbuf, int in_len, int out_len) { struct rdma_ucm_disconnect cmd; struct ucma_context *ctx; int ret; if (copy_from_user(&cmd, inbuf, sizeof(cmd))) return -EFAULT; ctx = ucma_get_ctx_dev(file, cmd.id); if (IS_ERR(ctx)) ...
0
79,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: static inline void free_vm86_irq(int irqnumber) { unsigned long flags; free_irq(irqnumber, NULL); vm86_irqs[irqnumber].tsk = NULL; spin_lock_irqsave(&irqbits_lock, flags); irqbits &= ~(1 << irqnumber); spin_unlock_irqrestore(&irqbits_lock, flags); } Commit Message: mm: thp: fix pmd_bad() triggering in co...
0
20,960
Analyze the following 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(mcrypt_module_get_supported_key_sizes) { int i, count = 0; int *key_sizes; MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir) array_init(return_value); key_sizes = mcrypt_module_get_algo_supported_key_sizes(module, dir, &count); for (i = 0; i < count; i++) { add_index_long(return_value, i, key_...
1
167,101
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: htmlnamePop(htmlParserCtxtPtr ctxt) { const xmlChar *ret; if (ctxt->nameNr <= 0) return (NULL); ctxt->nameNr--; if (ctxt->nameNr < 0) return (NULL); if (ctxt->nameNr > 0) ctxt->name = ctxt->nameTab[ctxt->nameNr - 1]; else ctxt->name = NULL; ret = ctxt->...
0
150,841
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const char *proxytype(proxytypes_t proxytype) { int i; for (i = 0; proxynames[i].name; i++) if (proxynames[i].proxytype == proxytype) return proxynames[i].name; return "invalid"; } Commit Message: stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime. Might have introduced a m...
0
36,612
Analyze the following 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 ChromeContentBrowserClient::AllowSaveLocalState( const content::ResourceContext& context) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); return !io_data->clear_local_state_on_exit()->GetValue(); } ...
0
98,722
Analyze the following 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 handleFatalErrorInV8() { CRASH(); } Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=86983 Reviewed by Adam Barth. The objective is to pass Isolate around in V8 bindings. This patch passes Isolate to throwNotEnoughArgumentsError(). No ...
0
109,735
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebGLRenderingContextBase::disable(GLenum cap) { if (isContextLost() || !ValidateCapability("disable", cap)) return; if (cap == GL_STENCIL_TEST) { stencil_enabled_ = false; ApplyStencilTest(); return; } if (cap == GL_SCISSOR_TEST) scissor_enabled_ = false; ContextGL()->Disable(c...
0
133,807
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, const WebPluginParams& params) { webkit::npapi::WebPluginInfo info; bool found; std::string mime_type; Send(new ViewHostMsg_GetPluginInfo( routing_id_, params.url, frame->top()->document().url(), ...
0
98,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: static bool isLegacyTargetOriginDesignation(v8::Handle<v8::Value> value) { if (value->IsString() || value->IsStringObject()) return true; return false; } Commit Message: Fix tracking of the id attribute string if it is shared across elements. The patch to remove AtomicStringImpl: http://src.chro...
0
110,450
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Browser::CloseWindow() { UserMetrics::RecordAction(UserMetricsAction("CloseWindow"), profile_); window_->Close(); } 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 bug per bug report. Review UR...
0
98,205
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) { regs->ip = ip; } Commit Message: perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting...
0
25,876
Analyze the following 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::StoreFocus() { view_->StoreFocus(); } Commit Message: Don't call WebContents::DownloadImage() callback if the WebContents were deleted BUG=583718 Review URL: https://codereview.chromium.org/1685343004 Cr-Commit-Position: refs/heads/master@{#375700} CWE ID:
0
132,012
Analyze the following 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 set_init_cxt(void) { struct cred *cred = (struct cred *)current->real_cred; struct aa_task_cxt *cxt; cxt = aa_alloc_task_context(GFP_KERNEL); if (!cxt) return -ENOMEM; cxt->profile = aa_get_profile(root_ns->unconfined); cred_cxt(cred) = cxt; return 0; } Commit Message: apparmor: fix...
0
51,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: devzvol_validate(struct sdev_node *dv) { dmu_objset_type_t do_type; char *dsname; char *nm = dv->sdev_name; int rc; sdcmn_err13(("validating ('%s' '%s')", dv->sdev_path, nm)); /* * validate only READY nodes; if someone is sitting on the * directory of a dataset that just got destroyed we could * get ...
0
46,012
Analyze the following 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::RemovePendingRequest(int child_id, int request_id) { PendingRequestList::iterator i = pending_requests_.find( GlobalRequestID(child_id, request_id)); if (i == pending_requests_.end()) { NOTREACHED() << "Trying to ...
0
107,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: DWORD OmniboxViewWin::EditDropTarget::OnDrop(IDataObject* data_object, DWORD key_state, POINT cursor_position, DWORD effect) { effect = OnDragOver(data_object, key_state, cursor...
0
107,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: static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe) { struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; u8 b[] = { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0...
0
35,452
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool EventTimeCueCompare(const std::pair<double, TextTrackCue*>& a, const std::pair<double, TextTrackCue*>& b) { if (a.first != b.first) return a.first - b.first < 0; if (a.second->track() != b.second->track()) return TrackIndexCompare(a.second->track(), b.secon...
0
124,990
Analyze the following 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 lo_req_flush(struct loop_device *lo, struct request *rq) { struct file *file = lo->lo_backing_file; int ret = vfs_fsync(file, 0); if (unlikely(ret && ret != -EINVAL)) ret = -EIO; return ret; } Commit Message: loop: fix concurrent lo_open/lo_release 范龙飞 reports that KASAN can report a use-after...
0
84,702
Analyze the following 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::didFirstLayout() { if (m_frame->page() && isBackForwardLoadType(m_loadType)) history()->restoreScrollPositionAndViewState(); } Commit Message: Don't wait to notify client of spoof attempt if a modal dialog is created. BUG=281256 TEST=See bug for repro steps. Review URL: https://ch...
0
111,639
Analyze the following 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 WriteTGAImage(const ImageInfo *image_info, Image *image) { CompressionType compression; const char *value; MagickBooleanType status; register const IndexPacket *indexes; register const PixelPacket *p; register ssize_t x; register ssize_t i...
0
71,746
Analyze the following 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 ssl_parse_finished( ssl_context *ssl ) { int ret; unsigned int hash_len; unsigned char buf[36]; SSL_DEBUG_MSG( 2, ( "=> parse finished" ) ); ssl->handshake->calc_finished( ssl, buf, ssl->endpoint ^ 1 ); /* * Switch to our negotiated transform and session parameters for inbound ...
0
29,014
Analyze the following 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 instance_mkdir(const char *name) { struct trace_array *tr; int ret; mutex_lock(&event_mutex); mutex_lock(&trace_types_lock); ret = -EEXIST; list_for_each_entry(tr, &ftrace_trace_arrays, list) { if (tr->name && strcmp(tr->name, name) == 0) goto out_unlock; } ret = -ENOMEM; tr = kzalloc(...
0
81,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: bool CreateTemporaryFile(FilePath* path) { base::ThreadRestrictions::AssertIOAllowed(); // For call to close(). FilePath directory; if (!GetTempDir(&directory)) return false; int fd = CreateAndOpenFdForTemporaryFile(directory, path); if (fd < 0) return false; ignore_result(HANDLE_EINTR(close(...
0
115,384
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int ring_buffer_iter_empty(struct ring_buffer_iter *iter) { struct ring_buffer_per_cpu *cpu_buffer; cpu_buffer = iter->cpu_buffer; return iter->head_page == cpu_buffer->commit_page && iter->head == rb_commit_index(cpu_buffer); } Commit Message: ring-buffer: Prevent overflow of size in ring_buffer_resize()...
0
72,604
Analyze the following 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 ipgre_init(void) { int err; printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) { printk(KERN_INFO "ipgre init: can't add protocol\n"); return -EAGAIN; } err = register_pernet_device(&ipgre_net_ops); if (err < 0) goto ...
1
165,884
Analyze the following 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 addReplySds(client *c, sds s) { if (prepareClientToWrite(c) != C_OK) { /* The caller expects the sds to be free'd. */ sdsfree(s); return; } if (_addReplyToBuffer(c,s,sdslen(s)) == C_OK) { sdsfree(s); } else { /* This method free's the sds when it is no ...
0
69,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 numtostr(js_State *J, const char *fmt, int w, double n) { char buf[32], *e; sprintf(buf, fmt, w, n); e = strchr(buf, 'e'); if (e) { int exp = atoi(e+1); sprintf(e, "e%+d", exp); } js_pushstring(J, buf); } Commit Message: Bug 700938: Fix stack overflow in numtostr as used by Number#toFi...
1
169,704
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void longLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttr", "TestObject", info.Holder(), info.GetIsolate()); TestObject* imp = V8TestObject::toNative(info.Holder()); V8T...
0
121,755
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int trunc_dealloc(struct gfs2_inode *ip, u64 size) { struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); unsigned int height = ip->i_height; u64 lblock; struct metapath mp; int error; if (!size) lblock = 0; else lblock = (size - 1) >> sdp->sd_sb.sb_bsize_shift; find_metapath(sdp, lblock, &mp, ip->i...
0
34,680
Analyze the following 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::DoGetBooleanv(GLenum pname, GLboolean* params, GLsizei params_size) { DCHECK(params); std::unique_ptr<GLint[]> values(new GLint[params_size]); memset(values.get(), 0, params_size * sizeof(GLint)); DoGetInteger...
0
141,313
Analyze the following 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 ShellContentClient::GetSandboxProfileForSandboxType( int sandbox_type, int* sandbox_profile_resource_id) const { return false; } 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://coder...
0
108,459
Analyze the following 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 ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size) { int i; /* read the pixels */ for (i = 0; i < 8; i++) { pixels[0] = av_clip_uint8(pixels[0] + block[0]); pixels[1] = av_clip_uint8(pixels[1] + block[1]); ...
0
81,700
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: quit_cmd(thread_t * thread) { smtp_t *smtp = THREAD_ARG(thread); if (send(thread->u.fd, SMTP_QUIT_CMD, strlen(SMTP_QUIT_CMD), 0) == -1) smtp->stage = ERROR; else smtp->stage++; return 0; } Commit Message: When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, fo...
0
75,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: static unsigned long elf_map(struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type, unsigned long total_size) { unsigned long map_addr; unsigned long size = eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr); unsigned long off = eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr); ...
0
44,281
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void DateTimeFieldElement::didFocus() { if (m_fieldOwner) m_fieldOwner->didFocusOnField(); } 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 and aria-val...
0
103,231
Analyze the following 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 *ext4_kvzalloc(size_t size, gfp_t flags) { void *ret; ret = kzalloc(size, flags); if (!ret) ret = __vmalloc(size, flags | __GFP_ZERO, PAGE_KERNEL); return ret; } Commit Message: ext4: fix undefined behavior in ext4_fill_flex_info() Commit 503358ae01b70ce6909d19dd01287093f6b6271c ("ext4: avoid divide...
0
20,498
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void Document::UnregisterNodeListWithIdNameCache(const LiveNodeListBase* list) { DCHECK(node_lists_[kInvalidateOnIdNameAttrChange].Contains(list)); node_lists_[kInvalidateOnIdNameAttrChange].erase(list); } Commit Message: Inherit CSP when we inherit the security origin This prevents attacks that use main wi...
0
134,178
Analyze the following 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 RenderThread::AddRoute(int32 routing_id, IPC::Channel::Listener* listener) { widget_count_++; return ChildThread::AddRoute(routing_id, listener); } Commit Message: DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7...
0
98,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: std::vector<uint8_t> NtlmClient::GetNegotiateMessage() const { return negotiate_message_; } Commit Message: [base] Make dynamic container to static span conversion explicit This change disallows implicit conversions from dynamic containers to static spans. This conversion can cause CHECK failures, and thus sh...
0
132,912
Analyze the following 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 PresentationConnection::send(DOMArrayBufferView* arrayBufferView, ExceptionState& exceptionState) { ASSERT(arrayBufferView); if (!canSendMessage(exceptionState)) return; m_messages.append(new Message(arrayBufferView->buffer())); handleMessageQueue(); } Commit M...
0
129,556
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ofpact_outputs_to_port(const struct ofpact *ofpact, ofp_port_t port) { switch (ofpact->type) { case OFPACT_OUTPUT: return ofpact_get_OUTPUT(ofpact)->port == port; case OFPACT_ENQUEUE: return ofpact_get_ENQUEUE(ofpact)->port == port; case OFPACT_CONTROLLER: return port == OF...
0
76,997
Analyze the following 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 usage_exit() { fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name); exit(EXIT_FAILURE); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic7817...
1
174,475
Analyze the following 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 NavigationControllerImpl::LoadURL( const GURL& url, const Referrer& referrer, PageTransition transition, const std::string& extra_headers) { LoadURLParams params(url); params.referrer = referrer; params.transition_type = transition; params.extra_headers = extra_headers; LoadURLWithP...
0
111,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: Tracks::Tracks( Segment* pSegment, long long start, long long size_, long long element_start, long long element_size) : m_pSegment(pSegment), m_start(start), m_size(size_), m_element_start(element_start), m_element_size(element_size), m_trackEntries(NULL), m_trackEn...
1
174,446
Analyze the following 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 get_interface(const char *name, interface_info *info) { strcpy(info->name, name); info->id = if_nametoindex(name); return WIFI_SUCCESS; } Commit Message: Fix use-after-free in wifi_cleanup() Release reference to cmd only after possibly calling getType(). BUG: 25753768 Change-Id: Id2156ce51...
0
161,946
Analyze the following 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 __ptrace_link(struct task_struct *child, struct task_struct *new_parent) { BUG_ON(!list_empty(&child->ptrace_entry)); list_add(&child->ptrace_entry, &new_parent->ptraced); child->parent = new_parent; } Commit Message: exec/ptrace: fix get_dumpable() incorrect tests The get_dumpable() return value is not...
0
30,935
Analyze the following 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 reds_handle_auth_sasl_steplen(void *opaque) { RedLinkInfo *link = (RedLinkInfo *)opaque; AsyncRead *obj = &link->async_read; RedsSASL *sasl = &link->stream->sasl; spice_info("Got steplen %d", sasl->len); if (sasl->len > SASL_DATA_MAX_LEN) { spice_warning("Too much SASL dat...
0
1,874
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: link_task_done (GObject *source_object, GAsyncResult *res, gpointer user_data) { CopyMoveJob *job; job = user_data; if (job->done_callback) { job->done_callback (job->debuting_files, !job_aborted ((CommonJob *) job), ...
0
61,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: des_setkey(const char *key, struct php_crypt_extended_data *data) { uint32_t k0, k1, rawkey0, rawkey1; int shifts, round; rawkey0 = (uint32_t)(u_char)key[3] | ((uint32_t)(u_char)key[2] << 8) | ((uint32_t)(u_char)key[1] << 16) | ((uint32_t)(u_char)key[0] << 24); rawkey1 = (uint32_t)(u_char)key[7] | ...
0
10,877
Analyze the following 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 cirrus_linear_bitblt_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { CirrusVGAState *s = opaque; if (s->cirrus_srcptr != s->cirrus_srcptr_end) { /* bitblt */ ...
0
7,585
Analyze the following 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 symlink_idempotent(const char *from, const char *to) { _cleanup_free_ char *p = NULL; int r; assert(from); assert(to); if (symlink(from, to) < 0) { if (errno != EEXIST) return -errno; r = readlink_malloc(to, &p...
0
96,117
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: gc_generational_mode_set(mrb_state *mrb, mrb_value self) { mrb_bool enable; mrb_get_args(mrb, "b", &enable); if (mrb->gc.generational != enable) change_gen_gc_mode(mrb, &mrb->gc, enable); return mrb_bool_value(enable); } Commit Message: Clear unused stack region that may refer freed objects; fix #3...
0
64,411
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: raptor_rdfxml_parse_init(raptor_parser* rdf_parser, const char *name) { raptor_rdfxml_parser* rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; raptor_sax2* sax2; raptor_world* world = rdf_parser->world; /* Allocate sax2 object */ sax2 = raptor_new_sax2(rdf_parser->world, &rdf_parser->locato...
0
22,015
Analyze the following 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 clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) { if (cfs_rq->last == se) __clear_buddies_last(se); if (cfs_rq->next == se) __clear_buddies_next(se); if (cfs_rq->skip == se) __clear_buddies_skip(se); } Commit Message: sched/fair: Fix infinite loop in update_blocked_averages()...
0
92,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: void DocumentLoader::DetachFromFrame() { DCHECK(frame_); StopLoading(); fetcher_->ClearContext(); if (!frame_) return; application_cache_host_->DetachFromDocumentLoader(); application_cache_host_.Clear(); service_worker_network_provider_ = nullptr; WeakIdentifierMap<DocumentLoader>::NotifyOb...
0
154,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: int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC) { OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname); if (mbctype == ONIG_ENCODING_UNDEF) { return FAILURE; } MBREX(default_mbctype) = mbctype; return SUCCESS; } Commit Message: Fix bug #72402: _php_mb_regex_ereg_replace_exec - do...
0
51,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: static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct sock *sk = sock->sk; int err = -ENOIOCTLCMD; if (sk->sk_prot->compat_ioctl) err = sk->sk_prot->compat_ioctl(sk, cmd, arg); return err; } Commit Message: net: add validation for the socket syscall protocol argu...
0
41,525
Analyze the following 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 imap_cachepath(struct ImapData *idata, const char *mailbox, char *dest, size_t dlen) { char *s = NULL; const char *p = mailbox; for (s = dest; p && *p && dlen; dlen--) { if (*p == idata->delim) { *s = '/'; /* simple way to avoid collisions with UIDs */ if (*(p + 1) >= '0' &...
0
79,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: ProcRenderAddTraps (ClientPtr client) { int ntraps; PicturePtr pPicture; REQUEST(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess); if (!pPicture->pDrawable) return BadDrawable; ntraps = (client->...
0
14,053
Analyze the following 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_eeprom (struct net_device *dev) { int i, j; long ioaddr = dev->base_addr; u8 sromdata[256]; u8 *psib; u32 crc; PSROM_t psrom = (PSROM_t) sromdata; struct netdev_private *np = netdev_priv(dev); int cid, next; #ifdef MEM_MAPPING ioaddr = pci_resource_start (np->pdev, 0); #endif /* Read eeprom */ ...
0
20,088
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bt_status_t src_connect_sink(RawAddress* bd_addr) { BTIF_TRACE_EVENT("%s", __func__); CHECK_BTAV_INIT(); return btif_queue_connect(UUID_SERVCLASS_AUDIO_SOURCE, bd_addr, connect_int); } Commit Message: DO NOT MERGE AVRC: Copy browse.p_browse_data in btif_av_event_deep_copy p_msg_src->browse.p_browse...
0
163,251
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: nfs4_find_slot(struct nfs4_slot_table *tbl) { u32 slotid; u32 ret_id = NFS4_NO_SLOT; dprintk("--> %s used_slots=%04lx highest_used=%u max_slots=%u\n", __func__, tbl->used_slots[0], tbl->highest_used_slotid, tbl->max_slots); slotid = find_first_zero_bit(tbl->used_slots, tbl->max_slots); if (slotid >= tbl...
0
19,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: DialogPlusConsoleObserverDelegate( content::WebContentsDelegate* original_delegate, WebContents* web_contents, const std::string& filter) : content::ConsoleObserverDelegate(web_contents, filter), web_contents_(web_contents), original_delegate_(original_delegate) {} Commi...
0
146,067
Analyze the following 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 btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, int skip_sum) { struct inode *inode = dip->inode; struct btrfs_root *root = BTRFS_I(inode)->root; struct bio *bio; struct bio *orig_bio = dip->orig_bio; struct bio_vec *bvec = orig_bio->bi_io_vec; u64 start_sector = orig_bio-...
0
34,351
Analyze the following 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 dentry *lock_rename(struct dentry *p1, struct dentry *p2) { struct dentry *p; if (p1 == p2) { inode_lock_nested(p1->d_inode, I_MUTEX_PARENT); return NULL; } mutex_lock(&p1->d_sb->s_vfs_rename_mutex); p = d_ancestor(p2, p1); if (p) { inode_lock_nested(p2->d_inode, I_MUTEX_PARENT); inode_loc...
0
67,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: int luaD_precall (lua_State *L, StkId func, int nresults) { LClosure *cl; ptrdiff_t funcr; if (!ttisfunction(func)) /* `func' is not a function? */ func = tryfuncTM(L, func); /* check the `function' tag method */ funcr = savestack(L, func); cl = &clvalue(func)->l; L->ci->savedpc = L->savedpc; i...
0
43,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: void NavigationController::CancelPendingReload() { DCHECK(pending_reload_ != NO_RELOAD); pending_reload_ = NO_RELOAD; } Commit Message: Ensure URL is updated after a cross-site navigation is pre-empted by an "ignored" navigation. BUG=77507 TEST=NavigationControllerTest.LoadURL_IgnorePreemptsPending Review ...
0
99,867